This diff makes the xf86-video-r128 driver properly restore the
graphics mode when leaving X.  The problem is that the driver properly
restores all the clocks, but doesn't properly restore the register
that selects which of the clocks is actually used.  This happens
because a block of "general" registers is restored before the video
mode is restored.  It makes much more sense to restore these registers
*after* the video mode has been restored, which is what this diff does.

Could use some testing on i386/amd64 systems with ATI Rage 128 cards.

To test, apply this diff to a checked out xenocara tree and do:

# cd /usr/xenocara/driver/xf86-video-r128
# make obj && make build


Index: src/r128_driver.c
===================================================================
RCS file: /cvs/xenocara/driver/xf86-video-r128/src/r128_driver.c,v
retrieving revision 1.5
diff -u -p -r1.5 r128_driver.c
--- src/r128_driver.c   22 Nov 2009 17:11:20 -0000      1.5
+++ src/r128_driver.c   20 Feb 2011 18:33:19 -0000
@@ -3308,6 +3308,8 @@ static void R128Restore(ScrnInfoPtr pScr
 
     R128Blank(pScrn);
 
+    R128RestoreMode(pScrn, restore);
+
     if (!info->IsSecondary) {
         OUTREG(R128_AMCGPIO_MASK,     restore->amcgpio_mask);
         OUTREG(R128_AMCGPIO_EN_REG,   restore->amcgpio_en_reg);
@@ -3316,7 +3318,6 @@ static void R128Restore(ScrnInfoPtr pScr
         OUTREG(R128_DP_DATATYPE,      restore->dp_datatype);
     }
 
-    R128RestoreMode(pScrn, restore);
 #ifdef WITH_VGAHW
     if (info->VGAAccess) {
         vgaHWPtr hwp = VGAHWPTR(pScrn);

Reply via email to