summaryrefslogtreecommitdiff
path: root/src/atombios_crtc.c
diff options
context:
space:
mode:
authorAlex Deucher <alex@botch2.(none)>2007-11-11 12:37:01 -0500
committerAlex Deucher <alex@botch2.(none)>2007-11-11 12:37:01 -0500
commit7ce730828c293f0810dfdc554df48dfd76e35c49 (patch)
tree614042738080167e131e10e8716edcc1bc9e4b4f /src/atombios_crtc.c
parentd61b6c78aa7810a2f9b9e2d9d95aab4295de80ce (diff)
rework crtc output source setup
Diffstat (limited to 'src/atombios_crtc.c')
-rw-r--r--src/atombios_crtc.c71
1 files changed, 69 insertions, 2 deletions
diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c
index 5e537310..7a6fadf5 100644
--- a/src/atombios_crtc.c
+++ b/src/atombios_crtc.c
@@ -306,6 +306,74 @@ atombios_crtc_set_pll(xf86CrtcPtr crtc, DisplayModePtr mode)
return;
}
+static void
+atombios_set_crtc_source(xf86CrtcPtr crtc)
+{
+ ScrnInfoPtr pScrn = crtc->scrn;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ 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, i;
+
+ atombios_get_command_table_version(info->atomBIOS, index, &major, &minor);
+
+ ErrorF("select crtc source table is %d %d\n", major, minor);
+
+ crtc_src_param.ucCRTC = radeon_crtc->crtc_id;
+ crtc_src_param.ucDevice = 0;
+
+ for (i = 0; i < xf86_config->num_output; i++) {
+ xf86OutputPtr output = xf86_config->output[i];
+ RADEONOutputPrivatePtr radeon_output = output->driver_private;
+
+ switch(major) {
+ case 1: {
+ switch(minor) {
+ case 0:
+ case 1:
+ default:
+ if (radeon_output->MonType == MT_CRT) {
+ if (radeon_output->DACType == DAC_PRIMARY)
+ crtc_src_param.ucDevice |= ATOM_DEVICE_CRT1_SUPPORT;
+ else
+ crtc_src_param.ucDevice |= ATOM_DEVICE_CRT2_SUPPORT;
+ } else if (radeon_output->MonType == MT_DFP) {
+ if (radeon_output->TMDSType == TMDS_INT)
+ crtc_src_param.ucDevice |= ATOM_DEVICE_DFP1_SUPPORT;
+ else
+ crtc_src_param.ucDevice |= ATOM_DEVICE_DFP2_SUPPORT;
+ } else if (radeon_output->MonType == MT_LCD)
+ crtc_src_param.ucDevice |= ATOM_DEVICE_LCD1_SUPPORT;
+ else if (radeon_output->MonType == MT_STV || radeon_output->MonType == MT_CTV)
+ crtc_src_param.ucDevice |= ATOM_DEVICE_TV1_SUPPORT;
+ else if (radeon_output->MonType == MT_CV)
+ crtc_src_param.ucDevice |= ATOM_DEVICE_CV_SUPPORT;
+ 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_crtc_mode_set(xf86CrtcPtr crtc,
@@ -420,8 +488,7 @@ atombios_crtc_mode_set(xf86CrtcPtr crtc,
}
- // moved to output
- //atombios_set_crtc_source(crtc);
+ atombios_set_crtc_source(crtc);
atombios_set_crtc_timing(info->atomBIOS, &crtc_timing);