On Sun, 23 Feb 2003, Mike A. Harris wrote:

[I hate to respond to my own email, but...]

>>> I'll probably send my DPMS patch in for potential 4.3.0
>>> inclusion, but if it doesn't get in, then it's on my ftpsite for
>>> those interested.
>>
>>Sweet.  Looking forward to it.
>
>The patch works great for several people with a variety of 
>different display combinations, however I've had a bug report now 
>from someone using just a CRT where DPMS causes the monitor to go 
>into and out of suspend over and over.  That sucks because the 
>changes I added didn't touch the CRT path.  I've decided in the 
>interest of not causing regression to disable my patch until I 
>can investigate things more closely, so I am not going to submit 
>it for 4.3.0 inclusion at this stage.
>
>Perhaps it can be included in the 4.3 stable branch post 4.3.0 
>once I've had time to work the kinks out though.

The bug report that I had received has turned out to not be due
to my patch, but has aparently been a DPMS issue for this person
for a year or more on CRT.  From the sounds of the problem, it
could be a mechanical defect in the monitor perhaps (IMHO).  In
the mean time I've gotten back several more success stories from
people as well.

I've hence decided I'm going to submit the patch for 4.3.0 
consideration afterall, as it shouldn't in any way affect the 
CRT codepath.  I've attached it to this email.  

While the patch is small and rather obvious IMHO, it is new
functionality, so it may or may not make it into the 4.3.0
release.  I'll leave it up to Kevin and David's judgement wether 
it is safe for 4.3.0 or not.

-- 
Mike A. Harris


Patch by Mike A. Harris <[EMAIL PROTECTED]>

The following patch adds DPMS support to the radeon driver for flat panel
displays (DFP) and LCD panels.  It does not affect the CRT codepath, and
has been tested on singlehead CRT systems, dualhead CRT, CRT + DFP, and
dual DFP cards Dell ships.  I've tested it single and dualhead with CRTs
on Radeon 7000/7500/8500/9000/9700 for regressions and had no problems
so far.  Tested with suspend/standby/off signals using "xset dpms force".


--- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c.ati-radeon-dpms-on-dvi  
 2003-02-21 15:54:52.000000000 -0500
+++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c  2003-02-21 
16:54:50.000000000 -0500
@@ -5864,17 +5864,31 @@
 
     if (info->accelOn) info->accel->Sync(pScrn);
 
+    /* The entire DPMS code is overly complicated and should be rewritten
+     * to use DISP_PWR_MAN_DPMS instead of manually twiddling the CRTCs.
+     * This should IMHO enable DPMS to work properly on all hardware instead
+     * of a bunch of special casing.  - Mike A. Harris <[EMAIL PROTECTED]>
+     */
     if (info->FBDev) {
        fbdevHWDPMSSet(pScrn, PowerManagementMode, flags);
+    } else if (info->DisplayType == MT_DFP || info->DisplayType == MT_LCD) {
+       switch (PowerManagementMode) {
+       case DPMSModeOn:
+           OUTREG(RADEON_FP_GEN_CNTL,
+                  INREG(RADEON_FP_GEN_CNTL) | (RADEON_FP_TMDS_EN | RADEON_FP_FPON));
+           break;
+       case DPMSModeStandby:
+       case DPMSModeSuspend:
+       case DPMSModeOff:
+           OUTREG(RADEON_FP_GEN_CNTL,
+                  INREG(RADEON_FP_GEN_CNTL) & ~(RADEON_FP_TMDS_EN | RADEON_FP_FPON));
+           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);
-
-       /* TODO: additional handling for LCD ? */
+       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);
 
        switch (PowerManagementMode) {
        case DPMSModeOn:

Reply via email to