summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/r128_reg.h4
-rw-r--r--src/radeon_driver.c13
-rw-r--r--src/radeon_macros.h4
3 files changed, 11 insertions, 10 deletions
diff --git a/src/r128_reg.h b/src/r128_reg.h
index 31883e3d..721a72c7 100644
--- a/src/r128_reg.h
+++ b/src/r128_reg.h
@@ -68,7 +68,7 @@
do { \
CARD32 tmp = INREG(addr); \
tmp &= (mask); \
- tmp |= (val); \
+ tmp |= ((val) & ~(mask)); \
OUTREG(addr, tmp); \
} while (0)
@@ -84,7 +84,7 @@
do { \
CARD32 tmp = INPLL(pScrn, addr); \
tmp &= (mask); \
- tmp |= (val); \
+ tmp |= ((val) & ~(mask)); \
OUTPLL(addr, tmp); \
} while (0)
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index e0a488e9..3e4564ef 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -8209,6 +8209,7 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
}
if (pScrn->vtSema) {
+ RADEONDisplayPowerManagementSet(pScrn, DPMSModeOn, 0);
RADEONRestore(pScrn);
}
RADEONUnmapMem(pScrn);
@@ -8392,15 +8393,15 @@ static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn,
/* Screen: Off; HSync: Off, VSync: On */
if (info->IsSecondary)
OUTREGP(RADEON_CRTC2_GEN_CNTL,
- RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS,
+ (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS),
~mask2);
else {
if (info->MergedFB)
OUTREGP(RADEON_CRTC2_GEN_CNTL,
- RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS,
+ (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS),
~mask2);
OUTREGP(RADEON_CRTC_EXT_CNTL,
- RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS,
+ (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS),
~mask1);
}
break;
@@ -8409,15 +8410,15 @@ static void RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn,
/* Screen: Off; HSync: On, VSync: Off */
if (info->IsSecondary)
OUTREGP(RADEON_CRTC2_GEN_CNTL,
- RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS,
+ (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS),
~mask2);
else {
if (info->MergedFB)
OUTREGP(RADEON_CRTC2_GEN_CNTL,
- RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS,
+ (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS),
~mask2);
OUTREGP(RADEON_CRTC_EXT_CNTL,
- RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS,
+ (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS),
~mask1);
}
break;
diff --git a/src/radeon_macros.h b/src/radeon_macros.h
index 5b173cc0..b121a95b 100644
--- a/src/radeon_macros.h
+++ b/src/radeon_macros.h
@@ -78,7 +78,7 @@
do { \
CARD32 tmp = INREG(addr); \
tmp &= (mask); \
- tmp |= (val); \
+ tmp |= ((val) & ~(mask)); \
OUTREG(addr, tmp); \
} while (0)
@@ -90,7 +90,7 @@ do { \
do { \
CARD32 tmp_ = INPLL(pScrn, addr); \
tmp_ &= (mask); \
- tmp_ |= (val); \
+ tmp_ |= ((val) & ~(mask)); \
OUTPLL(pScrn, addr, tmp_); \
} while (0)