diff options
-rw-r--r-- | src/atombios_output.c | 57 | ||||
-rw-r--r-- | src/radeon_driver.c | 37 | ||||
-rw-r--r-- | src/radeon_probe.h | 2 | ||||
-rw-r--r-- | src/radeon_reg.h | 4 |
4 files changed, 79 insertions, 21 deletions
diff --git a/src/atombios_output.c b/src/atombios_output.c index 07d212f7..3b49cde5 100644 --- a/src/atombios_output.c +++ b/src/atombios_output.c @@ -382,6 +382,33 @@ atombios_output_scaler_setup(xf86OutputPtr output, DisplayModePtr mode) } +static void +dfp_disable_dither(xf86OutputPtr output, int device) +{ + RADEONOutputPrivatePtr radeon_output = output->driver_private; + RADEONInfoPtr info = RADEONPTR(output->scrn); + unsigned char *RADEONMMIO = info->MMIO; + + switch (device) { + case ATOM_DEVICE_DFP1_SUPPORT: + OUTREG(AVIVO_TMDSA_BIT_DEPTH_CONTROL, 0); /* TMDSA */ + break; + case ATOM_DEVICE_DFP2_SUPPORT: + if (info->IsIGP) + OUTREG(AVIVO_DDIA_BIT_DEPTH_CONTROL, 0); /* DDIA */ + else + OUTREG(AVIVO_DVOA_BIT_DEPTH_CONTROL, 0); /* DVO */ + break; + case ATOM_DEVICE_LCD1_SUPPORT: + case ATOM_DEVICE_DFP3_SUPPORT: + OUTREG(AVIVO_LVTMA_BIT_DEPTH_CONTROL, 0); /* LVTMA */ + break; + default: + break; + } + +} + static AtomBiosResult atombios_display_device_control(atomBiosHandlePtr atomBIOS, int device, Bool state) { @@ -579,19 +606,27 @@ atombios_output_mode_set(xf86OutputPtr output, atombios_output_dac2_setup(output, adjusted_mode); } } else if (radeon_output->MonType == MT_DFP) { - if (radeon_output->devices & ATOM_DEVICE_DFP1_SUPPORT) - atombios_output_tmds1_setup(output, adjusted_mode); - else if (radeon_output->devices & ATOM_DEVICE_DFP2_SUPPORT) { - if (info->IsIGP) - atombios_ddia_setup(output, adjusted_mode); - else - atombios_external_tmds_setup(output, adjusted_mode); - } else if (radeon_output->devices & ATOM_DEVICE_DFP3_SUPPORT) - atombios_output_tmds2_setup(output, adjusted_mode); + if (radeon_output->devices & ATOM_DEVICE_DFP1_SUPPORT) { + atombios_output_tmds1_setup(output, adjusted_mode); + dfp_disable_dither(output, ATOM_DEVICE_DFP1_SUPPORT); + } else if (radeon_output->devices & ATOM_DEVICE_DFP2_SUPPORT) { + if (info->IsIGP) + atombios_ddia_setup(output, adjusted_mode); + else + atombios_external_tmds_setup(output, adjusted_mode); + dfp_disable_dither(output, ATOM_DEVICE_DFP2_SUPPORT); + } else if (radeon_output->devices & ATOM_DEVICE_DFP3_SUPPORT) { + atombios_output_tmds2_setup(output, adjusted_mode); + dfp_disable_dither(output, ATOM_DEVICE_DFP3_SUPPORT); + } } else if (radeon_output->MonType == MT_LCD) { - if (radeon_output->devices & ATOM_DEVICE_LCD1_SUPPORT) + if (radeon_output->devices & ATOM_DEVICE_LCD1_SUPPORT) { atombios_output_lvds_setup(output, adjusted_mode); - } else if (OUTPUT_IS_TV || (radeon_output->MonType == MT_CV)) { + dfp_disable_dither(output, ATOM_DEVICE_LCD1_SUPPORT); + } + } else if ((radeon_output->MonType == MT_CTV) || + (radeon_output->MonType == MT_STV) || + (radeon_output->MonType == MT_CV)) { if (radeon_output->DACType == DAC_PRIMARY) atombios_output_dac1_setup(output, adjusted_mode); else if (radeon_output->DACType == DAC_TVDAC) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 5cf8d511..e9c24af7 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -4177,20 +4177,29 @@ avivo_save(ScrnInfoPtr pScrn, RADEONSavePtr save) state->tmds2.data_sync = INREG(AVIVO_LVTMA_DATA_SYNCHRONIZATION); if (info->ChipFamily >= CHIP_FAMILY_R600) { - state->tmds2.transmitter_enable = INREG(R600_LVTMA_TRANSMITTER_ENABLE); - state->tmds2.transmitter_cntl = INREG(R600_LVTMA_TRANSMITTER_CONTROL); - state->lvtma_pwrseq_cntl = INREG(R600_LVTMA_PWRSEQ_CNTL); - state->lvtma_pwrseq_state = INREG(R600_LVTMA_PWRSEQ_STATE); + state->tmds2.transmitter_enable = INREG(R600_LVTMA_TRANSMITTER_ENABLE); + state->tmds2.transmitter_cntl = INREG(R600_LVTMA_TRANSMITTER_CONTROL); + state->lvtma_pwrseq_cntl = INREG(R600_LVTMA_PWRSEQ_CNTL); + state->lvtma_pwrseq_state = INREG(R600_LVTMA_PWRSEQ_STATE); } else { - state->tmds2.transmitter_enable = INREG(R500_LVTMA_TRANSMITTER_ENABLE); - state->tmds2.transmitter_cntl = INREG(R500_LVTMA_TRANSMITTER_CONTROL); - state->lvtma_pwrseq_cntl = INREG(R500_LVTMA_PWRSEQ_CNTL); - state->lvtma_pwrseq_state = INREG(R500_LVTMA_PWRSEQ_STATE); + state->tmds2.transmitter_enable = INREG(R500_LVTMA_TRANSMITTER_ENABLE); + state->tmds2.transmitter_cntl = INREG(R500_LVTMA_TRANSMITTER_CONTROL); + state->lvtma_pwrseq_cntl = INREG(R500_LVTMA_PWRSEQ_CNTL); + state->lvtma_pwrseq_state = INREG(R500_LVTMA_PWRSEQ_STATE); + } + + if (info->IsIGP) { + int i, j = 0; + /* save DDIA regs */ + for (i = 0x7200; i <= 0x7290; i += 4) { + state->ddia[j] = INREG(i); + j++; + } } if (state->crtc1.control & AVIVO_CRTC_EN) info->crtc_on = TRUE; - + if (state->crtc2.control & AVIVO_CRTC_EN) info->crtc2_on = TRUE; @@ -4343,12 +4352,20 @@ avivo_restore(ScrnInfoPtr pScrn, RADEONSavePtr restore) OUTREG(R500_LVTMA_PWRSEQ_STATE, state->lvtma_pwrseq_state); } + if (info->IsIGP) { + int i, j = 0; + for (i = 0x7200; i <= 0x7290; i =+ 4) { + OUTREG(i, state->ddia[j]); + j++; + } + } + OUTREG(AVIVO_D1VGA_CONTROL, state->vga1_cntl); OUTREG(AVIVO_D2VGA_CONTROL, state->vga2_cntl); } void avivo_restore_vga_regs(ScrnInfoPtr pScrn, RADEONSavePtr restore) -{ +{ RADEONInfoPtr info = RADEONPTR(pScrn); unsigned char *RADEONMMIO = info->MMIO; struct avivo_state *state = &restore->avivo; diff --git a/src/radeon_probe.h b/src/radeon_probe.h index 9c1bdc54..d11f3d9e 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -361,6 +361,8 @@ struct avivo_state struct avivo_dig_state tmds1; struct avivo_dig_state tmds2; + /* DDIA block on RS6xx chips */ + CARD32 ddia[36]; }; /* diff --git a/src/radeon_reg.h b/src/radeon_reg.h index 7d9bad39..94d5f312 100644 --- a/src/radeon_reg.h +++ b/src/radeon_reg.h @@ -3555,6 +3555,8 @@ #define AVIVO_D2SCL_SCALER_ENABLE 0x6d90 #define AVIVO_D2SCL_SCALER_TAP_CONTROL 0x6d94 +#define AVIVO_DDIA_BIT_DEPTH_CONTROL 0x7214 + #define AVIVO_DACA_ENABLE 0x7800 # define AVIVO_DAC_ENABLE (1 << 0) #define AVIVO_DACA_SOURCE_SELECT 0x7804 @@ -3745,6 +3747,8 @@ # define AVIVO_LVDS_BACKLIGHT_LEVEL_MASK 0x0000ff00 # define AVIVO_LVDS_BACKLIGHT_LEVEL_SHIFT 8 +#define AVIVO_DVOA_BIT_DEPTH_CONTROL 0x7988 + #define AVIVO_GPIO_0 0x7e30 #define AVIVO_GPIO_1 0x7e40 #define AVIVO_GPIO_2 0x7e50 |