commit fbbdd5613122f0f7d74471f240c28e4c3b796065
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu May 30 14:07:06 2019 -0400

    xserver 1.20.5
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

commit 240868527bb11beb9a03ad0d3f24506f1b983729
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Mar 25 13:19:41 2019 +1000

    dix: leave last.valuators alone on slave switch
    
    Terms:
    dev->last.valuator[] is the last value given to us by the driver
    dev->valuator.axisVal[] is the last value sent to the client
    dev->last.scroll[] is the abs value of the scroll axis as given by the driver,
            used for button emulation calculation (and the remainder)
    
    This function updates the device's last.valuator state based on the current
    master axis state. This way, relative motion continues fluidly when switching
    between devices. Before mouse 2 comes into effect, it's valuator state is
    updated to wherever the pointer currently is so the relative event applies on
    top of that.
    
    This can only work for x/y axes, all other axes aren't guaranteed to have the
    same meaning and/or may not be present:
    - xtest device: no valuator 2
    - mouse: valuator 2 is horizontal scroll axis
    - tablet: valuator 2 is pressure
    
    Scaling the current value from the pressure range into the range for
    horizontal scrolling makes no sense. And it causes scroll jumps:
    
    - scroll down, last.valuator == axisVal == 20
    - xdotool click 1, the XTest device doesn't have that valuator
    - scroll up
      - updateSlaveDeviceCoords reset last.valuator to 0 (axisVal == 20)
      - DeviceClassesChangedEvent includes value 20 for the axis
      - event is processed, last.value changes from 0 to -1
      - axisVal is updated to -1, causing a jump of -21
    
    The same applies when we switch from tablet to mouse wheel if the pressure
    value is 0 on proximity out (basically guaranteed). So let's drop this code
    altogether and only leave the scaling for the relative x/y motion.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit d7b1753d446ecde3ff58e3de39a634c3137473c8)

commit 5bc29a67b8ab251048e0737eedcceb29bba25f5f
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Fri Mar 8 18:19:16 2019 +0100

    glamor: pixmap FBO may not be allocated
    
    If `_glamor_create_tex()` fails to allocate the FBO because of
    GL_OUT_OF_MEMORY error, the `pixmap_priv->fbo` is NULL.
    
    However, `glamor_get_pixmap_texture()` doesn't actually check whether
    the `pixmap_priv->fbo` is NULL and will segfault with a NULL pointer
    dereference trying to access the `pixmap_priv->fbo->tex`.
    
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/647
    (Cherry picked from commit 74479a99ecf18fdfdafd033b5efd8d785dd12c28)

commit d0c7483b3edadf3ff9c12b4b024abd7b11b34ef1
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Apr 5 12:39:00 2019 +0200

    xwayland: fix a realloc OOM error case
    
    Found by coverity
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (Cherry picked from commit 7c25439f0db4c20a4eab4ed44262eb396305f58a)

commit bb74db6b38f7ff75ed52a900fa62a995e77aede4
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Fri Apr 5 12:33:28 2019 +0200

    xwayland: search for a render node to use
    
    wl_drm's protocol "device" event provides the path to the DRM device,
    which may not be a render node, thus causing Xwayland to fall back to
    DRM authentication which may fail if the user has switched to another
    VT while Xwayland is starting.
    
    Search for a render node corresponding to the given DRM device and try
    to use it instead, as render nodes do not need DRM authentication and
    Xwayland can make use of them if it can find one.
    
    Closes: https://bugs.freedesktop.org/108038
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    (Cherry picked from commit 361894497c6802b62c2da4a3dc7e98939fb24404)

commit 87491ced98705a14be2bb5a3ce7e41cb5ffc11d0
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Mon Mar 25 12:32:48 2019 +0100

    present/scmd: Check that the flip and screen pixmap pitches match
    
    If they don't, flipping will result in corrupted display.
    
    Test case:
    
    * Run Xorg at 1920x1080 with no window manager
    * glxgears -geometry 2048x1080
    (Cherry picked from commit ef91da2757050652c724f6e674e8b1acf5d0cb31)

commit 578156337176bf759dace40fb5a81919f65562f1
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Mon Mar 25 12:32:04 2019 +0100

    xwayland/present: Destroy sync_callback in xwl_present_cleanup
    
    xwl_present_cleanup frees the struct xwl_present_window memory,
    so if there's a pending callback, we have to destroy it to prevent
    use-after-free in xwl_present_sync_callback.
    
    Should fix issue #645.
    
    Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
    (Cherry picked from commit 2e18eec6f03cc4d9d5bf62853c65d341b363f4b3)

commit 8e2f5410cec5b052fb4da9d1b774a5858903dc35
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Mon Mar 25 12:29:23 2019 +0100

    Revert "gitlab-ci: Only run docker-image stage if relevant source files change"
    
    This reverts commit 8694395fcfd407190db74f31064960e484747377.
    
    Some scenarios have come to light where this failed to ensure the docker
    image exists:
    
    * If the master branch of a forked repository is used for an MR which
      doesn't modify .gitlab-ci.yml, the docker-image job may not run.
    * If the docker-image job of the first pipeline in a forked repository
      is cancelled or fails for any reason, and .gitlab-ci.yml isn't
      modified for the next pipeline run.
    (Cherry picked from commit 0ec9a13c2a207e98e2dd6b352552c0e069af0727)

commit 34553f502650641aec4f20ab43180804f17032c6
Author: Ray Strode <rstrode@redhat.com>
Date:   Fri Nov 16 14:36:55 2018 -0500

    dix: ensure work queues are cleared on reset
    
    If the server resets, most client workqueues are cleaned up as the
    clients are killed.
    
    The one exception is the server's client, which is exempt from
    the killing spree.
    
    If that client has a queued work procedure active, it won't get
    cleared on reset.
    
    This commit ensures it gets cleared too.
    
    (cherry picked from commit 8738ce85df535bdfdfecfce1c0d64e209cc6e508)
    
    Fixes: xorg/xserver#670

commit 94f036d412f4f426abe950b57b9ec99b78068c39
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Feb 25 13:31:13 2019 -0500

    xserver 1.20.4
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

commit 9850d20c2aa2d8380f2e9c4521ef3c46a6c8fb00
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 10:22:49 2019 +0100

    gitlab-ci: Run make distcheck in autotools build & test job
    
    We don't set the PIGLIT_DIR and XTS_DIR environment variables for make
    distcheck for now, otherwise it complains about files left behind by
    piglit.
    
    (cherry picked from commit 432fad04e7aaad1f10d732a51665ecbe934246c6)

commit fcac9b10c90c8a06c60f563f5ad8da1d4e49b7fc
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 10:21:27 2019 +0100

    glx,xquartz: Fix make distcheck
    
    Guard BUILT_SOURCES and CLEANFILES by XWIN_GLX_WINDOWS/XQUARTZ.
    
    (cherry picked from commit f9bbc9d5ead5cf298f0e3e0b7ac5229af830f6e7)

commit 01a03a476a5f963846fdb7702217be17ac1ecd6c
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 11:16:36 2019 +0100

    present/wnmd: Allow flipping if the window pixmap matches the toplevel's
    
    Instead of testing window->redirectDraw.
    
    With Xwayland, the toplevel window is always redirected, so this would
    unnecessarily preclude flipping there in some cases, e.g. with wlroots
    based Wayland compositors or with fullscreen X11 windows in weston.
    
    Fixes issue #631.
    (Cherry picked from commit a093a88531599832811a1ba5cb85101af91a545e)

commit e5984241ab8d7ca75eb3e5e893d63adb017ed0f5
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 11:56:23 2019 +0100

    gitlab-ci: Add autotools build & test job
    (Cherry picked from commit 2f12c8017508f23195db92503435fc3ef183da4b)

commit de6d87b61959cd3997feed3efe25fb2a36e543fb
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 11:56:01 2019 +0100

    gitlab-ci: Use ccache
    
    Meson picks it up automatically.
    
    Based on:
    
    * https://gitlab.freedesktop.org/mesa/mesa/merge_requests/240
    * https://gould.cx/ted/blog/2017/06/10/ccache-for-Gitlab-CI/
    * https://stackoverflow.com/questions/53659419/ccache-no-hits-in-gitlab-ci
    
    v2 based on the corresponding Mesa change:
    * Quote CCACHE_(BASE)DIR environment variables.
    * Clear ccache stats in before_script.
    * Move cache stanza to the build-and-test job, the cache isn't used in
      the docker-image job.
    
    Reviewed-by: Adam Jackson <ajax@redhat.com> # v1
    (Cherry picked from commit b577df77451d34e28cfef3bda5031a43caeba90a)

commit 37ad8dd978e8d35233e489e771f7dcf3e09c3b7a
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 11:55:31 2019 +0100

    gitlab-ci: Add ccache to docker image, and leave in autotools
    
    We're going to make use of these in build & test jobs.
    (Cherry picked from commit 537f06e21ee2c4c88ee062c26555338257e043ef)

commit 61eccbcec930efeb1a124cc8edff70e6f65c927e
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 11:54:57 2019 +0100

    gitlab-ci: Don't rely on $CI_PROJECT_NAME
    
    The name of a forked repository can be changed later, in which case this
    would fail to refer to the main repository.
    
    Pointed out by Eric Engestrom in
    https://gitlab.freedesktop.org/mesa/mesa/merge_requests/224 .
    (Cherry picked from commit fede384962edd175b1a2ce6edd8d2ef9b0fd74f0)

commit e10cfd8fcc395360ce9acd93bfd7503da8e35381
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 11:54:41 2019 +0100

    gitlab-ci: Only run docker-image stage if relevant source files change
    
    Otherwise there's normally no need to run it. It will also run when a
    new branch is created, which ensures that the docker image always exists
    (e.g. in a newly forked repository).
    
    Inspired by https://gitlab.freedesktop.org/mesa/mesa/merge_requests/143
    (Cherry picked from commit 8694395fcfd407190db74f31064960e484747377)

commit 7246730edfb4f9079eb0ef1c41c43c47854a7432
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 11:53:55 2019 +0100

    gitlab-ci: Set LC_ALL=C.UTF-8
    
    Although piglit could now handle non-ASCII characters in the
    environment, meson was still failing without this (even though it's
    using Python 3).
    
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (Cherry picked from commit bc6998b728749015bfd93a85fbae48af777c9a34)

commit 8db5a711da6a0b8f28c885b968b1e6bf2d45ce62
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 11:53:37 2019 +0100

    test: Use .../piglit instead of .../piglit-*.py
    
    The latter use Python 2 and break with any non-ASCII characters in the
    environment, the former uses Python 3 and works fine in that case.
    
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (Cherry picked from commit 4aaaf69229be574d6d11084225ecd91446a15170)

commit 3314af2d15085118f2ca0d4ce65ae6ec1f38fbad
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 11:53:12 2019 +0100

    gitlab-ci: Docker image can be generated as part of pipeline
    
    This removes the dependency on an externally generated docker image, and
    should make it easier to update the docker image or make other changes
    related to it.
    
    This is based on Debian testing, because I'm most familiar with Debian.
    But it should be easy to base it on another distro.
    
    v2:
    * Use kaniko instead of docker-in-docker for image generation, so it can
      also work in unprivileged runners.
    * Drop piglit.conf & tetexec.cfg overrides, just make sure the files in
      the image work.
    (Cherry picked from commit f56d8e2282a3d1344aa1300c78faede0071a3bfa)

commit e8b4e94d5192f72be3f768ac11a5e27890e6bc8d
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Feb 22 11:52:42 2019 +0100

    Drop Travis Linux build in favour of GitLab CI
    
    Fold build-travis-deps.sh into .gitlab-ci.yml.
    
    Preparation for the next change, which would break the Travis Linux
    build.
    
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (Cherry picked from commit ed44f9cd6a4ccf6de7dda70432764b4da10f3f44)

commit 4925f38dc0559a8cbe01ec947edeb5eeb78a4df6
Author: Michel Daenzer <michel@daenzer.net>
Date:   Fri Feb 22 11:51:57 2019 +0100

    Make artifacts of piglit results if job fails
    
    Can be useful for figuring out what caused the failure.
    (Cherry picked from commit a7472da94136ef977b8d6af956a15767736236ea)

commit b6ef90d83b4fd9230ca334116c61fd52f1d68209
Author: Michel Daenzer <michel@daenzer.net>
Date:   Fri Feb 22 11:51:35 2019 +0100

    travis: Use a single meson invocation
    
    The prefix setting didn't take for some reason.
    (Cherry picked from commit c1bb392b1df4023e9dec489facfa221a53499ddc)

commit 7753fd9989e280783daeee1994d019155735dee5
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Feb 22 11:50:05 2019 +0100

    gitlab: Skip the docker-in-docker step
    
    No idea which cult's cargo I was looking at there. Cuts about a minute
    off the build time.
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>
    (Cherry picked from commit a41ccaa0857146e986f11360d4f2aeb3913af9a6)

commit 524104e15c7169114e4fa3dd832990c58ee563a4
Author: Peter Hutterer <peter.hutterer@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@amd.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit 678d64aa2e929368b6d6f2b83bbf5540c4fa292d)

commit ae9dda1e2620f402b434f10df581b0fdf0495ee8
Author: Peter Harris <pharris@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@opentext.com>
    (cherry picked from commit 937a5b78a2f6ea771132ff0f9ece708a23c1bdad)

commit 013c28a122a61beaf3a4ee7cc92b7ca2c92de7ab
Author: A. Wilcox <AWilcox@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)

commit a51d7a730cfd82ab44ea5510eafdbe9d7043e706
Author: Adam Jackson <ajax@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@redhat.com>
    (cherry picked from commit 709c6562975c3bea10dd0571527a4aac79a6bf6f)

commit 544d0e961cfa96043ed3e5a718a768444c4a4c4d
Author: Adam Jackson <ajax@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@redhat.com>
    (cherry picked from commit bf991a5f989c5e6e726a3731f468b7b7d65d9f4a)

commit 2215e8c7cf06f46f9995c8a7817c7ede9774a551
Author: Adam Jackson <ajax@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)

commit 59e0b5f041eee92d0a51303082005ad8f053d8ca
Author: Michel Dänzer <michel.daenzer@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)

commit 712d0e86aaee96ffe1ad6a708b9134889e47d1c6
Author: Maya Rashish <maya@NetBSD.org>
Date:   Thu Jan 10 14:55:17 2019 +0200

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

commit ff1d1692e73b1729a6ced84bf58bcbe17f1c9d94
Author: Maya Rashish <maya@NetBSD.org>
Date:   Thu Jan 10 18:39:33 2019 +0200

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

commit c091ea5e38b5c41eaf3b10c43dc043401e8251c5
Author: Alan Coopersmith <alan.coopersmith@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@oracle.com>
    (cherry picked from commit 7fb6338c68e158053295cb448faa5c559aa9990c)

commit 7b0f6102df3b18a048b791fe2304679b1eb2c9e7
Author: Michel Dänzer <michel.daenzer@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@anholt.net>
    (cherry picked from commit 7e6faa5b3c05e0b7149ee840403885b0b40b5827)

commit 356cf07b8a8fe6faedf701ae259f8f077a234dd5
Author: Peter Hutterer <peter.hutterer@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@who-t.net>
    Tested-by: Michel Dänzer michel.daenzer@amd.com
    (cherry picked from commit fde27b9b4814b18aca6ec587bd3cfe9ab04b0c72)

commit c44eee243e6f4e488b586ad02e4fd00f587ebb49
Author: Ilia Mirkin <imirkin@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@alum.mit.edu>
    Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
    (cherry picked from commit 48b1af2718ab81c66f565438553415c05f1faa5c)

commit 10609630e753b475566be27b186af4b2e290fdc6
Author: Adam Jackson <ajax@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)

commit f5a77233b983eb06eb727d25148b68d1bc410022
Author: Lionel Landwerlin <lionel.g.landwerlin@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@intel.com>
    (cherry picked from commit a425eee6dce3b0cfd18b591907e8302a91b648c6)

commit 4e12cba65682e97b056d8a8207189d4cf9c31862
Author: Lyude Paul <lyude@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@redhat.com>
    (cherry picked from commit 7a44e8d4007b9c3ca55a5cc3f5e98601565311c7)

commit 652918e736bcc577e221184415dcf61c05ac7bfb
Author: Alan Coopersmith <alan.coopersmith@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@oracle.com>
    (cherry picked from commit 17a22ad948009badbc79bbcd9a067004c98f5744)

commit 40b22a0571d422473a7a324daa65f6a768181644
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sun Nov 18 15:49:27 2018 -0800

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

commit a352f979545723054b0a74862a56dc53b1be93fb
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Tue Jan 8 12:48:53 2019 +0100

    xwayland: handle case without any crtc
    
    Xwayland creates and destroys the CRTC along with the Wayland outputs,
    so there is possibly a case where the number of CRTC drops to 0.
    
    However, `xwl_present_get_crtc()` always return `crtcs[0]` which is
    invalid when `numCrtcs` is 0.
    
    That leads to crash if a client queries the Present capabilities when
    there is no CRTC, the backtrace looks like:
    
      #0  raise() from libc.so
      #1  abort() from libc.so
      #2  OsAbort() at utils.c:1350
      #3  AbortServer() at log.c:879
      #4  FatalError() at log.c:1017
      #5  OsSigHandler() at osinit.c:156
      #6  OsSigHandler() at osinit.c:110
      #7  <signal handler called>
      #8  main_arena() from libc.so
      #9  proc_present_query_capabilities() at present_request.c:236
      #10 Dispatch() at dispatch.c:478
      #11 dix_main() at main.c:276
    
    To avoid returning an invalid pointer (`crtcs[0]`) in that case, simply
    check for `numCrtcs` being 0 and return `NULL` in that case.
    
    Thanks to Michel Dänzer <michel.daenzer@amd.com> for pointing this as a
    possible cause of the crash.
    
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    Bugzilla: https://bugzilla.redhat.com/1609181
    (cherry picked from commit e8295c50209f2963fa2823e8de7e8363a38cd2d1)

commit 210cd529064348de7d4f9a9050b0cf68f8fd326c
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Nov 15 17:16:59 2018 +0100

    xwayland: Don't take buffer release queue into account for frame timer
    
    The buffer release queue has two kinds of entries:
    
    * Pending async flips.
    * Completed flips waiting for their buffer to be released by the Wayland
      compositor.
    
    xwl_present_timer_callback neither completes async flips nor releases
    buffers, so the timer isn't needed for the buffer release queue.
    
    (cherry picked from commit e6cd1c9bdefe83e7d99b703a68d26eebb451f889)

commit 7c28b0e34ecbe9842193733dfd86097c06921406
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Nov 9 17:18:53 2018 +0100

    xwayland: Don't need xwl_window anymore in xwl_present_queue_vblank
    
    Fixes issue #12. Presumably the problem was that Present operations on
    unmapped windows were executed immediately instead of only when reaching
    the target MSC.
    
    (cherry picked from commit f541615342ce6bfb0e6d4e68deb3a924a87e8ba9)

commit 46135957095ec954e21107d1001452e9533ef2ee
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Nov 1 18:24:28 2018 +0100

    xwayland: Add xwl_present_unrealize_window
    
    When a window is unrealized, a pending frame callback may never be
    called, which could result in repeatedly freezing until the frame timer
    fires after a second.
    
    Fixes these symptoms when switching from fullscreen to windowed mode in
    sauerbraten.
    
    (cherry picked from commit 8c9538573cb9a342897eb3fb4b0c1e4ed917bd0e)

commit 98f41563e6599eb762e6a3ec12f99ba6b5388039
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Nov 1 18:44:24 2018 +0100

    xwayland: Replace xwl_window::present_window with ::present_flipped
    
    There's no need to keep track of the window which last performed a
    Present flip. This fixes crashes due to the assertion in
    xwl_present_flips_stop failing. Fixes issue #10.
    
    The damage generated by a flip only needs to be ignored once, then
    xwl_window::present_flipped can be cleared. This may fix freezing in
    the (hypothetical) scenario where Present flips are performed on a
    window, followed by other drawing requests using the window as the
    destination, but nothing triggering xwl_present_flips_stop. The damage
    from the latter drawing requests would continue being ignored.
    
    (cherry picked from commit 6b016d58d23d16eaae9908a92ed90547d1926317)

commit f393801dbbe89bce716a8ceeb2b5c8440b9021ce
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Oct 18 17:42:01 2018 +0200

    xwayland: Complete "synchronous" Present flips from xwl_present_msc_bump
    
    Completing them from xwl_present_sync_callback had at least two issues:
    
    * It was before the MSC was incremented in xwl_present_frame_callback,
      so the MSC value in the completion event could be lower than the
      target specified by the client. This could cause hangs with the Mesa
      Vulkan drivers.
    * It allowed clients to run at a frame-rate higher than the Wayland
      compositor's frame-rate, wasting energy on generating frames which
      were never displayed. This isn't expected to happen unless the client
      specified PresentOptionAsync (in which case flips are still completed
      from xwl_present_sync_callback, allowing higher frame-rates).
    
    v2:
    * Make xwl_present_has_events return true when there's a pending
      "synchronous" flip, so those complete after at most ~1 second even if
      the Wayland server doesn't send a frame event.
    
    Bugzilla: https://bugs.freedesktop.org/106713
    (cherry picked from commit ace551d8a2603e37b18237a52f62d627c75d9e2a)

commit e646e3054a3e1dbe8ff3906a546897246bcc78f0
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Oct 18 17:36:24 2018 +0200

    xwayland: Rename xwl_present_events_notify to xwl_present_msc_bump
    
    And consolidate more code from xwl_present_timer_callback and
    xwl_present_frame_callback in it.
    
    (cherry picked from commit 2bfc46d4147dc0bec4cdbb80431a0f4cc1d3b030)

commit 47aed554b7c12c0c7f496c86a435dddaa51ae9bf
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Wed Oct 24 11:23:05 2018 +0200

    xwayland: Use xwl_present_reset_timer in xwl_present_timer_callback
    
    Apart from simplifying the code, this should also prevent a condition
    (which might only be possible with the following fix) reported in
    https://gitlab.freedesktop.org/wayland/weston/issues/115#note_52467:
    
    1. xwl_present_timer_callback indirectly calls xwl_present_reset_timer
       -> xwl_present_free_timer
    2. xwl_present_timer_callback then returns a non-0 value, so DoTimer
       calls TimerSet with the old xwl_present_window->frame_timer pointer
       which was freed in step 1 => use after free
    
    Calling xwl_present_reset_timer explicitly passes NULL to TimerSet if
    step 1 freed xwl_present_window->frame_timer, and it will allocate a new
    one.
    
    (cherry picked from commit 5e8b9a3a563047e3998d45e761f7a50e4b0f6cb3)

commit cf8e064ec0bed45b8cda9ae390c7af78d8ede50f
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Fri Oct 19 16:04:32 2018 +0200

    xwayland: do not crash if `gbm_bo_create()` fails
    
    The function `xwl_glamor_gbm_create_pixmap()` first creates a buffer
    objects and then creates the xwl_pixmap from it.
    
    However, `xwl_glamor_gbm_create_pixmap_for_bo()` is not called if the
    buffer object creation fails, and `xwl_glamor_gbm_create_pixmap()`
    simply returns `glamor_create_pixmap()`.
    
    The problem with this is that if `xwl_glamor_gbm_create_pixmap_for_bo()`
    is not called then neither is `xwl_pixmap_set_private()` and further
    calls to `xwl_pixmap_get()` will return NULL and cause a NULL pointer
    dereference if the return value is not checked:
    
      #0  xwl_glamor_gbm_get_wl_buffer_for_pixmap ()
          at hw/xwayland/xwayland-glamor-gbm.c:248
      #1  xwl_window_post_damage () at hw/xwayland/xwayland.c:697
      #2  xwl_display_post_damage () at hw/xwayland/xwayland.c:759
      #3  block_handler () at hw/xwayland/xwayland.c:890
      #4  BlockHandler () at dix/dixutils.c:388
      #5  WaitForSomething () at os/WaitFor.c:201
      #6  Dispatch () at dix/dispatch.c:421
      #7  dix_main () at dix/main.c:276
      #8  __libc_start_main () at ../csu/libc-start.c:308
      #9  _start ()
    
      (gdb) print xwl_pixmap
      $1 = (struct xwl_pixmap *) 0x0
    
    Make sure we check for `xwl_pixmap_get()` returned value where relevant
    and fail gracefully if this is the case.
    
    See also: https://gitlab.gnome.org/GNOME/mutter/issues/340
    
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: Marco Trevisan <mail@3v1n0.net>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 036794bebce72a3fa2f95996d2e537ff568e0ff1)

commit f89518e17f7d507734af212785e0b3e47954f603
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Mon Oct 22 11:48:25 2018 +0200

    present/wnmd: Fix use after free on CRTC removal
    
    Xwayland will add and remove CRTCs as Wayland outputs are added or
    removed.
    
    If there is a pending flip when this occurs, the
    `xwl_present_sync_callback()` will be triggered after the Xwayland
    output's RRCtrcPtr has been destroyed, hence causing a crash in Xwayland
    while trying to use freed memory:
    
      #1  abort ()
      #2  OsAbort () at utils.c:1350
      #3  AbortServer () at log.c:877
      #4  FatalError () at log.c:1015
      #5  OsSigHandler () at osinit.c:156
      #6  <signal handler called>
      #7  dixGetPrivate () at ../include/privates.h:122
      #8  dixLookupPrivate () at ../include/privates.h:166
      #9  present_screen_priv () at present_priv.h:198
      #10 present_wnmd_flip () at present_wnmd.c:358
      #11 present_wnmd_execute () at present_wnmd.c:466
      #12 present_wnmd_re_execute () at present_wnmd.c:80
      #13 xwl_present_sync_callback () at xwayland-present.c:287
      #14 ffi_call_unix64 () from /lib64/libffi.so.6
      #15 ffi_call () from /lib64/libffi.so.6
      #16 wl_closure_invoke () at src/connection.c:1006
      #17 dispatch_event () at src/wayland-client.c:1427
      #18 dispatch_queue () at src/wayland-client.c:1573
      #19 wl_display_dispatch_queue_pending () at src/wayland-client.c:1815
      #20 wl_display_dispatch_pending () at src/wayland-client.c:1878
      #21 xwl_read_events () at xwayland.c:814
      #22 ospoll_wait () at ospoll.c:651
      #23 WaitForSomething () at WaitFor.c:208
      #24 Dispatch () at ../include/list.h:220
      #25 dix_main () at main.c:276
    
    To avoid the issue, get the `ScreenPtr` from the window instead of the
    CRTC that might have been just freed, `xwl_present_flip()` has no use
    for the CRTC anyway.
    
    Bugzilla: https://bugs.freedesktop.org/108249
    Suggested-by: Michel Daenzer <michel.daenzer@amd.com>
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: Michel Daenzer <michel.daenzer@amd.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit b768b7d6cec41b8b320c468ec41aab5a8b49b27b)

commit 64f5e6ec2d297f90e9b9785a1cb7285d609a1877
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Oct 19 18:27:37 2018 +0200

    xwayland: Plug leaks in xwl_present_sync_callback
    
    xwl_present_window->sync_callback was leaked.
    
    The event memory was leaked if the corresponding buffer had already been
    released.
    
    (cherry picked from commit cb0de153bf0c486da7e968ab0f258c9c0c9ed34a)

commit 971d418113740cae2d7d393850bad4926d1a7e86
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Oct 25 09:03:18 2018 -0400

    xserver 1.20.3
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

commit da15c7413916f754708c62c2089265528cd661e2
Author: Matthieu Herrb <matthieu@herrb.eu>
Date:   Tue Oct 23 21:29:09 2018 +0200

    LogFilePrep: add a comment to the unsafe format string.
    
    CVE-2018-14665 also made it possible to exploit this to access
    memory. With -logfile forbidden when running with elevated privileges
    this is no longer an issue.
    
    Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit 248d164eae27f1f310266d78e52f13f64362f81e)

commit 8a59e3b7dbb30532a7c3769c555e00d7c4301170
Author: Matthieu Herrb <matthieu@herrb.eu>
Date:   Tue Oct 23 21:29:08 2018 +0200

    Disable -logfile and -modulepath when running with elevated privileges
    
    Could cause privilege elevation and/or arbitrary files overwrite, when
    the X server is running with elevated privileges (ie when Xorg is
    installed with the setuid bit set and started by a non-root user).
    
    CVE-2018-14665
    
    Issue reported by Narendra Shinde and Red Hat.
    
    Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit 50c0cf885a6e91c0ea71fb49fa8f1b7c86fe330e)

commit cfc3dec09e1a56bb050ba31bde0bbf499596063a
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Oct 16 09:42:51 2018 +1000

    xfree86: fix readlink call
    
    Misplaced parenthesis caused us to compare the sizeof, not the readlink return
    value.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit bd5fe7593fd0df236f3b2be1f062166ddba7d67c)

commit 2a0c6c15c35cd262e7cdb86dcc43cb1aeb714c8e
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Oct 15 11:17:35 2018 -0400

    xserver 1.20.2
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>

commit f5dc787fc9bb102e4eea477d1817e35370084ea2
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Oct 10 14:09:11 2018 -0400

    fbdevhw: Refuse to touch PCI devices on the fallback probe path
    
    Fixes: https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/issues/9
    Signed-off-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit fc78bcca21e767697de6ad4d8e03b6728856f613)

commit 4795c069a503144ea31f01de0c039f32d9880292
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Oct 5 14:50:20 2018 -0400

    glamor/egl: Avoid crashing on broken configurations
    
    0a9415cf apparently can tickle bugs in the GL stack where glGetString
    returns NULL, presumably because the eglMakeCurrent() didn't manage to
    actually install a dispatch table and you're hitting a stub function.
    That's clearly not our bug, but if it happens we should at least not
    crash. Notice this case and fail gently.
    
    Signed-off-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit af151895f3cb1755a7a5631f2398a3d3b219cbef)

commit 1e3c5d614ee33d9eac1d2cf6366feeb8341fc0f4
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Sep 14 11:33:43 2018 -0400

    glamor_egl: Don't initialize on llvmpipe
    
    Mesa started supporting GL_OES_EGL_image on llvmpipe in 17.3, after this
    commit:
    
        commit bbdeddd5fd0b797e1e281f058338b3da4d98029d
        Author: Gurchetan Singh <gurchetansingh@chromium.org>
        Date:   Tue Aug 1 14:49:33 2017 -0700
    
            st/dri: add drisw image extension
    
    That's pretty cool, but it means glamor now thinks it can initialize on
    llvmpipe. This is almost certainly not what anyone wants, as glamor on
    llvmpipe is pretty much uniformly slower than fb.
    
    This fixes both Xorg and Xwayland to refuse glamor in such a setup.
    Xephyr is left alone, both because glamor is not the default there and
    because Xephyr+glamor+llvmpipe is one of the easier ways to get xts to
    exercise glamor.
    
    The (very small) downside of this change is that you lose DRI3 support.
    This wouldn't have helped you very much (since an lp glamor blit is
    slower than a pixman blit), but it would eliminate the PutImage overhead
    for llvmpipe's glXSwapBuffers. A future change should add DRI3 support
    for the fb-only case.
    
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Signed-off-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit 0a9415cf793babed1f28c61f8047d51de04f1528)

commit b58aa8ed9b0a052d615d34b103aa54ce357df12e
Author: Alexander Volkov <a.volkov@rusbitech.ru>
Date:   Mon Feb 26 19:41:18 2018 +0300

    os/xdmcp: Don't create a new socket in XdmcpReset()
    
    xdmcpSocket survives during the reset, there is no
    need to create a new one.
    
    This commit restores logic that was broken by
    49c0f2413d32fdfe36e45861fcb32aaeab633094 in Xorg 1.19.
    
