From 71fa57f871dba03260dba2180ce1dab44048ac1a Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 14 May 2008 13:36:38 -0400 Subject: Add RS600 support --- src/ati_pciids_gen.h | 3 +++ src/atombios_output.c | 6 ++++-- src/pcidb/ati_pciids.csv | 3 +++ src/radeon.h | 2 ++ src/radeon_accel.c | 1 + src/radeon_atombios.c | 6 ++++-- src/radeon_chipinfo_gen.h | 3 +++ src/radeon_chipset_gen.h | 3 +++ src/radeon_commonfuncs.c | 4 +++- src/radeon_driver.c | 42 +++++++++++++++++++++++++++++++++------ src/radeon_exa_render.c | 1 + src/radeon_pci_chipset_gen.h | 3 +++ src/radeon_pci_device_match_gen.h | 3 +++ src/radeon_reg.h | 12 ++++++++++- 14 files changed, 80 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/ati_pciids_gen.h b/src/ati_pciids_gen.h index b5e000c4..eee1d60d 100644 --- a/src/ati_pciids_gen.h +++ b/src/ati_pciids_gen.h @@ -315,6 +315,9 @@ #define PCI_CHIP_RS350_7835 0x7835 #define PCI_CHIP_RS690_791E 0x791E #define PCI_CHIP_RS690_791F 0x791F +#define PCI_CHIP_RS600_793F 0x793F +#define PCI_CHIP_RS600_7941 0x7941 +#define PCI_CHIP_RS600_7942 0x7942 #define PCI_CHIP_RS740_796C 0x796C #define PCI_CHIP_RS740_796D 0x796D #define PCI_CHIP_RS740_796E 0x796E diff --git a/src/atombios_output.c b/src/atombios_output.c index d8e88cae..51be301f 100644 --- a/src/atombios_output.c +++ b/src/atombios_output.c @@ -611,7 +611,8 @@ dfp_disable_dither(xf86OutputPtr output, int device) OUTREG(AVIVO_TMDSA_BIT_DEPTH_CONTROL, 0); /* TMDSA */ break; case ATOM_DEVICE_DFP2_SUPPORT: - if ((info->ChipFamily == CHIP_FAMILY_RS690) || + if ((info->ChipFamily == CHIP_FAMILY_RS600) || + (info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) OUTREG(AVIVO_DDIA_BIT_DEPTH_CONTROL, 0); /* DDIA */ else @@ -927,7 +928,8 @@ atombios_output_mode_set(xf86OutputPtr output, if (IS_DCE3_VARIANT) { // fix me } else { - if ((info->ChipFamily == CHIP_FAMILY_RS690) || + if ((info->ChipFamily == CHIP_FAMILY_RS600) || + (info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) atombios_output_ddia_setup(output, adjusted_mode); else diff --git a/src/pcidb/ati_pciids.csv b/src/pcidb/ati_pciids.csv index 7308ce98..5c89b55e 100644 --- a/src/pcidb/ati_pciids.csv +++ b/src/pcidb/ati_pciids.csv @@ -316,6 +316,9 @@ "0x7835","RS350_7835","RS300",1,1,,,1,"ATI Radeon Mobility 9200 IGP 7835" "0x791E","RS690_791E","RS690",,1,,,1,"ATI Radeon X1200" "0x791F","RS690_791F","RS690",,1,,,1,"ATI Radeon X1200" +"0x793F","RS600_793F","RS600",,1,,,1,"ATI Radeon X1200" +"0x7941","RS600_7941","RS600",,1,,,1,"ATI Radeon X1200" +"0x7942","RS600_7942","RS600",,1,,,1,"ATI Radeon X1200" "0x796C","RS740_796C","RS740",,1,,,1,"ATI RS740" "0x796D","RS740_796D","RS740",,1,,,1,"ATI RS740M" "0x796E","RS740_796E","RS740",,1,,,1,"ATI RS740" diff --git a/src/radeon.h b/src/radeon.h index a7bf5e4c..86a4ebd9 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -270,6 +270,7 @@ typedef enum { CHIP_FAMILY_R580, /* r580 */ CHIP_FAMILY_RV560, /* rv560 */ CHIP_FAMILY_RV570, /* rv570 */ + CHIP_FAMILY_RS600, CHIP_FAMILY_RS690, CHIP_FAMILY_RS740, CHIP_FAMILY_R600, /* r600 */ @@ -319,6 +320,7 @@ typedef enum { (info->ChipFamily == CHIP_FAMILY_R420) || \ (info->ChipFamily == CHIP_FAMILY_RV410) || \ (info->ChipFamily == CHIP_FAMILY_RS690) || \ + (info->ChipFamily == CHIP_FAMILY_RS600) || \ (info->ChipFamily == CHIP_FAMILY_RS740) || \ (info->ChipFamily == CHIP_FAMILY_RS400) || \ (info->ChipFamily == CHIP_FAMILY_RS480)) diff --git a/src/radeon_accel.c b/src/radeon_accel.c index 23512130..92777c65 100644 --- a/src/radeon_accel.c +++ b/src/radeon_accel.c @@ -372,6 +372,7 @@ void RADEONEngineInit(ScrnInfoPtr pScrn) if ((info->ChipFamily == CHIP_FAMILY_RV410) || (info->ChipFamily == CHIP_FAMILY_R420) || + (info->ChipFamily == CHIP_FAMILY_RS600) || (info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740) || (info->ChipFamily == CHIP_FAMILY_RS400) || diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c index 3c87f984..fed9d1ff 100644 --- a/src/radeon_atombios.c +++ b/src/radeon_atombios.c @@ -1838,7 +1838,8 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn) (i == ATOM_DEVICE_TV2_INDEX) || (i == ATOM_DEVICE_CV_INDEX)) info->BiosConnector[i].ddc_i2c.valid = FALSE; - else if ((info->ChipFamily == CHIP_FAMILY_RS690) || + else if ((info->ChipFamily == CHIP_FAMILY_RS600) || + (info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) { /* IGP DFP ports use non-standard gpio entries */ if ((i == ATOM_DEVICE_DFP2_INDEX) || (i == ATOM_DEVICE_DFP3_INDEX)) @@ -1854,7 +1855,8 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn) if (i == ATOM_DEVICE_DFP1_INDEX) info->BiosConnector[i].TMDSType = TMDS_INT; else if (i == ATOM_DEVICE_DFP2_INDEX) { - if ((info->ChipFamily == CHIP_FAMILY_RS690) || + if ((info->ChipFamily == CHIP_FAMILY_RS600) || + (info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) info->BiosConnector[i].TMDSType = TMDS_DDIA; else diff --git a/src/radeon_chipinfo_gen.h b/src/radeon_chipinfo_gen.h index a3540ca3..3459002c 100644 --- a/src/radeon_chipinfo_gen.h +++ b/src/radeon_chipinfo_gen.h @@ -235,6 +235,9 @@ RADEONCardInfo RADEONCards[] = { { 0x7835, CHIP_FAMILY_RS300, 1, 1, 0, 0, 1 }, { 0x791E, CHIP_FAMILY_RS690, 0, 1, 0, 0, 1 }, { 0x791F, CHIP_FAMILY_RS690, 0, 1, 0, 0, 1 }, + { 0x793F, CHIP_FAMILY_RS600, 0, 1, 0, 0, 1 }, + { 0x7941, CHIP_FAMILY_RS600, 0, 1, 0, 0, 1 }, + { 0x7942, CHIP_FAMILY_RS600, 0, 1, 0, 0, 1 }, { 0x796C, CHIP_FAMILY_RS740, 0, 1, 0, 0, 1 }, { 0x796D, CHIP_FAMILY_RS740, 0, 1, 0, 0, 1 }, { 0x796E, CHIP_FAMILY_RS740, 0, 1, 0, 0, 1 }, diff --git a/src/radeon_chipset_gen.h b/src/radeon_chipset_gen.h index b6688232..b60e7e8f 100644 --- a/src/radeon_chipset_gen.h +++ b/src/radeon_chipset_gen.h @@ -235,6 +235,9 @@ static SymTabRec RADEONChipsets[] = { { PCI_CHIP_RS350_7835, "ATI Radeon Mobility 9200 IGP 7835" }, { PCI_CHIP_RS690_791E, "ATI Radeon X1200" }, { PCI_CHIP_RS690_791F, "ATI Radeon X1200" }, + { PCI_CHIP_RS600_793F, "ATI Radeon X1200" }, + { PCI_CHIP_RS600_7941, "ATI Radeon X1200" }, + { PCI_CHIP_RS600_7942, "ATI Radeon X1200" }, { PCI_CHIP_RS740_796C, "ATI RS740" }, { PCI_CHIP_RS740_796D, "ATI RS740M" }, { PCI_CHIP_RS740_796E, "ATI RS740" }, diff --git a/src/radeon_commonfuncs.c b/src/radeon_commonfuncs.c index 631c3509..b1dd6e87 100644 --- a/src/radeon_commonfuncs.c +++ b/src/radeon_commonfuncs.c @@ -590,7 +590,9 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn) OUT_ACCEL_REG(R300_SC_SCISSOR1, ((8191 << R300_SCISSOR_X_SHIFT) | (8191 << R300_SCISSOR_Y_SHIFT))); - if (IS_R300_VARIANT || (info->ChipFamily == CHIP_FAMILY_RS690) || + if (IS_R300_VARIANT || + (info->ChipFamily == CHIP_FAMILY_RS600) || + (info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) { /* clip has offset 1440 */ OUT_ACCEL_REG(R300_SC_CLIP_0_A, ((1088 << R300_CLIP_X_SHIFT) | diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 215886ee..83e0f851 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -576,6 +576,9 @@ unsigned RADEONINMC(ScrnInfoPtr pScrn, int addr) (info->ChipFamily == CHIP_FAMILY_RS740)) { OUTREG(RS690_MC_INDEX, (addr & RS690_MC_INDEX_MASK)); data = INREG(RS690_MC_DATA); + } else if (info->ChipFamily == CHIP_FAMILY_RS600) { + OUTREG(RS600_MC_INDEX, (addr & RS600_MC_INDEX_MASK)); + data = INREG(RS600_MC_DATA); } else if (IS_AVIVO_VARIANT) { OUTREG(AVIVO_MC_INDEX, (addr & 0xff) | 0x7f0000); (void)INREG(AVIVO_MC_INDEX); @@ -607,6 +610,11 @@ void RADEONOUTMC(ScrnInfoPtr pScrn, int addr, uint32_t data) RS690_MC_INDEX_WR_EN)); OUTREG(RS690_MC_DATA, data); OUTREG(RS690_MC_INDEX, RS690_MC_INDEX_WR_ACK); + } else if (info->ChipFamily == CHIP_FAMILY_RS600) { + OUTREG(RS600_MC_INDEX, ((addr & RS600_MC_INDEX_MASK) | + RS600_MC_INDEX_WR_EN)); + OUTREG(RS600_MC_DATA, data); + OUTREG(RS600_MC_INDEX, RS600_MC_INDEX_WR_ACK); } else if (IS_AVIVO_VARIANT) { OUTREG(AVIVO_MC_INDEX, (addr & 0xff) | 0xff0000); (void)INREG(AVIVO_MC_INDEX); @@ -635,6 +643,11 @@ static Bool avivo_get_mc_idle(ScrnInfoPtr pScrn) return TRUE; else return FALSE; + } else if (info->ChipFamily == CHIP_FAMILY_RS600) { + if (INMC(pScrn, RS600_MC_STATUS) & RS600_MC_STATUS_IDLE) + return TRUE; + else + return FALSE; } else if ((info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) { if (INMC(pScrn, RS690_MC_STATUS) & RS690_MC_STATUS_IDLE) @@ -669,6 +682,11 @@ static void radeon_write_mc_fb_agp_location(ScrnInfoPtr pScrn, int mask, uint32_ if (mask & LOC_AGP) OUTMC(pScrn, RV515_MC_AGP_LOCATION, agp_loc); (void)INMC(pScrn, RV515_MC_AGP_LOCATION); + } else if (info->ChipFamily == CHIP_FAMILY_RS600) { + if (mask & LOC_FB) + OUTMC(pScrn, RS600_MC_FB_LOCATION, fb_loc); + /* if (mask & LOC_AGP) + OUTMC(pScrn, RS600_MC_AGP_LOCATION, agp_loc);*/ } else if ((info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) { if (mask & LOC_FB) @@ -708,6 +726,13 @@ static void radeon_read_mc_fb_agp_location(ScrnInfoPtr pScrn, int mask, uint32_t *agp_loc = INMC(pScrn, RV515_MC_AGP_LOCATION); *agp_loc_hi = 0; } + } else if (info->ChipFamily == CHIP_FAMILY_RS600) { + if (mask & LOC_FB) + *fb_loc = INMC(pScrn, RS600_MC_FB_LOCATION); + if (mask & LOC_AGP) { + *agp_loc = 0;//INMC(pScrn, RS600_MC_AGP_LOCATION); + *agp_loc_hi = 0; + } } else if ((info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) { if (mask & LOC_FB) @@ -1252,7 +1277,8 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn) } #endif - if ((info->ChipFamily != CHIP_FAMILY_RS690) && + if ((info->ChipFamily != CHIP_FAMILY_RS600) && + (info->ChipFamily != CHIP_FAMILY_RS690) && (info->ChipFamily != CHIP_FAMILY_RS740)) { if (info->IsIGP) info->mc_fb_location = INREG(RADEON_NB_TOM); @@ -1816,6 +1842,7 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) (info->ChipFamily == CHIP_FAMILY_RS300) || (info->ChipFamily == CHIP_FAMILY_RS400) || (info->ChipFamily == CHIP_FAMILY_RS480) || + (info->ChipFamily == CHIP_FAMILY_RS600) || (info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) info->has_tcl = FALSE; @@ -2008,13 +2035,14 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) info->Chipset == PCI_CHIP_RC410_5A61 || info->Chipset == PCI_CHIP_RC410_5A62 || info->Chipset == PCI_CHIP_RS485_5975 || + info->ChipFamily == CHIP_FAMILY_RS600 || info->ChipFamily >= CHIP_FAMILY_R600) { - if (xf86ReturnOptValBool(info->Options, OPTION_DRI, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_DRI, FALSE)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Direct rendering for RN50/RC410/RS485/R600 forced on -- " + "Direct rendering for RN50/RC410/RS485/RS600/R600 forced on -- " "This is NOT officially supported at the hardware level " "and may cause instability or lockups\n"); - } else { + } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Direct rendering not officially supported on RN50/RC410/R600\n"); return FALSE; @@ -4317,7 +4345,8 @@ avivo_save(ScrnInfoPtr pScrn, RADEONSavePtr save) j++; } - if ((info->ChipFamily == CHIP_FAMILY_RS690) || + if ((info->ChipFamily == CHIP_FAMILY_RS600) || + (info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) { j = 0; /* save DDIA regs */ @@ -4622,7 +4651,8 @@ avivo_restore(ScrnInfoPtr pScrn, RADEONSavePtr restore) } /* DDIA regs */ - if ((info->ChipFamily == CHIP_FAMILY_RS690) || + if ((info->ChipFamily == CHIP_FAMILY_RS600) || + (info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740)) { j = 0; for (i = 0x7200; i <= 0x7290; i += 4) { diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c index 38959e65..99a59e64 100644 --- a/src/radeon_exa_render.c +++ b/src/radeon_exa_render.c @@ -2110,6 +2110,7 @@ static void FUNC_NAME(RadeonDoneComposite)(PixmapPtr pDst) if (IS_R500_3D || ((info->ChipFamily == CHIP_FAMILY_RS400) || (info->ChipFamily == CHIP_FAMILY_RS480) || + (info->ChipFamily == CHIP_FAMILY_RS600) || (info->ChipFamily == CHIP_FAMILY_RS690) || (info->ChipFamily == CHIP_FAMILY_RS740))) { /* r500 shows corruption on small things like glyphs without a 3D idle diff --git a/src/radeon_pci_chipset_gen.h b/src/radeon_pci_chipset_gen.h index 7bfae553..7e4cb172 100644 --- a/src/radeon_pci_chipset_gen.h +++ b/src/radeon_pci_chipset_gen.h @@ -235,6 +235,9 @@ PciChipsets RADEONPciChipsets[] = { { PCI_CHIP_RS350_7835, PCI_CHIP_RS350_7835, RES_SHARED_VGA }, { PCI_CHIP_RS690_791E, PCI_CHIP_RS690_791E, RES_SHARED_VGA }, { PCI_CHIP_RS690_791F, PCI_CHIP_RS690_791F, RES_SHARED_VGA }, + { PCI_CHIP_RS600_793F, PCI_CHIP_RS600_793F, RES_SHARED_VGA }, + { PCI_CHIP_RS600_7941, PCI_CHIP_RS600_7941, RES_SHARED_VGA }, + { PCI_CHIP_RS600_7942, PCI_CHIP_RS600_7942, RES_SHARED_VGA }, { PCI_CHIP_RS740_796C, PCI_CHIP_RS740_796C, RES_SHARED_VGA }, { PCI_CHIP_RS740_796D, PCI_CHIP_RS740_796D, RES_SHARED_VGA }, { PCI_CHIP_RS740_796E, PCI_CHIP_RS740_796E, RES_SHARED_VGA }, diff --git a/src/radeon_pci_device_match_gen.h b/src/radeon_pci_device_match_gen.h index 2a04f8d6..72ff0d17 100644 --- a/src/radeon_pci_device_match_gen.h +++ b/src/radeon_pci_device_match_gen.h @@ -235,6 +235,9 @@ static const struct pci_id_match radeon_device_match[] = { ATI_DEVICE_MATCH( PCI_CHIP_RS350_7835, 0 ), ATI_DEVICE_MATCH( PCI_CHIP_RS690_791E, 0 ), ATI_DEVICE_MATCH( PCI_CHIP_RS690_791F, 0 ), + ATI_DEVICE_MATCH( PCI_CHIP_RS600_793F, 0 ), + ATI_DEVICE_MATCH( PCI_CHIP_RS600_7941, 0 ), + ATI_DEVICE_MATCH( PCI_CHIP_RS600_7942, 0 ), ATI_DEVICE_MATCH( PCI_CHIP_RS740_796C, 0 ), ATI_DEVICE_MATCH( PCI_CHIP_RS740_796D, 0 ), ATI_DEVICE_MATCH( PCI_CHIP_RS740_796E, 0 ), diff --git a/src/radeon_reg.h b/src/radeon_reg.h index fb9f97fb..9988ec6b 100644 --- a/src/radeon_reg.h +++ b/src/radeon_reg.h @@ -3408,7 +3408,17 @@ #define RS690_MC_AGP_LOCATION 0x101 #define RS690_MC_AGP_BASE 0x102 #define RS690_MC_STATUS 0x90 -#define RS690_MC_STATUS_IDLE (1 << 0) +#define RS690_MC_STATUS_IDLE (1 << 0) + +#define RS600_MC_INDEX 0x78 +# define RS600_MC_INDEX_MASK 0xff +# define RS600_MC_INDEX_WR_EN (1 << 8) +# define RS600_MC_INDEX_WR_ACK 0xff +#define RS600_MC_DATA 0x7c + +#define RS600_MC_FB_LOCATION 0xA +#define RS600_MC_STATUS 0x0 +#define RS600_MC_STATUS_IDLE (1 << 0) #define AVIVO_MC_INDEX 0x0070 #define R520_MC_STATUS 0x00 -- cgit v1.2.3