xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 17 16:26:27 UTC 2023


 hw/xwayland/xwayland-cvt.c |   34 +++++++++++-----------------------
 1 file changed, 11 insertions(+), 23 deletions(-)

New commits:
commit 814a04927d54586ea478ba6ac14eb4fca5667239
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon May 15 09:23:57 2023 +0200

    xwayland: Keep the CVT timings for non-standard modes
    
    The current code, as changed by commit ad2d461de „Do not round
    non-standard modes“ is reported to be logically incongruent.
    
    We should either drop libxcvt entirely or simply fix the size, keeping
    the CVT timings unchanged.
    
    For backward compatibility and simplicity, I'd rather simply fix the
    hdisplay/vdisplay to match the given size.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Fixes: ad2d461de - xwayland: Do not round non-standard modes
    Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1549

diff --git a/hw/xwayland/xwayland-cvt.c b/hw/xwayland/xwayland-cvt.c
index d052471eb..4248d3869 100644
--- a/hw/xwayland/xwayland-cvt.c
+++ b/hw/xwayland/xwayland-cvt.c
@@ -53,17 +53,6 @@ xwayland_modeinfo_from_cvt(xRRModeInfo *modeinfo,
     free(libxcvt_mode_info);
 }
 
-static void
-xwayland_modeinfo_from_values(xRRModeInfo *modeinfo,
-                              int hdisplay, int vdisplay, float vrefresh)
-{
-    modeinfo->width  = hdisplay;
-    modeinfo->height = vdisplay;
-    modeinfo->hTotal = hdisplay;
-    modeinfo->vTotal = vdisplay;
-    modeinfo->dotClock = hdisplay * vdisplay * vrefresh;
-}
-
 RRModePtr
 xwayland_cvt(int hdisplay, int vdisplay, float vrefresh, Bool reduced,
              Bool interlaced)
@@ -75,14 +64,13 @@ xwayland_cvt(int hdisplay, int vdisplay, float vrefresh, Bool reduced,
                                hdisplay, vdisplay, vrefresh, reduced, interlaced);
 
     /* Horizontal granularity in libxcvt is 8, so if our horizontal size is not
-     * divisible by 8, libxcvt will round it down, and we will advertise a wrong
-     * size to our XRandR clients. Fallback to a simpler method in that case.
+     * divisible by 8, libxcvt will round it up, and we will advertise a wrong
+     * size to our XRandR clients.
+     * Force the width/height (i.e. simply increase blanking which should not
+     * hurt anything), keeping the rest of the CVT mode timings unchanged.
      */
-    if (modeinfo.width != hdisplay || modeinfo.height != vdisplay) {
-        memset(&modeinfo, 0, sizeof(xRRModeInfo));
-        xwayland_modeinfo_from_values(&modeinfo,
-                                      hdisplay, vdisplay, vrefresh);
-    }
+    modeinfo.width = hdisplay;
+    modeinfo.height = vdisplay;
 
     snprintf(name, sizeof name, "%dx%d",
              modeinfo.width, modeinfo.height);
commit 2713383548cc1abf4f578f8d2623da91c52dde84
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon May 15 09:56:15 2023 +0200

    xwayland: Fix spelling of modeinfo in function name
    
    Commit ad2d461de „xwayland: Do not round non-standard mode“ introduced a
    spelling error in the names of the local functions.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Fixes: ad2d461de - xwayland: Do not round non-standard modes

diff --git a/hw/xwayland/xwayland-cvt.c b/hw/xwayland/xwayland-cvt.c
index 0fc4ae82a..d052471eb 100644
--- a/hw/xwayland/xwayland-cvt.c
+++ b/hw/xwayland/xwayland-cvt.c
@@ -30,9 +30,9 @@
 #include "xwayland-cvt.h"
 
 static void
-xwayland_modinfo_from_cvt(xRRModeInfo *modeinfo,
-                          int hdisplay, int vdisplay, float vrefresh,
-                          Bool reduced, Bool interlaced)
+xwayland_modeinfo_from_cvt(xRRModeInfo *modeinfo,
+                           int hdisplay, int vdisplay, float vrefresh,
+                           Bool reduced, Bool interlaced)
 {
     struct libxcvt_mode_info *libxcvt_mode_info;
 
@@ -54,8 +54,8 @@ xwayland_modinfo_from_cvt(xRRModeInfo *modeinfo,
 }
 
 static void
-xwayland_modinfo_from_values(xRRModeInfo *modeinfo,
-                             int hdisplay, int vdisplay, float vrefresh)
+xwayland_modeinfo_from_values(xRRModeInfo *modeinfo,
+                              int hdisplay, int vdisplay, float vrefresh)
 {
     modeinfo->width  = hdisplay;
     modeinfo->height = vdisplay;
@@ -71,8 +71,8 @@ xwayland_cvt(int hdisplay, int vdisplay, float vrefresh, Bool reduced,
     char name[128];
     xRRModeInfo modeinfo = { 0, };
 
-    xwayland_modinfo_from_cvt(&modeinfo,
-                              hdisplay, vdisplay, vrefresh, reduced, interlaced);
+    xwayland_modeinfo_from_cvt(&modeinfo,
+                               hdisplay, vdisplay, vrefresh, reduced, interlaced);
 
     /* Horizontal granularity in libxcvt is 8, so if our horizontal size is not
      * divisible by 8, libxcvt will round it down, and we will advertise a wrong
@@ -80,8 +80,8 @@ xwayland_cvt(int hdisplay, int vdisplay, float vrefresh, Bool reduced,
      */
     if (modeinfo.width != hdisplay || modeinfo.height != vdisplay) {
         memset(&modeinfo, 0, sizeof(xRRModeInfo));
-        xwayland_modinfo_from_values(&modeinfo,
-                                     hdisplay, vdisplay, vrefresh);
+        xwayland_modeinfo_from_values(&modeinfo,
+                                      hdisplay, vdisplay, vrefresh);
     }
 
     snprintf(name, sizeof name, "%dx%d",


More information about the xorg-commit mailing list