xf86-video-ati: Branch 'atombios-support' - 3 commits
Dave Airlie
airlied at kemper.freedesktop.org
Tue Nov 20 14:32:40 PST 2007
src/radeon.h | 3 -
src/radeon_driver.c | 106 ++++++++++++++++++++++++++++++++++------------------
src/radeon_reg.h | 9 ++++
3 files changed, 82 insertions(+), 36 deletions(-)
New commits:
commit e4b8a4479ddea9b083b3a763dc0b9302e7b9a82a
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Nov 21 08:06:12 2007 +1000
r600: add memory controller regs from AMD
diff --git a/src/radeon.h b/src/radeon.h
index 5e2782c..c37e134 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -579,6 +579,7 @@ typedef struct {
CARD32 gartLocation;
CARD32 mc_fb_location;
CARD32 mc_agp_location;
+ CARD32 mc_agp_location_hi;
void *MMIO; /* Map of MMIO region */
void *FB; /* Map of frame buffer */
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 8d9382b..8a79831 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1277,7 +1277,7 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
if (IS_AVIVO_VARIANT) {
if (info->ChipFamily >= CHIP_FAMILY_R600) {
- info->mc_fb_location = INREG(R600_MC_FB_LOCATION);
+ info->mc_fb_location = INREG(R600_MC_VM_FB_LOCATION);
info->mc_agp_location = 0xffffffc0;
} else if (info->ChipFamily == CHIP_FAMILY_RV515) {
info->mc_fb_location = INMC(pScrn, RV515_MC_FB_LOCATION);
@@ -1440,9 +1440,14 @@ static CARD32 RADEONGetAccessibleVRAM(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
- CARD32 aper_size = INREG(RADEON_CONFIG_APER_SIZE) / 1024;
+ CARD32 aper_size;
unsigned char byte;
+ if (info->ChipFamily >= CHIP_FAMILY_R600)
+ aper_size = INREG(R600_CONFIG_APER_SIZE) / 1024;
+ else
+ aper_size = INREG(RADEON_CONFIG_APER_SIZE) / 1024;
+
#ifdef XF86DRI
/* If we use the DRI, we need to check if it's a version that has the
* bug of always cropping MC_FB_LOCATION to one aperture, in which case
@@ -3765,10 +3770,11 @@ void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn,
(unsigned)restore->mc_agp_location);
if (IS_AVIVO_VARIANT) {
- CARD32 mc_fb_loc, mc_agp_loc;
+ CARD32 mc_fb_loc, mc_agp_loc, mc_agp_loc_hi = 0;
if (info->ChipFamily >= CHIP_FAMILY_R600) {
- mc_fb_loc = INREG(R600_MC_FB_LOCATION);
- mc_agp_loc = 0xffffffc0;
+ mc_fb_loc = INREG(R600_MC_VM_FB_LOCATION);
+ mc_agp_loc_hi = INREG(R600_MC_VM_AGP_TOP);
+ mc_agp_loc = INREG(R600_MC_VM_AGP_BOT);
} else if (info->ChipFamily == CHIP_FAMILY_RV515) {
mc_fb_loc = INMC(pScrn, RV515_MC_FB_LOCATION);
mc_agp_loc = INMC(pScrn, RV515_MC_AGP_LOCATION);
@@ -3815,7 +3821,7 @@ void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn,
}
if (info->ChipFamily >= CHIP_FAMILY_R600) {
- OUTREG(R600_MC_FB_LOCATION, info->mc_fb_location);
+ OUTREG(R600_MC_VM_FB_LOCATION, info->mc_fb_location);
} else {
if (info->ChipFamily == CHIP_FAMILY_RV515) {
OUTMC(pScrn, RV515_MC_FB_LOCATION, info->mc_fb_location);
@@ -3982,7 +3988,7 @@ static void RADEONAdjustMemMapRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
if (IS_AVIVO_VARIANT) {
if (info->ChipFamily >= CHIP_FAMILY_R600) {
- fb = INREG(R600_MC_FB_LOCATION);
+ fb = INREG(R600_MC_VM_FB_LOCATION);
agp = 0xffffffc0;
} else if (info->ChipFamily == CHIP_FAMILY_RV515) {
fb = INMC(pScrn, RV515_MC_FB_LOCATION);
diff --git a/src/radeon_reg.h b/src/radeon_reg.h
index 4b895ce..22f5268 100644
--- a/src/radeon_reg.h
+++ b/src/radeon_reg.h
@@ -3689,7 +3689,14 @@
# define AVIVO_I2C_EN (1 << 0)
# define AVIVO_I2C_RESET (1 << 8)
-#define R600_MC_FB_LOCATION 0x2180
+#define R600_MC_VM_FB_LOCATION 0x2180
+#define R600_MC_VM_AGP_TOP 0x2184
+#define R600_MC_VM_AGP_BOT 0x2188
+#define R600_MC_VM_AGP_BASE 0x218c
+#define R600_MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2190
+#define R600_MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2194
+#define R600_MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x2198
+
#define R600_BUS_CNTL 0x5420
#define R600_CONFIG_CNTL 0x5424
#define R600_CONFIG_MEMSIZE 0x5428
commit aa88da974b97ea1e9bbb47b3494543575c09d912
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Nov 21 08:01:35 2007 +1000
rs690 is !> r600
diff --git a/src/radeon.h b/src/radeon.h
index f776394..5e2782c 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -500,11 +500,11 @@ typedef enum {
CHIP_FAMILY_R580, /* r580 */
CHIP_FAMILY_RV560, /* rv560 */
CHIP_FAMILY_RV570, /* rv570 */
+ CHIP_FAMILY_RS690,
CHIP_FAMILY_R600, /* r60 */
CHIP_FAMILY_R630,
CHIP_FAMILY_RV610,
CHIP_FAMILY_RV630,
- CHIP_FAMILY_RS690,
CHIP_FAMILY_RS740,
CHIP_FAMILY_LAST
} RADEONChipFamily;
commit a5b34c2f1f7d5346c4489cb30e07291d1217026c
Author: Dave Airlie <airlied at redhat.com>
Date: Tue Nov 20 16:37:29 2007 +1000
r600: use standard memory controller setup paths
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 205e21e..8d9382b 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -774,7 +774,10 @@ Bool avivo_get_mc_idle(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
- if (info->ChipFamily == CHIP_FAMILY_RV515) {
+ if (info->ChipFamily >= CHIP_FAMILY_R600) {
+ /* no idea where this is on r600 yet */
+ return TRUE;
+ } else if (info->ChipFamily == CHIP_FAMILY_RV515) {
if (INMC(pScrn, RV515_MC_STATUS) & RV515_MC_STATUS_IDLE)
return TRUE;
else
@@ -1272,18 +1275,11 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
CARD32 mem_size;
CARD32 aper_size;
- if (info->ChipFamily >= CHIP_FAMILY_R600) {
- mem_size = INREG(RADEON_CONFIG_MEMSIZE);
- aper_size = INREG(RADEON_CONFIG_APER_SIZE);
- info->mc_fb_location = 0xcfffc000;
- info->fbLocation = (info->mc_fb_location & 0xffff) << 16;
- info->mc_agp_location = 0xffffffc0;
- return;
- }
-
if (IS_AVIVO_VARIANT) {
-
- if (info->ChipFamily == CHIP_FAMILY_RV515) {
+ if (info->ChipFamily >= CHIP_FAMILY_R600) {
+ info->mc_fb_location = INREG(R600_MC_FB_LOCATION);
+ info->mc_agp_location = 0xffffffc0;
+ } else if (info->ChipFamily == CHIP_FAMILY_RV515) {
info->mc_fb_location = INMC(pScrn, RV515_MC_FB_LOCATION);
info->mc_agp_location = INMC(pScrn, RV515_MC_AGP_LOCATION);
} else {
@@ -1299,8 +1295,16 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
/* We shouldn't use info->videoRam here which might have been clipped
* but the real video RAM instead
*/
- mem_size = INREG(RADEON_CONFIG_MEMSIZE);
- aper_size = INREG(RADEON_CONFIG_APER_SIZE);
+ if (info->ChipFamily >= CHIP_FAMILY_R600)
+ mem_size = INREG(R600_CONFIG_MEMSIZE);
+ else
+ mem_size = INREG(RADEON_CONFIG_MEMSIZE);
+
+ if (info->ChipFamily >= CHIP_FAMILY_R600)
+ aper_size = INREG(R600_CONFIG_APER_SIZE);
+ else
+ aper_size = INREG(RADEON_CONFIG_APER_SIZE);
+
if (mem_size == 0)
mem_size = 0x800000;
@@ -1329,7 +1333,13 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
else
#endif
{
- CARD32 aper0_base = INREG(RADEON_CONFIG_APER_0_BASE);
+ CARD32 aper0_base;
+
+ if (info->ChipFamily >= CHIP_FAMILY_R600) {
+ aper0_base = INREG(R600_CONFIG_F0_BASE);
+ } else {
+ aper0_base = INREG(RADEON_CONFIG_APER_0_BASE);
+ }
/* Recent chips have an "issue" with the memory controller, the
* location must be aligned to the size. We just align it down,
@@ -1346,12 +1356,21 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
info->ChipFamily == CHIP_FAMILY_RV410)
aper0_base &= ~(mem_size - 1);
- info->mc_fb_location = (aper0_base >> 16) |
+ if (info->ChipFamily >= CHIP_FAMILY_R600) {
+ info->mc_fb_location = (aper0_base >> 24) |
+ (((aper0_base + mem_size - 1) & 0xff000000U) >> 8);
+ ErrorF("mc fb loc is %08x\n", info->mc_fb_location);
+ } else {
+ info->mc_fb_location = (aper0_base >> 16) |
((aper0_base + mem_size - 1) & 0xffff0000U);
+ }
}
}
- info->fbLocation = (info->mc_fb_location & 0xffff) << 16;
-
+ if (info->ChipFamily >= CHIP_FAMILY_R600) {
+ info->fbLocation = (info->mc_fb_location & 0xffff) << 24;
+ } else {
+ info->fbLocation = (info->mc_fb_location & 0xffff) << 16;
+ }
/* Just disable the damn AGP apertures for now, it may be
* re-enabled later by the DRM
*/
@@ -3736,21 +3755,21 @@ void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn,
unsigned char *RADEONMMIO = info->MMIO;
int timeout;
- if (info->ChipFamily >= CHIP_FAMILY_R600)
- return;
-
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"RADEONRestoreMemMapRegisters() : \n");
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
" MC_FB_LOCATION : 0x%08x\n",
- (unsigned)restore->mc_fb_location);
+ (unsigned)info->mc_fb_location);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
" MC_AGP_LOCATION : 0x%08x\n",
(unsigned)restore->mc_agp_location);
if (IS_AVIVO_VARIANT) {
CARD32 mc_fb_loc, mc_agp_loc;
- if (info->ChipFamily == CHIP_FAMILY_RV515) {
+ if (info->ChipFamily >= CHIP_FAMILY_R600) {
+ mc_fb_loc = INREG(R600_MC_FB_LOCATION);
+ mc_agp_loc = 0xffffffc0;
+ } else if (info->ChipFamily == CHIP_FAMILY_RV515) {
mc_fb_loc = INMC(pScrn, RV515_MC_FB_LOCATION);
mc_agp_loc = INMC(pScrn, RV515_MC_AGP_LOCATION);
} else {
@@ -3795,16 +3814,20 @@ void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn,
usleep(10);
}
- if (info->ChipFamily == CHIP_FAMILY_RV515) {
- OUTMC(pScrn, RV515_MC_FB_LOCATION, info->mc_fb_location);
- OUTMC(pScrn, RV515_MC_AGP_LOCATION, 0x003f0000);
- (void)INMC(pScrn, RV515_MC_AGP_LOCATION);
+ if (info->ChipFamily >= CHIP_FAMILY_R600) {
+ OUTREG(R600_MC_FB_LOCATION, info->mc_fb_location);
} else {
- OUTMC(pScrn, R520_MC_FB_LOCATION, info->mc_fb_location);
- OUTMC(pScrn, R520_MC_AGP_LOCATION, 0x003f0000);
- (void)INMC(pScrn, R520_MC_FB_LOCATION);
+ if (info->ChipFamily == CHIP_FAMILY_RV515) {
+ OUTMC(pScrn, RV515_MC_FB_LOCATION, info->mc_fb_location);
+ OUTMC(pScrn, RV515_MC_AGP_LOCATION, 0x003f0000);
+ (void)INMC(pScrn, RV515_MC_AGP_LOCATION);
+ } else {
+ OUTMC(pScrn, R520_MC_FB_LOCATION, info->mc_fb_location);
+ OUTMC(pScrn, R520_MC_AGP_LOCATION, 0x003f0000);
+ (void)INMC(pScrn, R520_MC_FB_LOCATION);
+ }
+ OUTREG(AVIVO_HDP_FB_LOCATION, info->mc_fb_location);
}
- OUTREG(AVIVO_HDP_FB_LOCATION, info->mc_fb_location);
/* Reset the engine and HDP */
RADEONEngineReset(pScrn);
@@ -3958,7 +3981,10 @@ static void RADEONAdjustMemMapRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
int fb_loc_changed;
if (IS_AVIVO_VARIANT) {
- if (info->ChipFamily == CHIP_FAMILY_RV515) {
+ if (info->ChipFamily >= CHIP_FAMILY_R600) {
+ fb = INREG(R600_MC_FB_LOCATION);
+ agp = 0xffffffc0;
+ } else if (info->ChipFamily == CHIP_FAMILY_RV515) {
fb = INMC(pScrn, RV515_MC_FB_LOCATION);
agp = INMC(pScrn, RV515_MC_AGP_LOCATION);
} else {
@@ -3978,7 +4004,11 @@ static void RADEONAdjustMemMapRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
info->mc_agp_location, agp);
info->mc_fb_location = fb;
info->mc_agp_location = agp;
- info->fbLocation = (info->mc_fb_location & 0xffff) << 16;
+ if (info->ChipFamily >= CHIP_FAMILY_R600)
+ info->fbLocation = (info->mc_fb_location & 0xffff) << 24;
+ else
+ info->fbLocation = (info->mc_fb_location & 0xffff) << 16;
+
info->dst_pitch_offset =
(((pScrn->displayWidth * info->CurrentLayout.pixel_bytes / 64)
<< 22) | ((info->fbLocation + pScrn->fbOffset) >> 10));
diff --git a/src/radeon_reg.h b/src/radeon_reg.h
index 424ec19..4b895ce 100644
--- a/src/radeon_reg.h
+++ b/src/radeon_reg.h
@@ -3689,8 +3689,10 @@
# define AVIVO_I2C_EN (1 << 0)
# define AVIVO_I2C_RESET (1 << 8)
+#define R600_MC_FB_LOCATION 0x2180
#define R600_BUS_CNTL 0x5420
#define R600_CONFIG_CNTL 0x5424
#define R600_CONFIG_MEMSIZE 0x5428
+#define R600_CONFIG_F0_BASE 0x542C
#define R600_CONFIG_APER_SIZE 0x5430
#endif
More information about the xorg-commit
mailing list