xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Fri Nov 1 02:34:17 CET 2013


 hw/xfree86/common/xf86DPMS.c |    9 ++++++++-
 hw/xfree86/modes/xf86Crtc.c  |   20 ++++++++++++++++----
 2 files changed, 24 insertions(+), 5 deletions(-)

New commits:
commit 0cb33ce34081d7d123ec565582d7d19bdb3964ad
Author: Egbert Eich <eich at freedesktop.org>
Date:   Sat Oct 5 08:02:28 2013 +0200

    DDX/modes: Add a sanity check when using screen sizes from EDID
    
    EDID sometimes lies about screen sizes. Since the screen size is used
    by clients to determine the DPI a wrong ration will lead to terrible
    looking fonts.
    Add a sanity check for the h/v ratio cutting off at 2.4. This would
    still accept the cinemascope aspect ratio as valid.
    Also add message suggesting to add a quirk table entry.
    
    Signed-off-by: Egbert Eich <eich at freedesktop.org>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 35845e8..2a02c85 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -3045,10 +3045,22 @@ handle_detailed_physical_size(struct detailed_monitor_section
     if (det_mon->type == DT &&
         det_mon->section.d_timings.h_size != 0 &&
         det_mon->section.d_timings.v_size != 0) {
-
-        p->output->mm_width = det_mon->section.d_timings.h_size;
-        p->output->mm_height = det_mon->section.d_timings.v_size;
-        p->ret = TRUE;
+        /* some sanity checking for aspect ratio:
+           assume any h / v (or v / h) > 2.4 to be bogus.
+           This would even include cinemascope */
+        if (((det_mon->section.d_timings.h_size * 5) <
+             (det_mon->section.d_timings.v_size * 12)) &&
+            ((det_mon->section.d_timings.v_size * 5) <
+             (det_mon->section.d_timings.h_size * 12))) {
+            p->output->mm_width = det_mon->section.d_timings.h_size;
+            p->output->mm_height = det_mon->section.d_timings.v_size;
+            p->ret = TRUE;
+        } else
+            xf86DrvMsg(p->output->scrn->scrnIndex, X_WARNING,
+                       "Output %s: Strange aspect ratio (%i/%i), "
+                       "consider adding a quirk\n", p->output->name,
+                       det_mon->section.d_timings.h_size,
+                       det_mon->section.d_timings.v_size);
     }
 }
 
commit 41d4beb2616ceb3f1a1b8694733e85bae70de59a
Author: Egbert Eich <eich at freedesktop.org>
Date:   Wed Aug 14 11:50:26 2013 +0200

    DDX/DPMS: Call dixSaveScreens() also when screen is turned on
    
    DMPS calls dixSaveScreens() when turned off but not when turned
    on. In most cases this is irrelevant as DPMS is done when a
    key is hit in which case dixSaveScreens() will be called to
    unblank anyhow. This isn't the case if we use xset (or the
    DPMS extension directly) to unblank.
    Check screenIsSaved to make sure the state needs to be changed
    before calling dixSaveScreens().
    
    Signed-off-by: Egbert Eich <eich at freedesktop.org>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
index 3f1e142..881cb27 100644
--- a/hw/xfree86/common/xf86DPMS.c
+++ b/hw/xfree86/common/xf86DPMS.c
@@ -36,6 +36,7 @@
 #include <X11/X.h>
 #include "os.h"
 #include "globals.h"
+#include "windowstr.h"
 #include "xf86.h"
 #include "xf86Priv.h"
 #ifdef DPMSExtension
@@ -159,7 +160,13 @@ DPMSSet(ClientPtr client, int level)
         return Success;
 
     if (level != DPMSModeOn) {
-        rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverActive);
+        if (xf86IsUnblank(screenIsSaved)) {
+            rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverActive);
+            if (rc != Success)
+                return rc;
+        }
+    } else if (!xf86IsUnblank(screenIsSaved)) {
+        rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, ScreenSaverReset);
         if (rc != Success)
             return rc;
     }


More information about the xorg-commit mailing list