mirror of
https://github.com/X11Libre/xf86-video-r128.git
synced 2026-03-24 01:24:26 +00:00
Move display enabling code to DPMS
This ensures that DAC, TMDS and LVDS enable bits are properly saved and only set in the dpms hook. Signed-off-by: Connor Behan <connor.behan@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -3083,9 +3083,7 @@ Bool R128InitCrtcRegisters(ScrnInfoPtr pScrn, R128SavePtr save,
|
||||
R128_CRTC_INTERLACE_EN);
|
||||
}
|
||||
|
||||
save->crtc_ext_cntl = R128_VGA_ATI_LINEAR |
|
||||
R128_XCRT_CNT_EN |
|
||||
R128_CRTC_CRT_ON;
|
||||
save->crtc_ext_cntl |= R128_VGA_ATI_LINEAR | R128_XCRT_CNT_EN;
|
||||
|
||||
if(info->isDFP && !info->isPro2)
|
||||
{
|
||||
@@ -3332,9 +3330,7 @@ void R128InitFPRegisters(R128SavePtr orig, R128SavePtr save, xf86OutputPtr outpu
|
||||
R128_FP_CRT_SYNC_SEL |
|
||||
R128_FP_USE_SHADOW_EN);
|
||||
|
||||
save->fp_gen_cntl |= (R128_FP_FPON |
|
||||
R128_FP_TDMS_EN |
|
||||
R128_FP_CRTC_DONT_SHADOW_VPAR |
|
||||
save->fp_gen_cntl |= (R128_FP_CRTC_DONT_SHADOW_VPAR |
|
||||
R128_FP_CRTC_DONT_SHADOW_HEND);
|
||||
|
||||
save->fp_panel_cntl |= (R128_FP_DIGON | R128_FP_BLON);
|
||||
@@ -3354,8 +3350,6 @@ void R128InitLVDSRegisters(R128SavePtr orig, R128SavePtr save, xf86OutputPtr out
|
||||
save->lvds_gen_cntl |= R128_LVDS_SEL_CRTC2;
|
||||
else
|
||||
save->lvds_gen_cntl &= ~R128_LVDS_SEL_CRTC2;
|
||||
|
||||
save->lvds_gen_cntl |= (R128_LVDS_ON | R128_LVDS_BLON);
|
||||
}
|
||||
|
||||
/* Define PLL registers for requested video mode. */
|
||||
|
||||
@@ -176,15 +176,22 @@ void R128DPMSSetOn(xf86OutputPtr output)
|
||||
unsigned char *R128MMIO = info->MMIO;
|
||||
R128OutputPrivatePtr r128_output = output->driver_private;
|
||||
R128MonitorType MonType = r128_output->MonType;
|
||||
R128SavePtr save = &info->ModeReg;
|
||||
|
||||
switch(MonType) {
|
||||
case MT_LCD:
|
||||
OUTREGP(R128_LVDS_GEN_CNTL, R128_LVDS_BLON, ~R128_LVDS_BLON);
|
||||
usleep(info->PanelPwrDly * 1000);
|
||||
OUTREGP(R128_LVDS_GEN_CNTL, R128_LVDS_ON, ~R128_LVDS_ON);
|
||||
save->lvds_gen_cntl |= (R128_LVDS_ON | R128_LVDS_BLON);
|
||||
break;
|
||||
case MT_DFP:
|
||||
OUTREGP(R128_FP_GEN_CNTL, (R128_FP_FPON | R128_FP_TDMS_EN), ~(R128_FP_FPON | R128_FP_TDMS_EN));
|
||||
OUTREGP(R128_FP_GEN_CNTL, (R128_FP_FPON | R128_FP_TDMS_EN), ~(R128_FP_FPON | R128_FP_TDMS_EN));
|
||||
save->fp_gen_cntl |= (R128_FP_FPON | R128_FP_TDMS_EN);
|
||||
break;
|
||||
case MT_CRT:
|
||||
OUTREGP(R128_CRTC_EXT_CNTL, R128_CRTC_CRT_ON, ~R128_CRTC_CRT_ON);
|
||||
save->crtc_ext_cntl |= R128_CRTC_CRT_ON;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -198,13 +205,20 @@ void R128DPMSSetOff(xf86OutputPtr output)
|
||||
unsigned char *R128MMIO = info->MMIO;
|
||||
R128OutputPrivatePtr r128_output = output->driver_private;
|
||||
R128MonitorType MonType = r128_output->MonType;
|
||||
R128SavePtr save = &info->ModeReg;
|
||||
|
||||
switch(MonType) {
|
||||
case MT_LCD:
|
||||
OUTREGP(R128_LVDS_GEN_CNTL, 0, ~(R128_LVDS_BLON | R128_LVDS_ON));
|
||||
save->lvds_gen_cntl &= ~(R128_LVDS_BLON | R128_LVDS_ON);
|
||||
break;
|
||||
case MT_DFP:
|
||||
OUTREGP(R128_FP_GEN_CNTL, 0, ~(R128_FP_FPON | R128_FP_TDMS_EN));
|
||||
OUTREGP(R128_FP_GEN_CNTL, 0, ~(R128_FP_FPON | R128_FP_TDMS_EN));
|
||||
save->fp_gen_cntl &= ~(R128_FP_FPON | R128_FP_TDMS_EN);
|
||||
break;
|
||||
case MT_CRT:
|
||||
OUTREGP(R128_CRTC_EXT_CNTL, 0, ~(R128_CRTC_CRT_ON));
|
||||
save->crtc_ext_cntl &= ~(R128_CRTC_CRT_ON);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user