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

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 21 21:24:18 UTC 2019


 Makefile.am                                      |    2 -
 README.md                                        |   21 +++++--------------
 Xi/xibarriers.c                                  |   10 +++++++++
 configure.ac                                     |    2 -
 dri3/dri3_request.c                              |    4 +--
 glamor/glamor_render.c                           |   25 +++++++++++++++--------
 glx/vndcmds.c                                    |    4 ---
 hw/xfree86/common/xf86pciBus.c                   |    2 -
 hw/xfree86/dri2/pci_ids/i965_pci_ids.h           |    1 
 hw/xfree86/drivers/modesetting/drmmode_display.c |   12 ++++++++---
 hw/xfree86/modes/xf86RandR12.c                   |    2 -
 include/Makefile.am                              |    3 ++
 include/xserver_poll.h                           |    2 -
 mi/miinitext.c                                   |    2 -
 os/auth.c                                        |    9 +++++++-
 os/utils.c                                       |    9 ++++----
 present/present.c                                |    2 -
 present/present_priv.h                           |    1 
 present/present_scmd.c                           |   21 ++++++++++---------
 present/present_vblank.c                         |    6 ++---
 present/present_wnmd.c                           |   14 +++++++-----
 test/xi2/protocol-common.c                       |    1 
 test/xtest.c                                     |   11 +++++++---
 23 files changed, 100 insertions(+), 66 deletions(-)

New commits:
commit 524104e15c7169114e4fa3dd832990c58ee563a4
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Feb 8 13:29:14 2019 +1000

    Xi: lock the input thread for any pointer barrier list manipulation
    
    The input thread checks the barriers for pointer positioning, swapping the
    list out from underneath is considered impolite.
    
    Reported-by: Michel Dänzer <michel.daenzer at amd.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
    (cherry picked from commit 678d64aa2e929368b6d6f2b83bbf5540c4fa292d)

diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index d0be70135..1926762ad 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -611,7 +611,9 @@ CreatePointerBarrierClient(ClientPtr client,
         }
         pbd->deviceid = dev->id;
 
+        input_lock();
         xorg_list_add(&pbd->entry, &ret->per_device);
+        input_unlock();
     }
 
     ret->id = stuff->barrier;
@@ -626,7 +628,9 @@ CreatePointerBarrierClient(ClientPtr client,
         ret->barrier.directions &= ~(BarrierPositiveX | BarrierNegativeX);
     if (barrier_is_vertical(&ret->barrier))
         ret->barrier.directions &= ~(BarrierPositiveY | BarrierNegativeY);
+    input_lock();
     xorg_list_add(&ret->entry, &cs->barriers);
+    input_unlock();
 
     *client_out = ret;
     return Success;
@@ -689,7 +693,9 @@ BarrierFreeBarrier(void *data, XID id)
         mieqEnqueue(dev, (InternalEvent *) &ev);
     }
 
+    input_lock();
     xorg_list_del(&c->entry);
+    input_unlock();
 
     FreePointerBarrierClient(c);
     return Success;
@@ -709,7 +715,9 @@ static void add_master_func(void *res, XID id, void *devid)
     pbd = AllocBarrierDevice();
     pbd->deviceid = *deviceid;
 
+    input_lock();
     xorg_list_add(&pbd->entry, &barrier->per_device);
+    input_unlock();
 }
 
 static void remove_master_func(void *res, XID id, void *devid)
@@ -752,7 +760,9 @@ static void remove_master_func(void *res, XID id, void *devid)
         mieqEnqueue(dev, (InternalEvent *) &ev);
     }
 
+    input_lock();
     xorg_list_del(&pbd->entry);
+    input_unlock();
     free(pbd);
 }
 
commit ae9dda1e2620f402b434f10df581b0fdf0495ee8
Author: Peter Harris <pharris at opentext.com>
Date:   Wed Jan 30 14:51:07 2019 -0500

    os: Fix GetTimeInMicros resolution
    
    GetTimeInMillis is called first, which sets clockid to
    CLOCK_MONOTONIC_COARSE, which is typically much lower resolution than
    the callers of GetTimeInMicros want.
    
    Prior to a779fda224bee0c4d27636503367e55ae93b33c2, GetTimeInMillis and
    GetTimeInMicros did not share a clockid.
    
    Restore the clockid split to fix the granularity of GetTimeInMicros.
    
    Signed-off-by: Peter Harris <pharris at opentext.com>
    (cherry picked from commit 937a5b78a2f6ea771132ff0f9ece708a23c1bdad)

diff --git a/os/utils.c b/os/utils.c
index 6e3c16869..2ba1c8013 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -485,14 +485,15 @@ GetTimeInMicros(void)
     struct timeval tv;
 #ifdef MONOTONIC_CLOCK
     struct timespec tp;
+    static clockid_t uclockid;
 
-    if (!clockid) {
+    if (!uclockid) {
         if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
-            clockid = CLOCK_MONOTONIC;
+            uclockid = CLOCK_MONOTONIC;
         else
-            clockid = ~0L;
+            uclockid = ~0L;
     }
-    if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
+    if (uclockid != ~0L && clock_gettime(uclockid, &tp) == 0)
         return (CARD64) tp.tv_sec * (CARD64)1000000 + tp.tv_nsec / 1000;
 #endif
 
commit 013c28a122a61beaf3a4ee7cc92b7ca2c92de7ab
Author: A. Wilcox <AWilcox at Wilcox-Tech.com>
Date:   Sat Jan 26 15:37:56 2019 -0600

    DRI2: Add another Coffeelake PCI ID
    
    A user of Adélie Linux reported that modesetting wasn't working properly on
    their Intel i7-9700K-integrated UHD 630 GPU.  Xorg.0.log showed:
    
    [   131.902] (EE) modeset(0): [DRI2] No driver mapping found for PCI device 0x8086 / 0x3e98
    [   131.902] (EE) modeset(0): Failed to initialize the DRI2 extension.
    
    Indeed, that PCI ID is missing from i965_pci_ids.  Adding it fixed the issue
    and allowed the system to work with i965_dri under modesetting.
    
    (cherry picked from commit d3a26bbf618507e1ca05b2bc99a880075b77db77)

diff --git a/hw/xfree86/dri2/pci_ids/i965_pci_ids.h b/hw/xfree86/dri2/pci_ids/i965_pci_ids.h
index 82e4a549e..1ef1a0edf 100644
--- a/hw/xfree86/dri2/pci_ids/i965_pci_ids.h
+++ b/hw/xfree86/dri2/pci_ids/i965_pci_ids.h
@@ -174,6 +174,7 @@ CHIPSET(0x3EA4, cfl_gt1, "Intel(R) HD Graphics (Coffeelake 2x6 GT1)")
 CHIPSET(0x3E91, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)")
 CHIPSET(0x3E92, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)")
 CHIPSET(0x3E96, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)")
+CHIPSET(0x3E98, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)")
 CHIPSET(0x3E9A, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)")
 CHIPSET(0x3E9B, cfl_gt2, "Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)")
 CHIPSET(0x3E94, cfl_gt2, "Intel(R) HD Graphics (Coffeelake 3x8 GT2)")
commit a51d7a730cfd82ab44ea5510eafdbe9d7043e706
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Oct 16 12:58:25 2018 -0400

    vnd: Fix a silly memory leak
    
    'disp' was already allocated by LookupVendorPrivDispatch above,
    clobbering it will do no good.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 709c6562975c3bea10dd0571527a4aac79a6bf6f)

diff --git a/glx/vndcmds.c b/glx/vndcmds.c
index 45b1eafaa..f0779d14a 100644
--- a/glx/vndcmds.c
+++ b/glx/vndcmds.c
@@ -386,10 +386,6 @@ static int dispatch_GLXVendorPriv(ClientPtr client)
         // Note that even if none of the vendors provides a dispatch stub,
         // we'll still add an entry to the dispatch table, so that we don't
         // have to look it up again later.
-        disp = (GlxVendorPrivDispatch *) malloc(sizeof(GlxVendorPrivDispatch));
-        if (disp == NULL) {
-            return BadAlloc;
-        }
 
         disp->proc = GetVendorDispatchFunc(stuff->glxCode,
                                            GlxCheckSwap(client,
commit 544d0e961cfa96043ed3e5a718a768444c4a4c4d
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Jan 16 14:20:17 2019 -0500

    mi: When {en,dis}abling extensions, match names case-insensitively
    
    Both because extension names are inconsistently capitalized on the wire,
    and because the table we're walking spells it COMPOSITE not Composite.
    The latter is certainly also a bug, but there's no reason for us to be
    that strict.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit bf991a5f989c5e6e726a3731f468b7b7d65d9f4a)

diff --git a/mi/miinitext.c b/mi/miinitext.c
index 5596e212f..b7c702127 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -190,7 +190,7 @@ EnableDisableExtension(const char *name, Bool enable)
 
     for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) {
         ext = &staticExtensions[i];
-        if (strcmp(name, ext->name) == 0) {
+        if (strcasecmp(name, ext->name) == 0) {
             if (ext->disablePtr != NULL) {
                 *ext->disablePtr = !enable;
                 return TRUE;
commit 2215e8c7cf06f46f9995c8a7817c7ede9774a551
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Jan 14 12:42:00 2019 -0500

    dri3: Fix XACE access mode for open and get_supported_modifiers
    
    Neither opening a screen nor querying its modifiers confers the right to
    attach the buffer for any particular pixmap. GetAttr seems more correct.
    
    Fixes: xorg/xserver#550
    (cherry picked from commit 086c2e3de55bbf0cbc1d97f7dc2db70a7f5e69e3)

diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c
index e34bebedb..958877efa 100644
--- a/dri3/dri3_request.c
+++ b/dri3/dri3_request.c
@@ -135,7 +135,7 @@ proc_dri3_open(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xDRI3OpenReq);
 
-    status = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixReadAccess);
+    status = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixGetAttrAccess);
     if (status != Success)
         return status;
 
@@ -365,7 +365,7 @@ proc_dri3_get_supported_modifiers(ClientPtr client)
 
     REQUEST_SIZE_MATCH(xDRI3GetSupportedModifiersReq);
 
-    status = dixLookupWindow(&window, stuff->window, client, DixReadAccess);
+    status = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess);
     if (status != Success)
         return status;
     pScreen = window->drawable.pScreen;
commit 59e0b5f041eee92d0a51303082005ad8f053d8ca
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Dec 5 18:31:27 2018 +0100

    xfree86/modes: Don't clobber gamma LUT of compatibility output's CRTC
    
    If the driver calls xf86HandleColormaps, CMapChangeGamma updates the HW
    gamma LUT of all CRTCs via xf86RandR12LoadPalette. However,
    xf86RandR12ChangeGamma was then clobbering the gamma LUT of the RandR
    1.2 compatibility output's CRTC with the gamma curves computed from the
    screen's global gamma values.
    
    Fix this by bailing if xf86RandR12LoadPalette is installed.
    
    Fixes: 02ff0a5d7e32 "xf86RandR12: Fix XF86VidModeSetGamma triggering a
                         BadImplementation error"
    (cherry picked from commit 30044b2253c2dd51e1aedb2f897159c657ca8f0d)

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index b49d4c789..34f2652bf 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -2019,7 +2019,7 @@ xf86RandR12ChangeGamma(ScrnInfoPtr pScrn, Gamma gamma)
     RRCrtcPtr randr_crtc = xf86CompatRRCrtc(pScrn);
     int size;
 
-    if (!randr_crtc)
+    if (!randr_crtc || pScrn->LoadPalette == xf86RandR12LoadPalette)
         return Success;
 
     size = max(0, randr_crtc->gammaSize);
commit 712d0e86aaee96ffe1ad6a708b9134889e47d1c6
Author: Maya Rashish <maya at NetBSD.org>
Date:   Thu Jan 10 14:55:17 2019 +0200

    xfree86: Try nouveau on NetBSD as well.
    
    (cherry picked from commit e3fb178617a579c98877a3baae14c4dfe4d55db8)

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 0718cdcb0..6575c4ec8 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1190,7 +1190,7 @@ xf86VideoPtrToDriverList(struct pci_device *dev, XF86MatchedDrivers *md)
     {
         int idx = 0;
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__NetBSD__)
         driverList[idx++] = "nouveau";
 #endif
         driverList[idx++] = "nv";
commit ff1d1692e73b1729a6ced84bf58bcbe17f1c9d94
Author: Maya Rashish <maya at NetBSD.org>
Date:   Thu Jan 10 18:39:33 2019 +0200

    Fix typo in error message
    
    (cherry picked from commit bf2a7bb4ffbd199882fe4bd183561469833a9e6b)

diff --git a/include/xserver_poll.h b/include/xserver_poll.h
index 5a42307df..0f3a37c73 100644
--- a/include/xserver_poll.h
+++ b/include/xserver_poll.h
@@ -24,7 +24,7 @@
 #define _XSERVER_POLL_H_
 
 #ifndef _DIX_CONFIG_H_
-#error must inclue dix-config.h to use xserver_poll.h
+#error must include dix-config.h to use xserver_poll.h
 #endif
 
 #ifdef HAVE_POLL
commit c091ea5e38b5c41eaf3b10c43dc043401e8251c5
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Tue Jan 1 16:49:32 2019 -0800

    os: Report errors opening authorization file (#469)
    
    Fixes: xorg/xserver#469
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    (cherry picked from commit 7fb6338c68e158053295cb448faa5c559aa9990c)

diff --git a/os/auth.c b/os/auth.c
index da8b70985..d3254349d 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -42,6 +42,7 @@ from The Open Group.
 #include   "dixstruct.h"
 #include   <sys/types.h>
 #include   <sys/stat.h>
+#include   <errno.h>
 #ifdef WIN32
 #include    <X11/Xw32defs.h>
 #endif
@@ -119,9 +120,15 @@ LoadAuthorization(void)
     if (!authorization_file)
         return 0;
 
+    errno = 0;
     f = Fopen(authorization_file, "r");
-    if (!f)
+    if (!f) {
+        LogMessageVerb(X_ERROR, 0,
+                       "Failed to open authorization file \"%s\": %s\n",
+                       authorization_file,
+                       errno != 0 ? strerror(errno) : "Unknown error");
         return -1;
+    }
 
     while ((auth = XauReadAuth(f)) != 0) {
         for (i = 0; i < NUM_AUTHORIZATION; i++) {
commit 7b0f6102df3b18a048b791fe2304679b1eb2c9e7
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Dec 19 10:06:23 2018 +0100

    glamor: Check that storage format is compatible with RENDER format
    
    Fixes x2r10g10b10 related rendercheck failures.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    (cherry picked from commit 7e6faa5b3c05e0b7149ee840403885b0b40b5827)

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 0417df4e6..d5737018f 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -766,18 +766,27 @@ glamor_set_normalize_tcoords_generic(PixmapPtr pixmap,
  *
  * We could support many more formats by using GL_ARB_texture_view to
  * parse the same bits as different formats.  For now, we only support
- * tweaking whether we sample the alpha bits of an a8r8g8b8, or just
- * force them to 1.
+ * tweaking whether we sample the alpha bits, or just force them to 1.
  */
 static Bool
-glamor_render_format_is_supported(PictFormatShort format)
+glamor_render_format_is_supported(PicturePtr picture)
 {
-    switch (format) {
+    PictFormatShort storage_format;
+
+    /* Source-only pictures should always work */
+    if (!picture->pDrawable)
+        return TRUE;
+
+    storage_format = format_for_depth(picture->pDrawable->depth);
+
+    switch (picture->format) {
     case PICT_x2r10g10b10:
+        return storage_format == PICT_x2r10g10b10;
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
+        return storage_format == PICT_a8r8g8b8 || storage_format == PICT_x8r8g8b8;
     case PICT_a8:
-        return TRUE;
+        return storage_format == PICT_a8;
     default:
         return FALSE;
     }
@@ -815,7 +824,7 @@ glamor_composite_choose_shader(CARD8 op,
         goto fail;
     }
 
-    if (!glamor_render_format_is_supported(dest->format)) {
+    if (!glamor_render_format_is_supported(dest)) {
         glamor_fallback("Unsupported dest picture format.\n");
         goto fail;
     }
@@ -978,7 +987,7 @@ glamor_composite_choose_shader(CARD8 op,
                 goto fail;
             }
         } else {
-            if (source && !glamor_render_format_is_supported(source->format)) {
+            if (source && !glamor_render_format_is_supported(source)) {
                 glamor_fallback("Unsupported source picture format.\n");
                 goto fail;
             }
@@ -990,7 +999,7 @@ glamor_composite_choose_shader(CARD8 op,
                 goto fail;
             }
         } else if (mask) {
-            if (!glamor_render_format_is_supported(mask->format)) {
+            if (!glamor_render_format_is_supported(mask)) {
                 glamor_fallback("Unsupported mask picture format.\n");
                 goto fail;
             }
commit 356cf07b8a8fe6faedf701ae259f8f077a234dd5
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Nov 28 10:05:49 2018 +1000

    test: fix failing tests
    
    Broken since 69d8ea4a49793a94f821d1a328856901a1c02a5a because our fake screen
    didn't have a root window and writing the XKB rules prop would happily
    segfault. Fix this by setting up the required bits.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Michel Dänzer michel.daenzer at amd.com
    (cherry picked from commit fde27b9b4814b18aca6ec587bd3cfe9ab04b0c72)

diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c
index b91692f55..8cd85dd05 100644
--- a/test/xi2/protocol-common.c
+++ b/test/xi2/protocol-common.c
@@ -259,6 +259,7 @@ init_simple(void)
     screen.DeviceCursorInitialize = device_cursor_init;
     screen.DeviceCursorCleanup = device_cursor_cleanup;
     screen.SetCursorPosition = set_cursor_pos;
+    screen.root = &root;
 
     dixResetPrivates();
     InitAtoms();
diff --git a/test/xtest.c b/test/xtest.c
index 05d7ec1d3..fc5e43368 100644
--- a/test/xtest.c
+++ b/test/xtest.c
@@ -29,6 +29,7 @@
 #include "input.h"
 #include "inputstr.h"
 #include "scrnintstr.h"
+#include "windowstr.h"
 #include "exevents.h"
 #include "extinit.h"
 #include "xkbsrv.h"
@@ -58,11 +59,15 @@ device_cursor_cleanup(DeviceIntPtr dev, ScreenPtr screen)
 static void
 xtest_init_devices(void)
 {
-    ScreenRec screen;
-    ClientRec server_client;
+    ScreenRec screen = {0};
+    ClientRec server_client = {0};
+    WindowRec root = {0};
+    WindowOptRec optional = {0};
 
     /* random stuff that needs initialization */
-    memset(&screen, 0, sizeof(screen));
+    root.drawable.id = 0xab;
+    root.optional = &optional;
+    screen.root = &root;
     screenInfo.numScreens = 1;
     screenInfo.screens[0] = &screen;
     screen.myNum = 0;
commit c44eee243e6f4e488b586ad02e4fd00f587ebb49
Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Mon Dec 10 23:34:11 2018 -0500

    modesetting: fix conn_id termination and potential overrun by 1 byte
    
    Noticed when porting this logic to xf86-video-nouveau, and valgrind
    complained about conditional jump based on uninitialized data.
    
    Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
    Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.com>
    (cherry picked from commit 48b1af2718ab81c66f565438553415c05f1faa5c)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 101d9613a..336f7686e 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -2840,7 +2840,7 @@ static int parse_path_blob(drmModePropertyBlobPtr path_blob, int *conn_base_id,
     if (len + 1> 5)
         return -1;
     memcpy(conn_id, blob_data + 4, len);
-    conn_id[len + 1] = '\0';
+    conn_id[len] = '\0';
     id = strtoul(conn_id, NULL, 10);
 
     *conn_base_id = id;
commit 10609630e753b475566be27b186af4b2e290fdc6
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Nov 29 14:48:11 2018 -0500

    automake: Distribute meson's configure header templates
    
    Fixes: xorg/xserver#17
    (cherry picked from commit 82ed89c0f8b18d8214430580dc80c8d3e37bef33)

diff --git a/include/Makefile.am b/include/Makefile.am
index 0ce7faa6e..9c22ce113 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -79,5 +79,8 @@ EXTRA_DIST = 	\
 	swapreq.h \
 	systemd-logind.h \
         vidmodestr.h \
+	xorg-config.h.meson.in \
 	xorg-server.h.meson.in \
+	xwayland-config.h.meson.in \
+	xwin-config.h.meson.in \
 	xsha1.h
commit f5a77233b983eb06eb727d25148b68d1bc410022
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Fri Nov 9 12:34:59 2018 +0000

    present: fix compile warning with debug traces
    
    Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
    (cherry picked from commit a425eee6dce3b0cfd18b591907e8302a91b648c6)

diff --git a/present/present.c b/present/present.c
index 37cbf0720..3eddb7434 100644
--- a/present/present.c
+++ b/present/present.c
@@ -108,7 +108,7 @@ present_pixmap_idle(PixmapPtr pixmap, WindowPtr window, CARD32 serial, struct pr
     if (present_fence)
         present_fence_set_triggered(present_fence);
     if (window) {
-        DebugPresent(("\ti %08lx\n", pixmap ? pixmap->drawable.id : 0));
+        DebugPresent(("\ti %08" PRIx32 "\n", pixmap ? pixmap->drawable.id : 0));
         present_send_idle_notify(window, serial, pixmap, present_fence);
     }
 }
diff --git a/present/present_priv.h b/present/present_priv.h
index f62456755..5849b9e0b 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -34,6 +34,7 @@
 #include <syncsrv.h>
 #include <xfixes.h>
 #include <randrstr.h>
+#include <inttypes.h>
 
 #if 0
 #define DebugPresent(x) ErrorF x
diff --git a/present/present_scmd.c b/present/present_scmd.c
index 0803a0c0b..6a580cb7a 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -133,12 +133,12 @@ present_check_flip(RRCrtcPtr            crtc,
     /* Ask the driver for permission */
     if (screen_priv->info->version >= 1 && screen_priv->info->check_flip2) {
         if (!(*screen_priv->info->check_flip2) (crtc, window, pixmap, sync_flip, reason)) {
-            DebugPresent(("\td %08lx -> %08lx\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0));
+            DebugPresent(("\td %08" PRIx32 " -> %08" PRIx32 "\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0));
             return FALSE;
         }
     } else if (screen_priv->info->check_flip) {
         if (!(*screen_priv->info->check_flip) (crtc, window, pixmap, sync_flip)) {
-            DebugPresent(("\td %08lx -> %08lx\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0));
+            DebugPresent(("\td %08" PRIx32 " -> %08" PRIx32 "\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0));
             return FALSE;
         }
     }
@@ -351,7 +351,7 @@ present_unflip(ScreenPtr screen)
     present_restore_screen_pixmap(screen);
 
     screen_priv->unflip_event_id = ++present_event_id;
-    DebugPresent(("u %lld\n", screen_priv->unflip_event_id));
+    DebugPresent(("u %" PRIu64 "\n", screen_priv->unflip_event_id));
     (*screen_priv->info->unflip) (screen, screen_priv->unflip_event_id);
 }
 
@@ -361,7 +361,7 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
     ScreenPtr                   screen = vblank->screen;
     present_screen_priv_ptr     screen_priv = present_screen_priv(screen);
 
-    DebugPresent(("\tn %lld %p %8lld: %08lx -> %08lx\n",
+    DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n",
                   vblank->event_id, vblank, vblank->target_msc,
                   vblank->pixmap ? vblank->pixmap->drawable.id : 0,
                   vblank->window ? vblank->window->drawable.id : 0));
@@ -402,7 +402,7 @@ present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc)
 
     if (!event_id)
         return;
-    DebugPresent(("\te %lld ust %lld msc %lld\n", event_id, ust, msc));
+    DebugPresent(("\te %" PRIu64 " ust %" PRIu64 " msc %" PRIu64 "\n", event_id, ust, msc));
     xorg_list_for_each_entry(vblank, &present_exec_queue, event_queue) {
         int64_t match = event_id - vblank->event_id;
         if (match == 0) {
@@ -425,7 +425,7 @@ present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc)
         present_screen_priv_ptr screen_priv = present_screen_priv(screen);
 
         if (event_id == screen_priv->unflip_event_id) {
-            DebugPresent(("\tun %lld\n", event_id));
+            DebugPresent(("\tun %" PRIu64 "\n", event_id));
             screen_priv->unflip_event_id = 0;
             present_flip_idle(screen);
             present_flip_try_ready(screen);
@@ -547,7 +547,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
 
     if (vblank->flip && vblank->pixmap && vblank->window) {
         if (screen_priv->flip_pending || screen_priv->unflip_event_id) {
-            DebugPresent(("\tr %lld %p (pending %p unflip %lld)\n",
+            DebugPresent(("\tr %" PRIu64 " %p (pending %p unflip %" PRIu64 ")\n",
                           vblank->event_id, vblank,
                           screen_priv->flip_pending, screen_priv->unflip_event_id));
             xorg_list_del(&vblank->event_queue);
@@ -565,7 +565,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
 
         if (vblank->flip) {
 
-            DebugPresent(("\tf %lld %p %8lld: %08lx -> %08lx\n",
+            DebugPresent(("\tf %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n",
                           vblank->event_id, vblank, crtc_msc,
                           vblank->pixmap->drawable.id, vblank->window->drawable.id));
 
@@ -609,7 +609,8 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
             screen_priv->flip_pending = NULL;
             vblank->flip = FALSE;
         }
-        DebugPresent(("\tc %p %8lld: %08lx -> %08lx\n", vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id));
+        DebugPresent(("\tc %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n",
+                      vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id));
         if (screen_priv->flip_pending) {
 
             /* Check pending flip
@@ -713,7 +714,7 @@ present_scmd_pixmap(WindowPtr window,
             if (vblank->crtc != target_crtc || vblank->target_msc != target_msc)
                 continue;
 
-            DebugPresent(("\tx %lld %p %8lld: %08lx -> %08lx (crtc %p)\n",
+            DebugPresent(("\tx %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p)\n",
                           vblank->event_id, vblank, vblank->target_msc,
                           vblank->pixmap->drawable.id, vblank->window->drawable.id,
                           vblank->crtc));
diff --git a/present/present_vblank.c b/present/present_vblank.c
index f93a1afa9..2c124f4bb 100644
--- a/present/present_vblank.c
+++ b/present/present_vblank.c
@@ -138,7 +138,7 @@ present_vblank_create(WindowPtr window,
     }
 
     if (pixmap)
-        DebugPresent(("q %lld %p %8lld: %08lx -> %08lx (crtc %p) flip %d vsync %d serial %d\n",
+        DebugPresent(("q %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p) flip %d vsync %d serial %d\n",
                       vblank->event_id, vblank, *target_msc,
                       vblank->pixmap->drawable.id, vblank->window->drawable.id,
                       target_crtc, vblank->flip, vblank->sync_flip, vblank->serial));
@@ -153,7 +153,7 @@ no_mem:
 void
 present_vblank_scrap(present_vblank_ptr vblank)
 {
-    DebugPresent(("\tx %lld %p %8lld: %08lx -> %08lx (crtc %p)\n",
+    DebugPresent(("\tx %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 " (crtc %p)\n",
                   vblank->event_id, vblank, vblank->target_msc,
                   vblank->pixmap->drawable.id, vblank->window->drawable.id,
                   vblank->crtc));
@@ -175,7 +175,7 @@ present_vblank_destroy(present_vblank_ptr vblank)
     /* Also make sure vblank is removed from event queue (wnmd) */
     xorg_list_del(&vblank->event_queue);
 
-    DebugPresent(("\td %lld %p %8lld: %08lx -> %08lx\n",
+    DebugPresent(("\td %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n",
                   vblank->event_id, vblank, vblank->target_msc,
                   vblank->pixmap ? vblank->pixmap->drawable.id : 0,
                   vblank->window ? vblank->window->drawable.id : 0));
diff --git a/present/present_wnmd.c b/present/present_wnmd.c
index 2c6412a72..a2d9da8fb 100644
--- a/present/present_wnmd.c
+++ b/present/present_wnmd.c
@@ -168,7 +168,7 @@ present_wnmd_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_
     WindowPtr                   window = vblank->window;
     present_window_priv_ptr     window_priv = present_window_priv(window);
 
-    DebugPresent(("\tn %lld %p %8lld: %08lx -> %08lx\n",
+    DebugPresent(("\tn %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n",
                   vblank->event_id, vblank, vblank->target_msc,
                   vblank->pixmap ? vblank->pixmap->drawable.id : 0,
                   vblank->window ? vblank->window->drawable.id : 0));
@@ -213,7 +213,7 @@ present_wnmd_event_notify(WindowPtr window, uint64_t event_id, uint64_t ust, uin
         return;
     }
 
-    DebugPresent(("\te %lld ust %lld msc %lld\n", event_id, ust, msc));
+    DebugPresent(("\te %" PRIu64 " ust %" PRIu64 " msc %" PRIu64 "\n", event_id, ust, msc));
     xorg_list_for_each_entry(vblank, &window_priv->exec_queue, event_queue) {
         if (event_id == vblank->event_id) {
             present_wnmd_execute(vblank, ust, msc);
@@ -292,7 +292,8 @@ present_wnmd_check_flip(RRCrtcPtr           crtc,
     /* Ask the driver for permission */
     if (screen_priv->wnmd_info->check_flip2) {
         if (!(*screen_priv->wnmd_info->check_flip2) (crtc, window, pixmap, sync_flip, reason)) {
-            DebugPresent(("\td %08lx -> %08lx\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0));
+            DebugPresent(("\td %08" PRIx32 " -> %08" PRIx32 "\n",
+                          window->drawable.id, pixmap ? pixmap->drawable.id : 0));
             return FALSE;
         }
     }
@@ -425,7 +426,7 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
 
     if (vblank->flip && vblank->pixmap && vblank->window) {
         if (window_priv->flip_pending) {
-            DebugPresent(("\tr %lld %p (pending %p)\n",
+            DebugPresent(("\tr %" PRIu64 " %p (pending %p)\n",
                           vblank->event_id, vblank,
                           window_priv->flip_pending));
             xorg_list_del(&vblank->event_queue);
@@ -444,7 +445,7 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
         if (vblank->flip) {
             RegionPtr damage;
 
-            DebugPresent(("\tf %lld %p %8lld: %08lx -> %08lx\n",
+            DebugPresent(("\tf %" PRIu64 " %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n",
                           vblank->event_id, vblank, crtc_msc,
                           vblank->pixmap->drawable.id, vblank->window->drawable.id));
 
@@ -489,7 +490,8 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
             window_priv->flip_pending = NULL;
             vblank->flip = FALSE;
         }
-        DebugPresent(("\tc %p %8lld: %08lx -> %08lx\n", vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id));
+        DebugPresent(("\tc %p %" PRIu64 ": %08" PRIx32 " -> %08" PRIx32 "\n",
+                      vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id));
 
         present_wnmd_cancel_flip(window);
 
commit 4e12cba65682e97b056d8a8207189d4cf9c31862
Author: Lyude Paul <lyude at redhat.com>
Date:   Tue Nov 13 20:14:10 2018 -0500

    modesetting: Actually disable CRTCs in legacy mode
    
    Believe it or not, somehow we've never done this in legacy mode! We
    currently simply change the DPMS property on the CRTC's output's
    respective DRM connector, but this means that we're just setting the
    CRTC as inactive-not disabled. From the perspective of the kernel, this
    means that any shared resources used by the CRTC are still in use.
    
    This can cause problems for drivers that are not yet fully atomic,
    despite using the atomic helpers internally. For instance: if CRTC-1 and
    CRTC-2 are still enabled and use shared resources within the kernel (an
    MST topology, for example), and then userspace tries to go enable CRTC-3
    on the same topology this might suddenly fail if CRTC-3 needs the shared
    resources CRTC-1 and CRTC-2 are using. While I don't know of any
    situations in the mainline kernel that actually trigger this, future
    plans for reworking the atomic check of MST drivers are absolutely
    going to make this into a real issue (they already are in my WIP
    branches for the kernel).
    
    So: actually do the right thing here and disable CRTCs when they're not
    going to be used anymore, even in legacy mode.
    
    Signed-off-by: Lyude Paul <lyude at redhat.com>
    (cherry picked from commit 7a44e8d4007b9c3ca55a5cc3f5e98601565311c7)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 9717d9d39..101d9613a 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1354,13 +1354,19 @@ drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
 {
     modesettingPtr ms = modesettingPTR(crtc->scrn);
     drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+    drmmode_ptr drmmode = drmmode_crtc->drmmode;
 
     /* XXX Check if DPMS mode is already the right one */
 
     drmmode_crtc->dpms_mode = mode;
 
-    if (ms->atomic_modeset && mode != DPMSModeOn && !ms->pending_modeset)
-        drmmode_crtc_disable(crtc);
+    if (ms->atomic_modeset) {
+        if (mode != DPMSModeOn && !ms->pending_modeset)
+            drmmode_crtc_disable(crtc);
+    } else if (crtc->enabled == FALSE) {
+        drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
+                       0, 0, 0, NULL, 0, NULL);
+    }
 }
 
 #ifdef GLAMOR_HAS_GBM
commit 652918e736bcc577e221184415dcf61c05ac7bfb
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Nov 25 12:56:29 2018 -0800

    Update configure.ac bug URL for gitlab migration
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    (cherry picked from commit 17a22ad948009badbc79bbcd9a067004c98f5744)

diff --git a/configure.ac b/configure.ac
index 80f0ce785..c079ca476 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.20.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.20.3, [https://gitlab.freedesktop.org/xorg/xserver/issues], xorg-server)
 RELEASE_DATE="2018-10-25"
 RELEASE_NAME="Harissa Roasted Carrots"
 AC_CONFIG_SRCDIR([Makefile.am])
commit 40b22a0571d422473a7a324daa65f6a768181644
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Nov 18 15:49:27 2018 -0800

    Update README for gitlab migration
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    (cherry picked from commit 5d097c2a20fce44cdb9d5c302d46bc7fa16edfec)

diff --git a/Makefile.am b/Makefile.am
index 32d4d21e7..19511f765 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -72,7 +72,7 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = xorg-server.pc
 endif
 
-EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh
+EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh README.md
 
 DISTCHECK_CONFIGURE_FLAGS=\
 	--with-xkb-path=$(XKB_BASE_DIRECTORY) \
diff --git a/README b/README.md
similarity index 65%
rename from README
rename to README.md
index 529526d18..bc39f41cd 100644
--- a/README
+++ b/README.md
@@ -1,4 +1,5 @@
-					X Server
+X Server
+--------
 
 The X server accepts requests from client applications to create windows,
 which are (normally rectangular) "virtual screens" that the client program
@@ -16,29 +17,19 @@ https://en.wikipedia.org/wiki/X_server
 All questions regarding this software should be directed at the
 Xorg mailing list:
 
-        https://lists.freedesktop.org/mailman/listinfo/xorg
-
-Please submit bug reports to the Xorg bugzilla:
-
-        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+  https://lists.freedesktop.org/mailman/listinfo/xorg
 
 The master development code repository can be found at:
 
-        git://anongit.freedesktop.org/git/xorg/xserver
-
-        https://cgit.freedesktop.org/xorg/xserver
+  https://gitlab.freedesktop.org/xorg/xserver
 
 For patch submission instructions, see:
 
-	https://www.x.org/wiki/Development/Documentation/SubmittingPatches
-
-For more information on the git code manager, see:
-
-        https://wiki.x.org/wiki/GitPage
+  https://www.x.org/wiki/Development/Documentation/SubmittingPatches
 
 As with other projects hosted on freedesktop.org, X.Org follows its
 Code of Conduct, based on the Contributor Covenant. Please conduct
 yourself in a respectful and civilized manner when using the above
 mailing lists, bug trackers, etc:
 
-	https://www.freedesktop.org/wiki/CodeOfConduct
+  https://www.freedesktop.org/wiki/CodeOfConduct


More information about the xorg-commit mailing list