---
 src/smi_501.c |   12 	9 +	3 -	0 !
 1 file changed, 9 insertions(+), 3 deletions(-)

Index: xf86-video-siliconmotion-1.7.0/src/smi_501.c
===================================================================
--- xf86-video-siliconmotion-1.7.0.orig/src/smi_501.c	2009-10-30 07:58:06.000000000 -0400
+++ xf86-video-siliconmotion-1.7.0/src/smi_501.c	2009-10-30 08:00:09.000000000 -0400
@@ -232,12 +232,20 @@ void
 SMI501_WriteMode_common(ScrnInfoPtr pScrn, MSOCRegPtr mode)
 {
     int32_t		pll;
+    int32_t		cur_mode;
+    int32_t		gate, cur_gate;
     MSOCClockRec	clock;
     SMIPtr		pSmi = SMIPTR(pScrn);
 
     if (!pSmi->UseFBDev) {
 	/* Update gate first */
-	WRITE_SCR(pSmi, mode->current_gate, mode->gate.value);
+	cur_mode = READ_SCR(pSmi, POWER_CTL) & 3;
+	cur_gate = POWER0_GATE;
+	if (cur_mode == 1)
+		cur_gate = POWER1_GATE;
+	gate = READ_SCR(pSmi, cur_gate);
+	gate |= mode->gate.value;
+	WRITE_SCR(pSmi, cur_gate, gate);
 
 	clock.value = READ_SCR(pSmi, mode->current_clock);
 
@@ -258,8 +266,6 @@ SMI501_WriteMode_common(ScrnInfoPtr pScr
 	}
 
 	WRITE_SCR(pSmi, MISC_CTL, mode->misc_ctl.value);
-
-	WRITE_SCR(pSmi, POWER_CTL, mode->power_ctl.value);
     }
 
     /* Match configuration */
