xserver: Branch 'server-21.1-branch' - 5 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Dec 4 16:11:15 UTC 2021


 glamor/glamor_program.c               |    4 ++--
 hw/xfree86/common/xf86Helper.c        |   30 ++++++++++++------------------
 hw/xfree86/drivers/modesetting/dri2.c |    3 ++-
 hw/xfree86/modes/xf86Crtc.c           |    6 ++----
 hw/xfree86/modes/xf86RandR12.c        |    6 ------
 include/meson.build                   |    2 ++
 xkb/xkb.c                             |   13 ++++++-------
 7 files changed, 26 insertions(+), 38 deletions(-)

New commits:
commit 7caf29ca6607ddf4c19a81d19c0f4acc6deb8936
Author: Povilas Kanapickas <povilas at radix.lt>
Date:   Sat Nov 13 16:42:36 2021 +0200

    meson: Correctly set DDXOSVERRORF and DDXBEFORERESET on xwin
    
    This worked with autotools, but not meson build system.
    
    Signed-off-by: Povilas Kanapickas <povilas at radix.lt>
    (cherry picked from commit 04c93b98e9e4593aa2e6701bb08f5e27c3544d8a)

diff --git a/include/meson.build b/include/meson.build
index 1fab731c3..3521fa3ef 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -245,6 +245,8 @@ conf_data.set('HAVE_LIBUNWIND', get_option('libunwind'))
 conf_data.set('HAVE_APM', (build_apm or build_acpi) ? '1' : false)
 conf_data.set('HAVE_ACPI', build_acpi ? '1' : false)
 
+conf_data.set('DDXOSVERRORF', build_xwin ? '1' : false)
+conf_data.set('DDXBEFORERESET', build_xwin ? '1' : false)
 enable_debugging = get_option('buildtype') == 'debug'
 conf_data.set('DEBUG', enable_debugging ? '1' : false)
 
commit 101791f80fdefea738421a414177899db7c76e83
Author: Jonathan Gray <jsg at jsg.id.au>
Date:   Fri Dec 3 19:17:18 2021 +1100

    glamor: fix free of uninitialised pointers
    
    Attempting to run fvwm on a x61/965gm with xserver 1.21.1 with the
    modesetting driver on OpenBSD/amd64 would cause the xserver to
    reliably crash.
    
    I tracked this down to the free() calls introduced in
    2906ee5e4a722138cccb3265a615da7705a52589
    (d1ca47e1242b51c79cec7287f52c36c8e494706b in branch).
    
    clang also warns about this:
    glamor_program.c:296:13: warning: variable 'vs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:290:9: warning: variable 'vs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:288:9: warning: variable 'vs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:277:13: warning: variable 'vs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:296:13: warning: variable 'fs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:290:9: warning: variable 'fs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:288:9: warning: variable 'fs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:277:13: warning: variable 'fs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    
    Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>
    Fixes: 2906ee5e4 ("glamor: Fix leak in glamor_build_program()")
    (cherry picked from commit 5ac6319776b13f96a2b336da4b35237618a5b001)

diff --git a/glamor/glamor_program.c b/glamor/glamor_program.c
index c51577fc3..d8ddb4c77 100644
--- a/glamor/glamor_program.c
+++ b/glamor/glamor_program.c
@@ -260,8 +260,8 @@ glamor_build_program(ScreenPtr          screen,
     char                        *fs_vars = NULL;
     char                        *vs_vars = NULL;
 
-    char                        *vs_prog_string;
-    char                        *fs_prog_string;
+    char                        *vs_prog_string = NULL;
+    char                        *fs_prog_string = NULL;
 
     GLint                       fs_prog, vs_prog;
     Bool                        gpu_shader4 = FALSE;
commit 2c6989f81e62bac05a583c39fa09a06172d1ece5
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Dec 2 10:41:03 2021 +1000

    xkb: fix XkbSetMap check for the keytypes count
    
    The previous if/else condition resulted in us always setting the key
    type count to the current number of key types. Split this up correctly.
    
    Regression introduced in de940e06f8733d87bbb857aef85d830053442cfe
    
    Fixes #1249
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit be16bd8543f80ad2933ec9c37f082617c7084165)

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 62dee9cb6..bfc21de00 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -2511,15 +2511,14 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req,
         }
     }
 
-    if ((req->present & XkbKeyTypesMask) &&
-        (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values,
-                        &nTypes, mapWidths, doswap))) {
-        client->errorValue = nTypes;
-        return BadValue;
-    }
-    else {
+    if (!(req->present & XkbKeyTypesMask)) {
         nTypes = xkb->map->num_types;
     }
+    else if (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values,
+			       &nTypes, mapWidths, doswap)) {
+	    client->errorValue = nTypes;
+	    return BadValue;
+    }
 
     /* symsPerKey/mapWidths must be filled regardless of client-side flags */
     map = &xkb->map->key_sym_map[xkb->min_key_code];
commit 49444ce9f7ad34fff6ff94a9db95337f4bfd7b03
Author: Povilas Kanapickas <povilas at radix.lt>
Date:   Sat Nov 13 17:23:54 2021 +0200

    Revert "hw/xfree86: Propagate physical dimensions from DRM connector"
    
    Quite a lot of applications currently expect the screen DPI exposed by
    the X server to be 96 even when the real display DPI is different.
    Additionally, currently Xwayland completely ignores any hardware
    information and sets the DPI to 96. Accordingly the new behavior, even
    if it fixes a bug, should not be enabled automatically to all users.
    
    A better solution would be to make the default DPI stay as is and enable
    the correct behavior with a command line option (maybe -dpi auto, or
    similar). For now let's just revert the bug fix.
    
    This reverts commit 05b3c681ea2f478c0cb941c2f8279919cf78de6d.
    
    Signed-off-by: Povilas Kanapickas <povilas at radix.lt>
    (cherry picked from commit 35af1299e73483eaf93d913a960e1d1738bc7de6)

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index d03382d26..0389945a7 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -55,7 +55,6 @@
 #include "xf86Xinput.h"
 #include "xf86InPriv.h"
 #include "mivalidate.h"
-#include "xf86Crtc.h"
 
 /* For xf86GetClocks */
 #if defined(CSRG_BASED) || defined(__GNU__)
@@ -852,9 +851,8 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
 {
     MessageType from = X_DEFAULT;
     xf86MonPtr DDC = (xf86MonPtr) (pScrn->monitor->DDC);
-    int probedWidthmm, probedHeightmm;
+    int ddcWidthmm, ddcHeightmm;
     int widthErr, heightErr;
-    xf86OutputPtr compat = xf86CompatOutput(pScrn);
 
     /* XXX Maybe there is no need for widthmm/heightmm in ScrnInfoRec */
     pScrn->widthmm = pScrn->monitor->widthmm;
@@ -864,15 +862,11 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
         /* DDC gives display size in mm for individual modes,
          * but cm for monitor
          */
-        probedWidthmm = DDC->features.hsize * 10;  /* 10mm in 1cm */
-        probedHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */
-    }
-    else if (compat && compat->mm_width > 0 && compat->mm_height > 0) {
-        probedWidthmm = compat->mm_width;
-        probedHeightmm = compat->mm_height;
+        ddcWidthmm = DDC->features.hsize * 10;  /* 10mm in 1cm */
+        ddcHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */
     }
     else {
-        probedWidthmm = probedHeightmm = 0;
+        ddcWidthmm = ddcHeightmm = 0;
     }
 
     if (monitorResolution > 0) {
@@ -898,15 +892,15 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
                    pScrn->widthmm, pScrn->heightmm);
 
         /* Warn if config and probe disagree about display size */
-        if (probedWidthmm && probedHeightmm) {
+        if (ddcWidthmm && ddcHeightmm) {
             if (pScrn->widthmm > 0) {
-                widthErr = abs(probedWidthmm - pScrn->widthmm);
+                widthErr = abs(ddcWidthmm - pScrn->widthmm);
             }
             else {
                 widthErr = 0;
             }
             if (pScrn->heightmm > 0) {
-                heightErr = abs(probedHeightmm - pScrn->heightmm);
+                heightErr = abs(ddcHeightmm - pScrn->heightmm);
             }
             else {
                 heightErr = 0;
@@ -915,17 +909,17 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
                 /* Should include config file name for monitor here */
                 xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
                            "Probed monitor is %dx%d mm, using Displaysize %dx%d mm\n",
-                           probedWidthmm, probedHeightmm, pScrn->widthmm,
+                           ddcWidthmm, ddcHeightmm, pScrn->widthmm,
                            pScrn->heightmm);
             }
         }
     }
-    else if (probedWidthmm && probedHeightmm) {
+    else if (ddcWidthmm && ddcHeightmm) {
         from = X_PROBED;
         xf86DrvMsg(pScrn->scrnIndex, from, "Display dimensions: (%d, %d) mm\n",
-                   probedWidthmm, probedHeightmm);
-        pScrn->widthmm = probedWidthmm;
-        pScrn->heightmm = probedHeightmm;
+                   ddcWidthmm, ddcHeightmm);
+        pScrn->widthmm = ddcWidthmm;
+        pScrn->heightmm = ddcHeightmm;
         if (pScrn->widthmm > 0) {
             pScrn->xDpi =
                 (int) ((double) pScrn->virtualX * MMPERINCH / pScrn->widthmm);
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 202791774..c6e89e66f 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -3256,10 +3256,8 @@ xf86OutputSetEDID(xf86OutputPtr output, xf86MonPtr edid_mon)
     free(output->MonInfo);
 
     output->MonInfo = edid_mon;
-    if (edid_mon) {
-        output->mm_width = 0;
-        output->mm_height = 0;
-    }
+    output->mm_width = 0;
+    output->mm_height = 0;
 
     if (debug_modes) {
         xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n",
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 5b90f4bf1..39a38c741 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -806,12 +806,6 @@ xf86RandR12CreateScreenResources(ScreenPtr pScreen)
                 mmWidth = output->conf_monitor->mon_width;
                 mmHeight = output->conf_monitor->mon_height;
             }
-            else if (output &&
-                (output->mm_width > 0 &&
-                 output->mm_height > 0)) {
-                mmWidth = output->mm_width;
-                mmHeight = output->mm_height;
-            }
             else {
                 /*
                  * Otherwise, just set the screen to DEFAULT_DPI
commit 6f11b3c803898e0effe6ade2ae951f5758936152
Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Nov 11 06:35:19 2021 +1000

    dri2: add crocus to the list of va_gl users
    
    (cherry picked from commit a7b0a7fabd137183cc42a5edb15697e354c4450c)

diff --git a/hw/xfree86/drivers/modesetting/dri2.c b/hw/xfree86/drivers/modesetting/dri2.c
index 7ff52be6d..8d1b742ef 100644
--- a/hw/xfree86/drivers/modesetting/dri2.c
+++ b/hw/xfree86/drivers/modesetting/dri2.c
@@ -1086,7 +1086,8 @@ ms_dri2_screen_init(ScreenPtr screen)
          * guess that the DRI and VDPAU drivers have the same name.
          */
         if (strcmp(driver_names[0], "i965") == 0 ||
-            strcmp(driver_names[0], "iris") == 0) {
+            strcmp(driver_names[0], "iris") == 0 ||
+            strcmp(driver_names[0], "crocus") == 0) {
             driver_names[1] = "va_gl";
         } else {
             driver_names[1] = driver_names[0];


More information about the xorg-commit mailing list