xserver: Branch 'server-1.20-branch' - 6 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 7 16:30:26 UTC 2018


 Xext/panoramiX.c                                 |    9 ++++-----
 configure.ac                                     |    6 +++---
 hw/xfree86/drivers/modesetting/driver.c          |    2 --
 hw/xfree86/drivers/modesetting/drmmode_display.c |   19 +------------------
 hw/xfree86/drivers/modesetting/drmmode_display.h |    2 --
 hw/xwayland/xwayland-glamor.c                    |    1 +
 hw/xwayland/xwayland-output.c                    |   12 +++++++++++-
 meson.build                                      |    2 +-
 randr/randr.c                                    |    4 ++++
 randr/randrstr.h                                 |    3 +++
 randr/rrcrtc.c                                   |   11 +++++++++++
 randr/rrlease.c                                  |    2 +-
 randr/rroutput.c                                 |   11 +++++++++++
 13 files changed, 51 insertions(+), 33 deletions(-)

New commits:
commit 1508ea68065b7976dbf56039f9b20dcaf0394431
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Aug 7 12:26:05 2018 -0400

    xserver 1.20.1
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/configure.ac b/configure.ac
index b7808e892..7694d80d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,9 +26,9 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.20.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2018-05-10"
-RELEASE_NAME="Avocado Toast"
+AC_INIT([xorg-server], 1.20.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2018-08-07"
+RELEASE_NAME="Kale Salad"
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
diff --git a/meson.build b/meson.build
index 706228228..956cf96a4 100644
--- a/meson.build
+++ b/meson.build
@@ -3,7 +3,7 @@ project('xserver', 'c',
             'buildtype=debugoptimized',
             'c_std=gnu99',
         ],
-        version: '1.20.0',
+        version: '1.20.1',
         meson_version: '>= 0.42.0',
 )
 add_project_arguments('-DHAVE_DIX_CONFIG_H', language: 'c')
commit 101d15c7634b26eafb3c5f2edb7cafde102ce208
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jun 26 09:20:00 2018 -0700

    During reset/shutdown, clean up leases in DIX instead of each driver
    
    Instead of having every video driver loop over any pending leases to
    free them during CloseScreen, do this up in the DIX layer by
    terminating leases when a leased CRTC or Output is destroyed and
    (just to make sure), also terminating leases in RRCloseScreen. The
    latter should "never" get invoked as any lease should be associated
    with a resource which was destroyed.
    
    This is required as by the time the driver's CloseScreen function is
    invoked, we've already freed all of the DIX randr structures and no
    longer have any way to reference the leases
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=106960
    Cc: Thomas Hellstrom <thellstrom at vmware.com>
    (cherry picked from commit 1ef7aed3e2bb2af32330f19b1e7560000512ddfe)

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 4a6643961..9362370c3 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -1838,8 +1838,6 @@ CloseScreen(ScreenPtr pScreen)
         ms->drmmode.shadow_fb2 = NULL;
     }
 
-    drmmode_terminate_leases(pScrn, &ms->drmmode);
-
     drmmode_uevent_fini(pScrn, &ms->drmmode);
 
     drmmode_free_bos(pScrn, &ms->drmmode);
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 12a919fc0..f6f2e9fd1 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -3327,23 +3327,6 @@ drmmode_terminate_lease(RRLeasePtr lease)
     }
 }
 
-void
-drmmode_terminate_leases(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
-{
-    ScreenPtr screen = xf86ScrnToScreen(pScrn);
-    rrScrPrivPtr scr_priv = rrGetScrPriv(screen);
-    RRLeasePtr lease, next;
-
-    xorg_list_for_each_entry_safe(lease, next, &scr_priv->leases, list) {
-        drmmode_lease_private_ptr lease_private = lease->devPrivate;
-        drmModeRevokeLease(drmmode->fd, lease_private->lessee_id);
-        free(lease_private);
-        lease->devPrivate = NULL;
-        RRLeaseTerminated(lease);
-        RRLeaseFree(lease);
-    }
-}
-
 static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
     .resize = drmmode_xf86crtc_resize,
     .create_lease = drmmode_create_lease,
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h
index e46a292d3..cde661450 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.h
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.h
@@ -272,8 +272,6 @@ extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn);
 extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode);
 extern void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode);
 
-extern void drmmode_terminate_leases(ScrnInfoPtr scrn, drmmode_ptr drmmode);
-
 Bool drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
 void *drmmode_map_front_bo(drmmode_ptr drmmode);
 Bool drmmode_map_cursor_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
diff --git a/randr/randr.c b/randr/randr.c
index feb54bcc8..5db8b5ced 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -89,8 +89,12 @@ RRCloseScreen(ScreenPtr pScreen)
 {
     rrScrPriv(pScreen);
     int j;
+    RRLeasePtr lease, next;
 
     unwrap(pScrPriv, pScreen, CloseScreen);
+
+    xorg_list_for_each_entry_safe(lease, next, &pScrPriv->leases, list)
+        RRTerminateLease(lease);
     for (j = pScrPriv->numCrtcs - 1; j >= 0; j--)
         RRCrtcDestroy(pScrPriv->crtcs[j]);
     for (j = pScrPriv->numOutputs - 1; j >= 0; j--)
diff --git a/randr/randrstr.h b/randr/randrstr.h
index f94174b54..2cede92e3 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -829,6 +829,9 @@ RRCrtcIsLeased(RRCrtcPtr crtc);
 extern _X_EXPORT Bool
 RROutputIsLeased(RROutputPtr output);
 
+void
+RRTerminateLease(RRLeasePtr lease);
+
 Bool
 RRLeaseInit(void);
 
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 74dc5a265..5d9026266 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -872,6 +872,17 @@ RRCrtcDestroyResource(void *value, XID pid)
     if (pScreen) {
         rrScrPriv(pScreen);
         int i;
+        RRLeasePtr lease, next;
+
+        xorg_list_for_each_entry_safe(lease, next, &pScrPriv->leases, list) {
+            int c;
+            for (c = 0; c < lease->numCrtcs; c++) {
+                if (lease->crtcs[c] == crtc) {
+                    RRTerminateLease(lease);
+                    break;
+                }
+            }
+        }
 
         for (i = 0; i < pScrPriv->numCrtcs; i++) {
             if (pScrPriv->crtcs[i] == crtc) {
diff --git a/randr/rrlease.c b/randr/rrlease.c
index b4a8827cc..e25d9ca99 100644
--- a/randr/rrlease.c
+++ b/randr/rrlease.c
@@ -169,7 +169,7 @@ RRLeaseFree(RRLeasePtr lease)
  * finished, which may be some time after this function returns
  * if the driver operation is asynchronous
  */
-static void
+void
 RRTerminateLease(RRLeasePtr lease)
 {
     ScreenPtr screen = lease->screen;
diff --git a/randr/rroutput.c b/randr/rroutput.c
index 33300e1cc..e52ad7671 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -379,6 +379,17 @@ RROutputDestroyResource(void *value, XID pid)
     if (pScreen) {
         rrScrPriv(pScreen);
         int i;
+        RRLeasePtr lease, next;
+
+        xorg_list_for_each_entry_safe(lease, next, &pScrPriv->leases, list) {
+            int o;
+            for (o = 0; o < lease->numOutputs; o++) {
+                if (lease->outputs[o] == output) {
+                    RRTerminateLease(lease);
+                    break;
+                }
+            }
+        }
 
         if (pScrPriv->primaryOutput == output)
             pScrPriv->primaryOutput = NULL;
commit 9347326d28fffc7534cad0b084539e936aacfd45
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jul 18 13:22:43 2018 +1000

    Xext: dynamically allocate the PanoramiXDepths[j].vids array
    
    Control flow is:
       PanoramiXMaybeAddDepth() allocates an array size 240 (pDepth->numVisuals)
       PanoramiXMaybeAddVisual() finds up to 270 matches (pScreen->numVisuals)
       and writes those into the previously allocated array.
    
    This caused invalid reads/writes followed by eventually a double-free abort.
    
    Reproduced with xorg-integration-tests server test
    XineramaTest.ScreenCrossing/* (and a bunch of others).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 93cafb0828d2e24bd14616df1aa9883fb843dd6c)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 844ea49ce..bd9c45b03 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -751,11 +751,7 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth)
                                    PanoramiXNumDepths, sizeof(DepthRec));
     PanoramiXDepths[j].depth = pDepth->depth;
     PanoramiXDepths[j].numVids = 0;
-    /* XXX suboptimal, should grow these dynamically */
-    if (pDepth->numVids)
-        PanoramiXDepths[j].vids = xallocarray(pDepth->numVids, sizeof(VisualID));
-    else
-        PanoramiXDepths[j].vids = NULL;
+    PanoramiXDepths[j].vids = NULL;
 }
 
 static void
@@ -796,6 +792,9 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
 
     for (k = 0; k < PanoramiXNumDepths; k++) {
         if (PanoramiXDepths[k].depth == pVisual->nplanes) {
+            PanoramiXDepths[k].vids = reallocarray(PanoramiXDepths[k].vids,
+                                                   PanoramiXDepths[k].numVids + 1,
+                                                   sizeof(VisualID));
             PanoramiXDepths[k].vids[PanoramiXDepths[k].numVids] = pVisual->vid;
             PanoramiXDepths[k].numVids++;
             break;
commit cbf1ca2dba7bc3561cf1a8023e5e18706adbdba6
Author: emersion <contact at emersion.fr>
Date:   Fri Jul 13 15:51:26 2018 -0400

    xwayland: rotate logical size for RRMode
    
    The logical size is the size of the output in the global compositor
    space. The mode width/height should be scaled as in the logical
    size, but shouldn't be transformed. Thus we need to rotate back
    the logical size to be able to use it as the mode width/height.
    
    This fixes issues with pointer input on transformed outputs.
    
    Signed-Off-By: Simon Ser <contact at emersion.fr>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>
    (cherry picked from commit ce2dde9ed0243a18ae18af0879134f7c1afbd700)

diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index 379062549..0d2ec7890 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -213,6 +213,7 @@ apply_output_change(struct xwl_output *xwl_output)
 {
     struct xwl_screen *xwl_screen = xwl_output->xwl_screen;
     struct xwl_output *it;
+    int mode_width, mode_height;
     int width = 0, height = 0, has_this_output = 0;
     RRModePtr randr_mode;
     Bool need_rotate;
@@ -224,7 +225,16 @@ apply_output_change(struct xwl_output *xwl_output)
     /* xdg-output sends output size in compositor space. so already rotated */
     need_rotate = (xwl_output->xdg_output == NULL);
 
-    randr_mode = xwayland_cvt(xwl_output->width, xwl_output->height,
+    /* We need to rotate back the logical size for the mode */
+    if (need_rotate || xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) {
+        mode_width = xwl_output->width;
+        mode_height = xwl_output->height;
+    } else {
+        mode_width = xwl_output->height;
+        mode_height = xwl_output->width;
+    }
+
+    randr_mode = xwayland_cvt(mode_width, mode_height,
                               xwl_output->refresh / 1000.0, 0, 0);
     RROutputSetModes(xwl_output->randr_output, &randr_mode, 1, 1);
     RRCrtcNotify(xwl_output->randr_crtc, randr_mode,
commit 18a52a8e16046d8cabea6cf45913bf0b5be07709
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Wed Jul 25 16:33:23 2018 +0200

    xwayland: Enable DRI3 for glamor
    
    glamor_fds_from_pixmap() will bail out early if DRI3 is not enabled,
    unfortunately Xwayland's glamor code would not set it as enabled which
    would lead to blank pixmaps when using texture from pixmap.
    
    Make sure to mark DRI3 as enabled from glamor_egl_screen_init() in
    Xwayland.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107287
    Fixes: c8c276c956 ("glamor: Implement PixmapFromBuffers and BuffersFromPixmap")
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
    (cherry picked from commit cdec2b3c195d1d080207ef01c55ff14b45370010)

diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index f17914344..7ea6def61 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -57,6 +57,7 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
 {
     struct xwl_screen *xwl_screen = xwl_screen_get(screen);
 
+    glamor_enable_dri3(screen);
     glamor_ctx->ctx = xwl_screen->egl_context;
     glamor_ctx->display = xwl_screen->egl_display;
 
commit c256e31a9eba20da259f31ee70d1c8e1870993f1
Author: Takashi Iwai <tiwai at suse.de>
Date:   Thu Jul 19 14:38:19 2018 +0200

    modesetting: Fix cirrus 24bpp breakage
    
    The recent rewrite of modesetting driver broke the 24bpp support.
    As typically found on cirrus KMS, it leads to a blank screen, spewing
    the error like:
      failed to add fb -22
      (EE) modeset(0): failed to set mode: Invalid argument
    
    The culript is that the wrong bpp value of the front buffer is passed
    to drmModeAddFB().  Fix it by replacing with the back buffer bpp,
    drmmode->kbpp.
    
    Signed-off-by: Takashi Iwai <tiwai at suse.de>
    Tested-by: Stefan Dirsch <sndirsch at suse.de>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit d625e16918ef9104863709eb108346464767c444)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 87814b9c8..12a919fc0 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -995,7 +995,7 @@ drmmode_bo_import(drmmode_ptr drmmode, drmmode_bo *bo,
     }
 #endif
     return drmModeAddFB(drmmode->fd, bo->width, bo->height,
-                        drmmode->scrn->depth, drmmode->scrn->bitsPerPixel,
+                        drmmode->scrn->depth, drmmode->kbpp,
                         drmmode_bo_get_pitch(bo),
                         drmmode_bo_get_handle(bo), fb_id);
 }


More information about the xorg-commit mailing list