summaryrefslogtreecommitdiff
path: root/src/atombios_output.c
diff options
context:
space:
mode:
authorAlex Deucher <alex@botch2.(none)>2007-11-07 01:22:30 -0500
committerAlex Deucher <alex@botch2.(none)>2007-11-07 01:22:30 -0500
commit96273016a0bbdfa4d3a4e6275a3b09eeeadaa534 (patch)
tree949dd1104d0c93b050eb903aa9a52762742f56fa /src/atombios_output.c
parent5c495c81cc3bcd4a38d06954243ed3bdc85bdc07 (diff)
fix and move crtc source set up atombios_output.c
it's really more output related.
Diffstat (limited to 'src/atombios_output.c')
-rw-r--r--src/atombios_output.c81
1 files changed, 70 insertions, 11 deletions
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