diff options
Diffstat (limited to 'src/radeon_output.c')
-rw-r--r-- | src/radeon_output.c | 195 |
1 files changed, 2 insertions, 193 deletions
diff --git a/src/radeon_output.c b/src/radeon_output.c index b900f8ba..5cbf8382 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -47,8 +47,6 @@ #include "radeon_version.h" #include "radeon_tv.h" -#include "i2c_vid.h" -#include "sil164/sil164.h" const char *MonTypeName[7] = { "AUTO", @@ -148,17 +146,6 @@ static const RADEONTMDSPll default_tmds_pll[CHIP_FAMILY_LAST][4] = {{15000, 0xb0155}, {0xffffffff, 0xb01cb}, {0, 0}, {0, 0}}, /*CHIP_FAMILY_RS400*/ /* FIXME: just values from rv380 used... */ }; -static const char *SIL164Symbols[] = { - "Sil164VidOutput", - NULL -}; - -RADEONDVORec radeon_dvo_drivers[] = - { { 0, "sil164", "SIL164VidOutput", SIL164Symbols, NULL, NULL, NULL} }; - -#define RADEON_NUM_DVO_DRIVERS (sizeof(radeon_dvo_drivers)/sizeof(RADEONDVORec)) - - static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr output); static void RADEONUpdatePanelSize(xf86OutputPtr output); static RADEONMonitorType radeon_detect_tv(ScrnInfoPtr pScrn); @@ -167,159 +154,6 @@ static RADEONMonitorType radeon_detect_tv_dac(ScrnInfoPtr pScrn, Bool color); static RADEONMonitorType radeon_detect_ext_dac(ScrnInfoPtr pScrn); static void RADEONGetTMDSInfoFromTable(xf86OutputPtr output); -Bool RADEONFindDVOController(ScrnInfoPtr pScrn, xf86OutputPtr output) -{ - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - RADEONOutputPrivatePtr radeon_output = output->driver_private; - RADEONDVOPtr drv; - void *ret_ptr; - int i; - - for (i = 0; i < RADEON_NUM_DVO_DRIVERS; i++) { - drv = &radeon_dvo_drivers[i]; - drv->modhandle = xf86LoadSubModule(pScrn, drv->modulename); - - if (!drv->modhandle) - continue; - - xf86LoaderReqSymLists(drv->symbols, NULL); - - radeon_output->ExtChip = NULL; - ret_ptr = NULL; - drv->vid_rec = LoaderSymbol(drv->fntablename); - - ErrorF("dvo i2c reg: 0x%02x\n", radeon_output->dvo_i2c_reg); - - OUTREG(radeon_output->dvo_i2c_reg, INREG(radeon_output->dvo_i2c_reg) & - (CARD32)~(RADEON_GPIO_A_0 | RADEON_GPIO_A_1)); - - if (drv->vid_rec) - ret_ptr = drv->vid_rec->init(radeon_output->pDVOBus, radeon_output->dvo_slave_addr); - - if (ret_ptr) { - drv->devpriv = ret_ptr; - radeon_output->ExtChip = drv; - return TRUE; - } - xf86UnloadSubModule(drv->modhandle); - } - - ErrorF("dvo chip detect failed\n"); - return FALSE; -} - -void RADEONDVOPowerSet(ScrnInfoPtr pScrn, xf86OutputPtr output, int mode) -{ - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - RADEONOutputPrivatePtr radeon_output = output->driver_private; - - if (!radeon_output->ExtChip) - return; - - OUTREG(radeon_output->dvo_i2c_reg, INREG(radeon_output->dvo_i2c_reg) & - (CARD32)~(RADEON_GPIO_A_0 | RADEON_GPIO_A_1)); - radeon_output->ExtChip->vid_rec->dump_regs(radeon_output->ExtChip->devpriv); - radeon_output->ExtChip->vid_rec->dpms(radeon_output->ExtChip->devpriv, mode); - -} - -static void RADEONDVOSaveRegisters(ScrnInfoPtr pScrn, xf86OutputPtr output) -{ - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - RADEONOutputPrivatePtr radeon_output = output->driver_private; - - if (!radeon_output->ExtChip) - return; - - OUTREG(radeon_output->dvo_i2c_reg, INREG(radeon_output->dvo_i2c_reg) & - (CARD32)~(RADEON_GPIO_A_0 | RADEON_GPIO_A_1)); - radeon_output->ExtChip->vid_rec->dump_regs(radeon_output->ExtChip->devpriv); - radeon_output->ExtChip->vid_rec->save(radeon_output->ExtChip->devpriv); - -} - -static void RADEONDVOProgramRegisters(ScrnInfoPtr pScrn, xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) -{ - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - RADEONOutputPrivatePtr radeon_output = output->driver_private; - - if (!radeon_output->ExtChip) - return; - - OUTREG(radeon_output->dvo_i2c_reg, INREG(radeon_output->dvo_i2c_reg) & - (CARD32)~(RADEON_GPIO_A_0 | RADEON_GPIO_A_1)); - radeon_output->ExtChip->vid_rec->dump_regs(radeon_output->ExtChip->devpriv); - radeon_output->ExtChip->vid_rec->mode_set(radeon_output->ExtChip->devpriv, mode, adjusted_mode); - -} - -static void RADEONDVORestoreRegisters(ScrnInfoPtr pScrn, xf86OutputPtr output) -{ - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - RADEONOutputPrivatePtr radeon_output = output->driver_private; - - if (!radeon_output->ExtChip) - return; - - OUTREG(radeon_output->dvo_i2c_reg, INREG(radeon_output->dvo_i2c_reg) & - (CARD32)~(RADEON_GPIO_A_0 | RADEON_GPIO_A_1)); - radeon_output->ExtChip->vid_rec->dump_regs(radeon_output->ExtChip->devpriv); - radeon_output->ExtChip->vid_rec->restore(radeon_output->ExtChip->devpriv); - -} - -static ModeStatus RADEONDVOModeValid(ScrnInfoPtr pScrn, xf86OutputPtr output, DisplayModePtr mode) -{ - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - RADEONOutputPrivatePtr radeon_output = output->driver_private; - - if (!radeon_output->ExtChip) - return MODE_OK; - - OUTREG(radeon_output->dvo_i2c_reg, INREG(radeon_output->dvo_i2c_reg) & - (CARD32)~(RADEON_GPIO_A_0 | RADEON_GPIO_A_1)); - radeon_output->ExtChip->vid_rec->dump_regs(radeon_output->ExtChip->devpriv); - return radeon_output->ExtChip->vid_rec->mode_valid(radeon_output->ExtChip->devpriv, mode); - -} - -void RADEONSaveExtChipRegisters(ScrnInfoPtr pScrn) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - RADEONOutputPrivatePtr radeon_output; - xf86OutputPtr output; - int o; - - for (o = 0; o < xf86_config->num_output; o++) { - output = xf86_config->output[o]; - radeon_output = output->driver_private; - if (radeon_output->TMDSType == TMDS_EXT) - RADEONDVOSaveRegisters(pScrn, output); - } -} - -void RADEONRestoreExtChipRegisters(ScrnInfoPtr pScrn) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - RADEONOutputPrivatePtr radeon_output; - xf86OutputPtr output; - int o; - - for (o = 0; o < xf86_config->num_output; o++) { - output = xf86_config->output[o]; - radeon_output = output->driver_private; - if (radeon_output->TMDSType == TMDS_EXT) - RADEONDVORestoreRegisters(pScrn, output); - } - -} - void RADEONPrintPortMap(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); @@ -804,7 +638,6 @@ static int radeon_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { RADEONOutputPrivatePtr radeon_output = output->driver_private; - ScrnInfoPtr pScrn = output->scrn; if (radeon_output->type == OUTPUT_STV || radeon_output->type == OUTPUT_CTV) { @@ -815,10 +648,6 @@ radeon_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) return MODE_CLOCK_RANGE; } - if (radeon_output->MonType == MT_DFP && - radeon_output->TMDSType == TMDS_EXT) - return RADEONDVOModeValid(pScrn, output, pMode); - if (radeon_output->type != OUTPUT_LVDS) return MODE_OK; @@ -949,12 +778,6 @@ static void RADEONInitFP2Registers(xf86OutputPtr output, RADEONSavePtr save, save->fp2_gen_cntl &= ~(RADEON_FP2_ON | RADEON_FP2_DVO_EN); - /* XXX: these may be chip specific */ - save->fp2_gen_cntl |= (1 << 22) | R200_FP2_DVO_CLOCK_MODE_SINGLE; - - if (mode->Clock > 165000) - save->fp2_gen_cntl |= R200_FP2_DVO_DUAL_CHANNEL_EN; - if (IsPrimary) { if ((info->ChipFamily == CHIP_FAMILY_R200) || IS_R300_VARIANT) { save->fp2_gen_cntl &= ~(R200_FP2_SOURCE_SEL_MASK | @@ -1212,7 +1035,6 @@ radeon_mode_set(xf86OutputPtr output, DisplayModePtr mode, RADEONRestoreFPRegisters(pScrn, &info->ModeReg); } else { ErrorF("restore FP2\n"); - RADEONDVOProgramRegisters(pScrn, output, mode, adjusted_mode); RADEONRestoreFP2Registers(pScrn, &info->ModeReg); } break; @@ -2636,21 +2458,7 @@ void RADEONInitConnector(xf86OutputPtr output) } if (radeon_output->type == OUTPUT_DVI) { - if (radeon_output->TMDSType == TMDS_EXT) { -#if defined(__powerpc__) - radeon_output->dvo_i2c_reg = RADEON_GPIO_MONID; - radeon_output->dvo_slave_addr = 0x70; -#else - if (!RADEONGetExtTMDSInfoFromBIOS(output)) { - radeon_output->dvo_i2c_reg = RADEON_GPIO_CRT2_DDC; - radeon_output->dvo_slave_addr = 0x70; - } -#endif - RADEONI2CInit(pScrn, &radeon_output->pDVOBus, radeon_output->dvo_i2c_reg, "DVO"); - /* probe dvo chips */ - RADEONFindDVOController(pScrn, output); - } else - RADEONGetTMDSInfo(output); + RADEONGetTMDSInfo(output); } if (radeon_output->type == OUTPUT_STV || @@ -2670,6 +2478,7 @@ static Bool RADEONSetupAppleConnectors(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); + switch (info->MacModel) { case RADEON_MAC_IBOOK: info->BiosConnector[0].DDCType = DDC_DVI; |