diff options
author | Alex Deucher <alex@botch2.(none)> | 2007-11-07 01:22:30 -0500 |
---|---|---|
committer | Alex Deucher <alex@botch2.(none)> | 2007-11-07 01:22:30 -0500 |
commit | 96273016a0bbdfa4d3a4e6275a3b09eeeadaa534 (patch) | |
tree | 949dd1104d0c93b050eb903aa9a52762742f56fa | |
parent | 5c495c81cc3bcd4a38d06954243ed3bdc85bdc07 (diff) |
fix and move crtc source set up atombios_output.c
it's really more output related.
-rw-r--r-- | src/atombios_crtc.c | 48 | ||||
-rw-r--r-- | src/atombios_output.c | 81 | ||||
-rw-r--r-- | src/radeon_probe.h | 3 |
3 files changed, 74 insertions, 58 deletions
diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c index baa8c1be..f15c7079 100644 --- a/src/atombios_crtc.c +++ b/src/atombios_crtc.c @@ -103,51 +103,6 @@ atombios_crtc_dpms(xf86CrtcPtr crtc, int mode) } } -static void -atombios_set_crtc_source(xf86CrtcPtr crtc) -{ - RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; - RADEONInfoPtr info = RADEONPTR(crtc->scrn); - unsigned char *RADEONMMIO = info->MMIO; - AtomBIOSArg data; - unsigned char *space; - SELECT_CRTC_SOURCE_PS_ALLOCATION crtc_src_param; - int index = GetIndexIntoMasterTable(COMMAND, SelectCRTC_Source); - int major, minor; - - atombios_get_command_table_version(info->atomBIOS, index, &major, &minor); - - ErrorF("select crtc source table is %d %d\n", major, minor); - - switch(major) { - case 1: { - switch(minor) { - case 0: - case 1: - default: - crtc_src_param.ucCRTC = radeon_crtc->crtc_id; - crtc_src_param.ucDevice = radeon_crtc->crtc_id? 0: 3; - break; - } - break; - } - default: - break; - } - - data.exec.index = index; - data.exec.dataSpace = (void *)&space; - data.exec.pspace = &crtc_src_param; - - if (RHDAtomBIOSFunc(info->atomBIOS->scrnIndex, info->atomBIOS, ATOMBIOS_EXEC, &data) == ATOM_SUCCESS) { - ErrorF("Set CRTC Source success\n"); - return; - } - - ErrorF("Set CRTC Source failed\n"); - return; -} - static AtomBiosResult atombios_set_crtc_timing(atomBIOSHandlePtr atomBIOS, SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION *crtc_param) { @@ -450,7 +405,8 @@ atombios_crtc_mode_set(xf86CrtcPtr crtc, } - atombios_set_crtc_source(crtc); + // moved to output + //atombios_set_crtc_source(crtc); atombios_set_crtc_timing(info->atomBIOS, &crtc_timing); diff --git a/src/atombios_output.c b/src/atombios_output.c index 210ce7a3..3c5e8a82 100644 --- a/src/atombios_output.c +++ b/src/atombios_output.c @@ -257,7 +257,7 @@ atombios_output_lvds_dpms(xf86OutputPtr output, int mode) void atombios_output_dpms(xf86OutputPtr output, int mode) { - RADEONOutputPrivatePtr avivo_output = output->driver_private; + RADEONOutputPrivatePtr radeon_output = output->driver_private; RADEONInfoPtr info = RADEONPTR(output->scrn); unsigned char *RADEONMMIO = info->MMIO; int tmp, count; @@ -284,12 +284,12 @@ atombios_output_dpms(xf86OutputPtr output, int mode) ErrorF("AGD: output dpms\n"); - if (avivo_output->MonType == MT_LCD) { + if (radeon_output->MonType == MT_LCD) { atombios_output_tmds2_dpms(output, mode); - } else if (avivo_output->MonType == MT_DFP) { + } else if (radeon_output->MonType == MT_DFP) { ErrorF("AGD: tmds dpms\n"); atombios_output_tmds1_dpms(output, mode); - } else if (avivo_output->MonType == MT_CRT) { + } else if (radeon_output->MonType == MT_CRT) { ErrorF("AGD: dac dpms\n"); atombios_output_dac_dpms(output, mode); } @@ -301,22 +301,81 @@ atombios_output_dpms(xf86OutputPtr output, int mode) #endif } +static void +atombios_set_crtc_source(xf86OutputPtr output) +{ + RADEONOutputPrivatePtr radeon_output = output->driver_private; + RADEONCrtcPrivatePtr radeon_crtc = output->crtc->driver_private; + RADEONInfoPtr info = RADEONPTR(output->scrn); + unsigned char *RADEONMMIO = info->MMIO; + AtomBIOSArg data; + unsigned char *space; + SELECT_CRTC_SOURCE_PS_ALLOCATION crtc_src_param; + int index = GetIndexIntoMasterTable(COMMAND, SelectCRTC_Source); + int major, minor; + + atombios_get_command_table_version(info->atomBIOS, index, &major, &minor); + + ErrorF("select crtc source table is %d %d\n", major, minor); + + switch(major) { + case 1: { + switch(minor) { + case 0: + case 1: + default: + crtc_src_param.ucCRTC = radeon_crtc->crtc_id; + if (radeon_output->MonType == MT_CRT) { + if (radeon_output->DACType == DAC_PRIMARY) + crtc_src_param.ucDevice = 0; + else + crtc_src_param.ucDevice = 4; + } else if (radeon_output->MonType == MT_DFP) { + if (radeon_output->TMDSType == TMDS_INT) + crtc_src_param.ucDevice = 3; + else + crtc_src_param.ucDevice = 7; + } else if (radeon_output->MonType == MT_LCD) + crtc_src_param.ucDevice = 1; + else if (radeon_output->MonType == MT_STV || radeon_output->MonType == MT_CTV) + crtc_src_param.ucDevice = 2; + else if (radeon_output->MonType == MT_CV) + crtc_src_param.ucDevice = 8; + break; + } + break; + } + default: + break; + } + + data.exec.index = index; + data.exec.dataSpace = (void *)&space; + data.exec.pspace = &crtc_src_param; + + if (RHDAtomBIOSFunc(info->atomBIOS->scrnIndex, info->atomBIOS, ATOMBIOS_EXEC, &data) == ATOM_SUCCESS) { + ErrorF("Set CRTC Source success\n"); + return; + } + + ErrorF("Set CRTC Source failed\n"); + return; +} + void atombios_output_mode_set(xf86OutputPtr output, - DisplayModePtr mode, - DisplayModePtr adjusted_mode) + DisplayModePtr mode, + DisplayModePtr adjusted_mode) { RADEONInfoPtr info = RADEONPTR(output->scrn); unsigned char *RADEONMMIO = info->MMIO; RADEONOutputPrivatePtr radeon_output = output->driver_private; + atombios_set_crtc_source(output); + if (radeon_output->MonType == MT_CRT) { - if (radeon_output->DACType == DAC_PRIMARY) { - ErrorF("AGD: atom dac setup\n"); - atombios_output_dac_setup(output, adjusted_mode); - } + atombios_output_dac_setup(output, adjusted_mode); } else if (radeon_output->MonType == MT_DFP) { - ErrorF("AGD: atom tmds setup\n"); if (radeon_output->TMDSType == TMDS_INT) atombios_output_tmds1_setup(output, adjusted_mode); else diff --git a/src/radeon_probe.h b/src/radeon_probe.h index 3b493b87..db808d22 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -71,7 +71,8 @@ typedef enum MT_LCD = 2, MT_DFP = 3, MT_CTV = 4, - MT_STV = 5 + MT_STV = 5, + MT_CV = 6 } RADEONMonitorType; typedef enum |