[arch-commits] Commit in xorg-server/trunk (3 files)

Laurent Carlier lcarlier at gemini.archlinux.org
Thu Jul 29 08:47:16 UTC 2021


    Date: Thursday, July 29, 2021 @ 08:47:15
  Author: lcarlier
Revision: 420616

upgpkg: xorg-server 1.20.12-2: fix FS#71483

Added:
  xorg-server/trunk/0001-present-fallback-get_crtc-to-return-crtc-belonging-t.patch
  xorg-server/trunk/0002-modesetting-unflip-not-possible-when-glamor-is-not-s.patch
Modified:
  xorg-server/trunk/PKGBUILD

-----------------------------------------------------------------+
 0001-present-fallback-get_crtc-to-return-crtc-belonging-t.patch |   97 ++++++++++
 0002-modesetting-unflip-not-possible-when-glamor-is-not-s.patch |   29 ++
 PKGBUILD                                                        |   10 -
 3 files changed, 135 insertions(+), 1 deletion(-)

Added: 0001-present-fallback-get_crtc-to-return-crtc-belonging-t.patch
===================================================================
--- 0001-present-fallback-get_crtc-to-return-crtc-belonging-t.patch	                        (rev 0)
+++ 0001-present-fallback-get_crtc-to-return-crtc-belonging-t.patch	2021-07-29 08:47:15 UTC (rev 420616)
@@ -0,0 +1,97 @@
+From d6c02ffd9c910637f6b3b7249507998e9e45f93c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C5=81ukasz=20Spintzyk?= <lukasz.spintzyk at synaptics.com>
+Date: Mon, 19 Jul 2021 14:25:28 +0200
+Subject: [PATCH 1/2] present: fallback get_crtc to return crtc belonging to
+ screen with present extension
+
+Since crtc can belong to secondary output that may not have present
+extension enabled we should fallback to first enabled crtc or fake crtc.
+
+Fix for issue xorg/xserver#1195
+
+Signed-off-by: Laurent Carlier <lordheavym at gmail.com>
+---
+ present/present.c | 10 +++++++++-
+ randr/randr.c     | 27 +++++++++++++++++++++++++++
+ randr/randrstr.h  |  2 ++
+ 3 files changed, 38 insertions(+), 1 deletion(-)
+
+diff --git a/present/present.c b/present/present.c
+index 217fe1d7a..271fe32bc 100644
+--- a/present/present.c
++++ b/present/present.c
+@@ -44,11 +44,19 @@ present_get_crtc(WindowPtr window)
+ {
+     ScreenPtr                   screen = window->drawable.pScreen;
+     present_screen_priv_ptr     screen_priv = present_screen_priv(screen);
++    RRCrtcPtr                   crtc = NULL;
+ 
+     if (!screen_priv)
+         return NULL;
+ 
+-    return screen_priv->get_crtc(screen_priv, window);
++    crtc = screen_priv->get_crtc(screen_priv, window);
++    if (crtc && !present_screen_priv(crtc->pScreen)) {
++        crtc = RRFirstEnabledCrtc(screen);
++    }
++    if (crtc && !present_screen_priv(crtc->pScreen)) {
++        crtc = NULL;
++    }
++    return crtc;
+ }
+ 
+ /*
+diff --git a/randr/randr.c b/randr/randr.c
+index 3f94c2f6c..6d02c2577 100644
+--- a/randr/randr.c
++++ b/randr/randr.c
+@@ -697,6 +697,33 @@ RRFirstOutput(ScreenPtr pScreen)
+     return NULL;
+ }
+ 
++RRCrtcPtr
++RRFirstEnabledCrtc(ScreenPtr pScreen)
++{
++    rrScrPriv(pScreen);
++    RROutputPtr output;
++    int i, j;
++
++    if (!pScrPriv)
++        return NULL;
++
++    if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc &&
++        pScrPriv->primaryOutput->pScreen == pScreen)
++        return pScrPriv->primaryOutput->crtc;
++
++    for (i = 0; i < pScrPriv->numCrtcs; i++) {
++        RRCrtcPtr crtc = pScrPriv->crtcs[i];
++
++        for (j = 0; j < pScrPriv->numOutputs; j++) {
++            output = pScrPriv->outputs[j];
++            if (output->crtc == crtc && crtc->mode)
++                return crtc;
++        }
++    }
++    return NULL;
++}
++
++
+ CARD16
+ RRVerticalRefresh(xRRModeInfo * mode)
+ {
+diff --git a/randr/randrstr.h b/randr/randrstr.h
+index 8f427a48e..b23390575 100644
+--- a/randr/randrstr.h
++++ b/randr/randrstr.h
+@@ -593,6 +593,8 @@ extern _X_EXPORT Bool RRScreenInit(ScreenPtr pScreen);
+ 
+ extern _X_EXPORT RROutputPtr RRFirstOutput(ScreenPtr pScreen);
+ 
++extern _X_EXPORT RRCrtcPtr RRFirstEnabledCrtc(ScreenPtr pScreen);
++
+ extern _X_EXPORT Bool RROutputSetNonDesktop(RROutputPtr output, Bool non_desktop);
+ 
+ extern _X_EXPORT CARD16
+-- 
+2.32.0
+

Added: 0002-modesetting-unflip-not-possible-when-glamor-is-not-s.patch
===================================================================
--- 0002-modesetting-unflip-not-possible-when-glamor-is-not-s.patch	                        (rev 0)
+++ 0002-modesetting-unflip-not-possible-when-glamor-is-not-s.patch	2021-07-29 08:47:15 UTC (rev 420616)
@@ -0,0 +1,29 @@
+From 8836b9d243444031b6396d39d345f2f83b5fa6a9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C5=81ukasz=20Spintzyk?= <lukasz.spintzyk at synaptics.com>
+Date: Thu, 22 Jul 2021 13:12:05 +0200
+Subject: [PATCH 2/2] modesetting: unflip not possible when glamor is not set
+
+This is fixing crashes of xfce when running under qemu
+
+Signed-off-by: Laurent Carlier <lordheavym at gmail.com>
+---
+ hw/xfree86/drivers/modesetting/present.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/hw/xfree86/drivers/modesetting/present.c b/hw/xfree86/drivers/modesetting/present.c
+index f0a0e2704..916a15303 100644
+--- a/hw/xfree86/drivers/modesetting/present.c
++++ b/hw/xfree86/drivers/modesetting/present.c
+@@ -272,6 +272,9 @@ ms_present_check_unflip(RRCrtcPtr crtc,
+         pixmap->devKind != drmmode_bo_get_pitch(&ms->drmmode.front_bo))
+         return FALSE;
+ 
++    if (!ms->drmmode.glamor)
++        return FALSE;
++
+ #ifdef GBM_BO_WITH_MODIFIERS
+     /* Check if buffer format/modifier is supported by all active CRTCs */
+     gbm = ms->glamor.gbm_bo_from_pixmap(screen, pixmap);
+-- 
+2.32.0
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-07-29 08:21:04 UTC (rev 420615)
+++ PKGBUILD	2021-07-29 08:47:15 UTC (rev 420616)
@@ -5,7 +5,7 @@
 pkgname=('xorg-server' 'xorg-server-xephyr' 'xorg-server-xvfb' 'xorg-server-xnest'
          'xorg-server-common' 'xorg-server-devel')
 pkgver=1.20.12
-pkgrel=1
+pkgrel=2
 arch=('x86_64')
 license=('custom')
 groups=('xorg')
@@ -21,6 +21,8 @@
         xserver-autobind-hotplug.patch
         0001-v2-FS-58644.patch
         0002-fix-libshadow-2.patch
+        0001-present-fallback-get_crtc-to-return-crtc-belonging-t.patch
+        0002-modesetting-unflip-not-possible-when-glamor-is-not-s.patch
         xvfb-run # with updates from FC master
         xvfb-run.1)
 validpgpkeys=('7B27A3F1A6E18CD9588B4AE8310180050905E40C'
@@ -32,6 +34,8 @@
             'd84f4d63a502b7af76ea49944d1b21e2030dfd250ac1e82878935cf631973310ac9ba1f0dfedf10980ec6c7431d61b7daa4b7bbaae9ee477b2c19812c1661a22'
             '74e1aa0c101e42f0f25349d305641873b3a79ab3b9bb2d4ed68ba8e392b4db2701fcbc35826531ee2667d3ee55673e4b4fecc2a9f088141af29ceb400f72f363'
             '3d3be34ad9fa976daec53573d3a30a9f1953341ba5ee27099af0141f0ef7994fa5cf84dc08aae848380e6abfc10879f9a67f07601c7a437abf8aef13a3ec9fe1'
+            '531a3d0b9cebdcb06a9dcf4a8501bee1ee4ed1791e8f2bc95e7859fd78cebbe3a9baacf7595f106c181835b53eb46c9f121f476e3c42cdd5e71dc91b5e507076'
+            '2601f780c3480fcfd009a95f703140e05d2ccc64c5c1de9455f134c0ec159f96e86a8bd81f735ce6b91ac5edb71683889b4667a92eae71d42dd7b57d93338b31'
             '4154dd55702b98083b26077bf70c60aa957b4795dbf831bcc4c78b3cb44efe214f0cf8e3c140729c829b5f24e7466a24615ab8dbcce0ac6ebee3229531091514'
             'de5e2cb3c6825e6cf1f07ca0d52423e17f34d70ec7935e9dd24be5fb9883bf1e03b50ff584931bd3b41095c510ab2aa44d2573fd5feaebdcb59363b65607ff22')
 
@@ -47,6 +51,10 @@
 
   # Fix libshadow.so: libfb.so => not found - merge in master
   patch -Np1 -i ../0002-fix-libshadow-2.patch
+
+  # Fix FS#71483 - [Xorg] Xorg crashes when opening new window
+  patch -Np1 -i ../0001-present-fallback-get_crtc-to-return-crtc-belonging-t.patch
+  patch -Np1 -i ../0002-modesetting-unflip-not-possible-when-glamor-is-not-s.patch
 }
 
 build() {



More information about the arch-commits mailing list