summaryrefslogtreecommitdiff
path: root/src/mga_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mga_driver.c')
-rw-r--r--src/mga_driver.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/mga_driver.c b/src/mga_driver.c
index 1f41fd5..ff161b7 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -2945,8 +2945,8 @@ void MGARestoreSecondCrtc(ScrnInfoPtr pScrn)
*/
CARD8 ucXDispCtrl = inMGAdac(MGA1064_DISP_CTL);
- ucXDispCtrl &= ~0x0c; /* dac2outsel mask */
- ucXDispCtrl |= 0x04; /* dac2 -> crtc1 */
+ ucXDispCtrl &= ~MGA1064_DISP_CTL_DAC2OUTSEL_MASK;
+ ucXDispCtrl |= MGA1064_DISP_CTL_DAC2OUTSEL_CRTC1;
outMGAdac(MGA1064_DISP_CTL, ucXDispCtrl);
@@ -2954,9 +2954,13 @@ void MGARestoreSecondCrtc(ScrnInfoPtr pScrn)
CARD8 ucXDispCtrl = inMGAdac(MGA1064_DISP_CTL);
CARD32 ulC2CTL = INREG(MGAREG_C2CTL);
- ucXDispCtrl &= ~0x0c; /* dac2outsel mask */
- ucXDispCtrl |= 0x5; /* dac1outsel -> crtcdacsel, dac2 -> crtc1 */
- ulC2CTL &= ~0x00100000; /* crtcdacsel -> crtc1 */
+ ucXDispCtrl &= ~MGA1064_DISP_CTL_DAC2OUTSEL_MASK;
+ ucXDispCtrl |= MGA1064_DISP_CTL_DAC1OUTSEL_EN;
+ ucXDispCtrl |= MGA1064_DISP_CTL_DAC2OUTSEL_CRTC1;
+
+ /* crtcdacsel -> crtc1 */
+ ulC2CTL &= ~MGAREG_C2CTL_CRTCDACSEL_CRTC2;
+ ulC2CTL |= MGAREG_C2CTL_CRTCDACSEL_CRTC1;
outMGAdac(MGA1064_DISP_CTL, ucXDispCtrl);
OUTREG(MGAREG_C2CTL, ulC2CTL);
@@ -2966,12 +2970,10 @@ void MGARestoreSecondCrtc(ScrnInfoPtr pScrn)
/* Force to close second crtc */
CARD32 ulC2CTL = INREG(MGAREG_C2CTL);
- ulC2CTL &= ~0x1; /* crtc2 disabled */
+ ulC2CTL &= ~MGAREG_C2CTL_C2_EN;
OUTREG(MGAREG_C2CTL, ulC2CTL);
}
-
- return;
}
/*
@@ -4079,8 +4081,8 @@ MGADisplayPowerManagementSetCrtc2(ScrnInfoPtr pScrn, int PowerManagementMode,
if (PowerManagementMode==DPMSModeOn) {
/* Enable CRTC2 */
- val |= 0x1;
- val &= ~(0x8);
+ val |= MGAREG_C2CTL_C2_EN;
+ val &= ~MGAREG_C2CTL_PIXCLKDIS_DISABLE;
OUTREG(MGAREG_C2CTL, val);
/* Restore normal MAVEN values */
if (pMga->Maven) {
@@ -4108,8 +4110,8 @@ MGADisplayPowerManagementSetCrtc2(ScrnInfoPtr pScrn, int PowerManagementMode,
}
else {
/* Disable CRTC2 video */
- val |= 0x8;
- val &= ~(0x1);
+ val |= MGAREG_C2CTL_PIXCLKDIS_DISABLE;
+ val &= ~MGAREG_C2CTL_C2_EN;
OUTREG(MGAREG_C2CTL, val);
/* Disable MAVEN display */