Hi Hugang,
On Sun, Dec 28, 2003 at 02:00:13PM +0800, Hugang wrote:
> I'm use PowerBook G4 with linux, Now I upgrade Xserver to 4.3.99.902.
> Yes, from now NV driver can turn lcd light off, But here has a problem, 
> When light turn on again, The light level is change, So I writen this patch, Test 
> passed.
You're right, the problem here is that I missed to restore a bit
properly on unblank.  Attached patch fixes this. Please apply since this
fixes a bug in the release candidate.

Index: programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c
===================================================================
RCS file: /cvs/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v
retrieving revision 1.122
diff -u -p -r1.122 nv_driver.c
--- programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c  10 Jan 2004 22:31:53 -0000     
 1.122
+++ programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c  13 Jan 2004 13:42:15 -0000
@@ -1512,13 +1514,15 @@ static void NVBacklightEnable(NVPtr pNv,
        (pNv->Chipset == 0x10DE0329))
     {
        /* NV17,18,34 Apple iMac, iBook, PowerBook */
-       CARD32 tmp;
-       tmp = pNv->PMC[0x10F0/4] & 0x7FFFFFFF;
-       pNv->PMC[0x10F0/4] = tmp;
-       tmp = pNv->PCRTC0[0x081C/4] & 0xFFFFFFFC;
-       if(on)
-           tmp |= 0x1;
-       pNv->PCRTC0[0x081C/4] = tmp;
+       CARD32 tmp_pmc, tmp_pcrt;
+       tmp_pmc = pNv->PMC[0x10F0/4] & 0x7FFFFFFF;
+       tmp_pcrt = pNv->PCRTC0[0x081C/4] & 0xFFFFFFFC;
+       if(on) {
+           tmp_pmc |= (1 << 31);
+           tmp_pcrt |= 0x1;
+       }
+       pNv->PMC[0x10F0/4] = tmp_pmc;
+       pNv->PCRTC0[0x081C/4] = tmp_pcrt;
     }
 #endif
 }

Cheers,
 -- Guido

Attachment: signature.asc
Description: Digital signature

Reply via email to