Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[patch] Blanking laptop screen with Radeon 9000
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
eee
Tux's lil' helper
Tux's lil' helper


Joined: 29 May 2003
Posts: 115
Location: MD

PostPosted: Fri Jun 13, 2003 1:00 pm    Post subject: [patch] Blanking laptop screen with Radeon 9000 Reply with quote

Thanks to http://michaelo.free.fr/contrib/radeon/poweroff.php3, I was finally able to get my radeon 9000 laptop (dell 600m) screen to blank. That means that, using the acpi code located at http://beta.phys.uh.edu/%7Eafritz/d800/gentoo-d800.html, the laptop actually goes into a useful sleep mode when the lid is closed!

To get this to work, I had to go through the (admittedly non-trivial) following steps:

Code:
# ebuild /usr/portage/x11-base/xfree/xfree-4.3.0-r3.ebuild unpack
# cd /var/tmp/portage/xfree-4.3.0-r3/work/xc/programs/Xserver/hw/xfree86/drivers/ati
# patch radeon_driver.c < radeon_backlight.patch
# ebuild /usr/portage/x11-base/xfree/xfree-4.3.0-r3.ebuild compile


I could have continued with the ebuild install & ebuild qmerge (per https://forums.gentoo.org/viewtopic.php?t=5378), but, in the absence of any other system changes, I just needed to replace the already installed radeon_drv.o:

Code:
# cd /usr/X11R6/lib/modules/drivers/
# mv radeon_drv.o radeon_drv.o.orig
# cp /var/tmp/portage/xfree-4.3.0-r3/work/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_drv.o .


After (re)starting X, screen blanking worked as advertised.

The patch, built by grabbing the source from the xfree86 bug system (http://bugs.xfree86.org//cgi-bin/bugzilla/show_bug.cgi?id=26) is as follows:

Code:
--- radeon_driver.c.orig        2003-06-13 06:08:04.000000000 -0400
+++ radeon_driver.c     2003-06-13 06:08:03.000000000 -0400
@@ -6539,31 +6539,17 @@
 
     if (info->accelOn) info->accel->Sync(pScrn);
 
-    /* The entire DPMS code seems overly complicated to me, and perhaps
-     * could be rewritten to use DISP_PWR_MAN_DPMS instead of manually twiddlin
g
-     * the CRTCs. This perhaps would enable DPMS to work properly on more hardw
are
-     * without special casing?  - Mike A. Harris <mharris@redhat.com>
-     */
     if (info->FBDev) {
        fbdevHWDPMSSet(pScrn, PowerManagementMode, flags);
-    } else if (info->DisplayType == MT_DFP) {
-       switch (PowerManagementMode) {
-       case DPMSModeOn:
-           OUTREG(RADEON_FP_GEN_CNTL,
-                  INREG(RADEON_FP_GEN_CNTL) | (RADEON_FP_TMDS_EN | RADEON_FP_FP
ON));
-           break;
-       case DPMSModeStandby:
-       case DPMSModeSuspend:
-       case DPMSModeOff:
-           OUTREG(RADEON_FP_GEN_CNTL,
-                  INREG(RADEON_FP_GEN_CNTL) & ~(RADEON_FP_TMDS_EN | RADEON_FP_F
PON));
-           break;
-       }
     } else {
-       int mask1 = (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS |
-                    RADEON_CRTC_VSYNC_DIS);
-       int mask2 = (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS |
-                    RADEON_CRTC2_HSYNC_DIS);
+       int             mask1     = (RADEON_CRTC_DISPLAY_DIS |
+                                    RADEON_CRTC_HSYNC_DIS |
+                                    RADEON_CRTC_VSYNC_DIS);
+       int             mask2     = (RADEON_CRTC2_DISP_DIS |
+                                    RADEON_CRTC2_VSYNC_DIS |
+                                    RADEON_CRTC2_HSYNC_DIS);
+
+       /* TODO: additional handling for LCD ? */
 
        switch (PowerManagementMode) {
        case DPMSModeOn:
@@ -6573,6 +6559,14 @@
            else {
                if (info->Clone)
                    OUTREGP(RADEON_CRTC2_GEN_CNTL, 0, ~mask2);
+               if (info->DisplayType == MT_LCD) {
+                   usleep(RADEONPTR(pScrn)->PanelPwrDly * 1000);
+                   OUTREGP (RADEON_LVDS_GEN_CNTL, (RADEON_LVDS_ON | RADEON_LVDS
_BLON),
+                            ~(RADEON_LVDS_ON | RADEON_LVDS_BLON));
+               } else if (info->DisplayType == MT_DFP) {
+                   OUTREGP (RADEON_FP_GEN_CNTL, RADEON_FP_FPON | RADEON_FP_TMDS
_EN,
+                            ~(RADEON_FP_FPON | RADEON_FP_TMDS_EN));
+               }
                OUTREGP(RADEON_CRTC_EXT_CNTL, 0, ~mask1);
            }
            break;
@@ -6619,6 +6613,12 @@
                if (info->Clone)
                    OUTREGP(RADEON_CRTC2_GEN_CNTL, mask2, ~mask2);
                OUTREGP(RADEON_CRTC_EXT_CNTL, mask1, ~mask1);
+               if (info->DisplayType == MT_LCD) {
+                   usleep(RADEONPTR(pScrn)->PanelPwrDly * 1000);
+                   OUTREGP (RADEON_LVDS_GEN_CNTL, 0, ~(RADEON_LVDS_ON | RADEON_
LVDS_BLON));
+               } else if (info->DisplayType == MT_DFP) {
+                   OUTREGP (RADEON_FP_GEN_CNTL, 0, ~(RADEON_FP_FPON | RADEON_FP
_TMDS_EN));
+               }
            }
            break;
        }
Back to top
View user's profile Send private message
metalac
Apprentice
Apprentice


Joined: 21 Aug 2002
Posts: 191
Location: Seattle, USA

PostPosted: Sat Jun 14, 2003 12:50 am    Post subject: Reply with quote

go to www.linux-laptop.net and see if anyone over there had that laptop working properly.
_________________
>>>>> Ignorance is bliss <<<<<
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum