commit 489f4191f3c881c6c8acce97ec612167a4ae0f33
Author: Matt Turner <mattst88@gmail.com>
Date:   Mon Jan 13 14:47:48 2020 -0800

    xserver 1.20.7
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

commit 279789183ed377127073955d21d44ee3b01ac763
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Mon Sep 23 15:12:01 2019 -0700

    ospoll: Fix Solaris ports implementation to build on Solaris 11.4
    
    Wrong version got committed, but wasn't noticed since it only builds
    with meson, not autoconf.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    (cherry picked from commit 0e8c0d2f238e5d50daaf4672bd80ad519673b5e3)

commit cc503031c32496efb28ed81d32a547ded46a0815
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Thu Feb 21 15:38:07 2019 -0800

    os-support/solaris: Set IOPL for input thread too
    
    Since the Solaris kernel tracks IOPL per thread, and doesn't inherit
    raised IOPL levels when creating a new thread, we need to turn it on
    in the input thread for input drivers like vmmouse that need register
    access to work correctly.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    (cherry picked from commit 12769c516d9356bd92f90e2f53a4853dbfdc4aed)

commit f778e76eb4bc6b9219a8b1a903a2fb1a30c2c92a
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Thu Feb 21 15:35:38 2019 -0800

    Add xf86OSInputThreadInit call from common layer into os-support layer
    
    Allows os backends to run additional code as necessary to set up the
    input thread.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    (cherry picked from commit ea1527a8a662dcc5ac3ed49135740aa5f24f74bc)

commit e3f26605d85d987da434640f52646d728f1fe919
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Thu Feb 21 15:22:57 2019 -0800

    Add ddxInputThread call from os layer into ddx layer
    
    Allows ddx's to run additional code as necessary to set up the
    input thread.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    (cherry picked from commit 4ad21c3247d98ac6c5ad71fa36be60ed04f7c92c)

commit bb405cdc85b6e31c0beef60a07a2cfe5b87dcde6
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Thu Feb 21 14:51:22 2019 -0800

    os-support/solaris: Drop ExtendedEnabled global variable
    
    Keeping track of kernel state in user space doesn't buy us anything,
    and introduces bugs, as we were keeping global state but the Solaris
    kernel tracks IOPL per thread.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    (cherry picked from commit 7533fa9bd5a4a0f7743d553be186514d684308c8)

commit 977f3acfceb91f1dd10c8bf84b9d7515b2a59457
Author: Michel Dänzer <mdaenzer@redhat.com>
Date:   Fri Dec 20 15:51:00 2019 +0100

    glamor: Only use dual blending with GLSL >= 1.30
    
    It can't be used with older GLSL. Fixes a crash when attempting to
    anyway.
    
    Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/97
    Fixes: e7308b6c7756 "glamor: Add support for CA rendering in a single pass."
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    (Cherry picked from commit 5bfca0038e92d61e58d4dc1a54748faef8273023)

commit cfc5e5040c93486323165196550dbe18aec46402
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Thu Dec 26 13:40:17 2019 -0800

    modesetting: Check whether RandR was initialized before calling rrGetScrPriv
    
    Calling rrGetScrPriv when RandR isn't initialized causes an assertion
    failure that aborts the server:
    
     Xorg: ../include/privates.h:121: dixGetPrivateAddr: Assertion `key->initialized' failed.
    
     Thread 1 "Xorg" received signal SIGABRT, Aborted.
     0x00007ffff78a8f25 in raise () from /usr/lib/libc.so.6
     (gdb) bt
     #0  0x00007ffff78a8f25 in raise () from /usr/lib/libc.so.6
     #1  0x00007ffff7892897 in abort () from /usr/lib/libc.so.6
     #2  0x00007ffff7892767 in __assert_fail_base.cold () from /usr/lib/libc.so.6
     #3  0x00007ffff78a1526 in __assert_fail () from /usr/lib/libc.so.6
     #4  0x00007ffff7fb57c1 in dixGetPrivateAddr (privates=0x555555ab1b60, key=0x555555855720 <rrPrivKeyRec>) at ../include/privates.h:121
     #5  0x00007ffff7fb5822 in dixGetPrivate (privates=0x555555ab1b60, key=0x555555855720 <rrPrivKeyRec>) at ../include/privates.h:136
     #6  0x00007ffff7fb586a in dixLookupPrivate (privates=0x555555ab1b60, key=0x555555855720 <rrPrivKeyRec>) at ../include/privates.h:166
     #7  0x00007ffff7fb8445 in CreateScreenResources (pScreen=0x555555ab1790) at ../hw/xfree86/drivers/modesetting/driver.c:1335
     #8  0x000055555576c5e4 in xf86CrtcCreateScreenResources (screen=0x555555ab1790) at ../hw/xfree86/modes/xf86Crtc.c:744
     #9  0x00005555555d8bb6 in dix_main (argc=4, argv=0x7fffffffead8, envp=0x7fffffffeb00) at ../dix/main.c:214
     #10 0x00005555557a4f0b in main (argc=4, argv=0x7fffffffead8, envp=0x7fffffffeb00) at ../dix/stubmain.c:34
    
    This can happen, for example, if the server is configured with Xinerama
    and there is more than one X screen:
    
     Section "ServerLayout"
       Identifier "crash"
       Screen 0 "modesetting"
       Screen 1 "dummy" RightOf "modesetting"
       Option "Xinerama"
     EndSection
    
     Section "Device"
       Identifier "modesetting"
       Driver "modesetting"
     EndSection
    
     Section "Screen"
       Identifier "modesetting"
       Device "modesetting"
     EndSection
    
     Section "Device"
       Identifier "dummy"
       Driver "dummy"
     EndSection
    
     Section "Screen"
       Identifier "dummy"
       Device "dummy"
     EndSection
    
    The problem does not reproduce if there is only one X screen because of
    this code in xf86RandR12Init:
    
     #ifdef PANORAMIX
         /* XXX disable RandR when using Xinerama */
         if (!noPanoramiXExtension) {
             if (xf86NumScreens == 1)
                 noPanoramiXExtension = TRUE;
             else
                 return TRUE;
         }
     #endif
    
    Fix the problem by checking dixPrivateKeyRegistered(rrPrivKey) before
    calling rrGetScrPriv. This is similar to what the xf86-video-amdgpu
    driver does:
    https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/blob/fd66f5c0bea2b7c22a47bfd5eb1f22d32d166d9c/src/amdgpu_kms.c#L388
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
    (cherry picked from commit 4226c6d0329df440551b7b91ae573a82c64a1ac9)

commit fb2540648a293def46bf0afa183e0884fa4496be
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed May 29 16:19:55 2019 +1000

    Xi: return AlreadyGrabbed for key grabs > 255
    
    We can't have high keycodes because everything in XKB relies on 8 bits. XI2's
    API allows for 32-bit keycodes so we have to take those but nothing in the
    server is really ready for this. The effect of this right now is that any high
    keycode grab is clipped to 255 and thus ends up grabbing a different key
    instead.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1697804
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit f4cdbf640b6440df4af784ca35e1b1340965cc10)

commit 87ca1bdf6935c4b11b41ca071f1f4b8d8347fee9
Author: Michel Dänzer <mdaenzer@redhat.com>
Date:   Tue Dec 3 18:39:40 2019 +0100

    xwayland: Do flush GPU work in xwl_present_flush
    
    The Present code sends the idle notification event to the client after
    xwl_present_flush returns. If we don't flush our GPU work here, the
    client may race to draw another frame to the same buffer, so we may end
    up copying (parts of) that new frame instead of the one we meant to.
    
    Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/835
    
    Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
    (Cherry picked from commit 2a2234ad1a0fe88400c1511fea67741e4ad09f7f)
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

commit 8aad09dd79f0504715edac56e21439809a5d529e
Author: Michel Dänzer <mdaenzer@redhat.com>
Date:   Tue Nov 26 17:17:12 2019 +0100

    modesetting: Clear new screen pixmap storage on RandR resize
    
    Fixes random garbage being visible intermittently.
    
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (Cherry picked from commit 9ba13bac9dd076f166ff0d063fc144b904a40d12)
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

commit 094f42cdfe5d4c0b8e329445c529ee1e59278999
Author: Michel Dänzer <mdaenzer@redhat.com>
Date:   Tue Nov 26 17:16:37 2019 +0100

    xfree86/modes: Call xf86RotateRedisplay from xf86CrtcRotate
    
    If a new rotate buffer was allocated. This makes sure the new buffer
    has valid transformed contents when it starts being displayed.
    
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (Cherry picked from commit 327df450ffcf5bda5b4254db0208d355860d1010)
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

commit b50175fe867ae067888049318264824524c0616a
Author: Michel Dänzer <mdaenzer@redhat.com>
Date:   Tue Nov 26 17:14:46 2019 +0100

    modesetting: Call glamor_finish from drmmode_crtc_set_mode
    
    This makes sure any pending drawing to a new scanout buffer will be
    visible from the start.
    
    This makes the finish call in drmmode_copy_fb superfluous, so remove it.
    
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (Cherry picked from commit c66c548eabf06835cb0cb906598fb87c7bb30cf4)
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

commit 255d8c3c36a9d52b3acc5e016efa0ef0f2371f79
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Thu Nov 21 23:03:50 2019 -0800

    modesetting: Use EGL_MESA_query_driver to select DRI driver if possible
    
    We now ask Glamor to use EGL_MESA_query_driver to obtain the DRI driver
    name; if successful, we use that as the DRI driver name.  Following the
    existing dri2.c logic, we also use the same name for the VDPAU driver,
    except for i965 (and now iris), where we switch to the "va_gl" fallback.
    
    This allows us to bypass the PCI ID lists in xserver and centralize the
    driver selection mechanism inside Mesa.  The hope is that we no longer
    have to update these lists for any future hardware.
    
    (backported from commit 8d4be7f6c4f7c673d7ec1a6bfdef944907a3916e)
    
    Acked-by: Michel Dänzer <mdaenzer@redhat.com>

commit 2a1a96d956f4023796737d26a32354e940c8e6cf
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Thu Nov 21 23:01:28 2019 -0800

    glamor: Add a function to get the driver name via EGL_MESA_query_driver
    
    This maps to eglGetDisplayDriverName if EGL_MESA_query_render is
    supported, otherwise it returns NULL.
    
    (cherry picked from commit 195c2ef8f9f07b9bdabc0f554a9033b7857b99c7)

commit 6b3fafa9bfa94b9b04a1a44dc52afb7c4bc250ce
Author: Matt Turner <mattst88@gmail.com>
Date:   Fri Nov 22 17:52:04 2019 -0500

    xserver 1.20.6
    
    Signed-off-by: Matt Turner <mattst88@gmail.com>

commit 88f12aa74bf4fea25d5b8d8002b3088432feb405
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Nov 21 11:23:18 2019 -0500

    xfree86: Test presence of isastream()
    
    isastream() was never more than a stub in glibc, and was removed in
    glibc-2.30 by commit a0a0dc83173c ("Remove obsolete, never-implemented
    XSI STREAMS declarations").
    
    Bug: https://bugs.gentoo.org/700838
    Reviewed-by: Julien Cristau <jcristau@debian.org>
    Signed-off-by: Matt Turner <mattst88@gmail.com>
    (cherry picked from commit e6ab7f9f342f463092c45226f3294074351fdd5e)

commit 0e60139064b84b856c59e5a456e26c60710b1b69
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Mon Nov 18 17:28:45 2019 +0100

    present/wnmd: Relax assertion on CRTC on abort_vblank()
    
    Currently, the function `present_wnmd_abort_vblank()` would fail if the
    given `crtc` is NULL.
    
    However, `xwl_present_get_crtc()` can return `NULL` under some
    circumstances, which would cause an unexpected termination of Xwayland
    in such a case, caused by the assertion failure being triggered.
    
    Remove the assertion, considering that the `crtc` isn't actually used in
    neither `present_wnmd_abort_vblank()` nor `xwl_present_abort_vblank()`.
    
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
    Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/937
    (cherry picked from commit 4f984fc06bd57cabfa38f6191f10714878dc8969)

commit 2edadf26f1f8deddbe171115fa502337ac62df02
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Tue Nov 19 10:08:51 2019 -0800

    os: Don't crash in AttendClient if the client is gone
    
    If a client is in the process of being closed down, then its client->osPrivate
    pointer will be set to NULL by CloseDownConnection. This can cause a crash if
    freeing the client's resources results in a call to AttendClient. For example,
    if the client has a pending sync fence:
    
     Thread 1 "X" received signal SIGSEGV, Segmentation fault.
     AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942
     (gdb) bt
     #0  AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942
     #1  0x00005571c3dbb865 in SyncAwaitTriggerFired (pTrigger=<optimized out>) at ../Xext/sync.c:694
     #2  0x00005571c3dd5749 in miSyncDestroyFence (pFence=0x5571c5063980) at ../miext/sync/misync.c:120
     #3  0x00005571c3dbbc69 in FreeFence (obj=<optimized out>, id=<optimized out>) at ../Xext/sync.c:1909
     #4  0x00005571c3d7a01d in doFreeResource (res=0x5571c506e3d0, skip=skip@entry=0) at ../dix/resource.c:880
     #5  0x00005571c3d7b1dc in FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1146
     #6  FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1109
     #7  0x00005571c3d5525f in CloseDownClient (client=0x5571c4aed9a0) at ../dix/dispatch.c:3473
     #8  0x00005571c3d55eeb in Dispatch () at ../dix/dispatch.c:492
     #9  0x00005571c3d59e96 in dix_main (argc=3, argv=0x7ffe7854bc28, envp=<optimized out>) at ../dix/main.c:276
     #10 0x00007fea4837cb6b in __libc_start_main (main=0x5571c3d1d060 <main>, argc=3, argv=0x7ffe7854bc28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe7854bc18) at ../csu/libc-start.c:308
     #11 0x00005571c3d1d09a in _start () at ../Xext/sync.c:2378
     (gdb) print client->osPrivate
     $1 = (void *) 0x0
    
    Since the client is about to be freed, its ignore count doesn't matter and
    AttendClient can simply be a no-op. Check for client->clientGone in AttendClient
    and remove similar checks from two callers that had them.
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    (cherry picked from commit 4308f5d3d1fbd0f5dce81e22c0c3f08c65a7c9d8)

commit 68cfee97bc59580724d594c82f5ee55a980dadf0
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Oct 9 11:57:18 2019 -0400

    dix: Call SourceValidate before GetImage
    
    This ensures that any prep work for the drawable we're about to read
    from is already done before we call down to GetImage. This should be no
    functional change as most of the callers with a non-trivial
    SourceValidate are already wrapping GetImage and doing the equivalent
    thing, but we'll be simplifying that shortly.
    
    More importantly this ensures that if any of that prep work would
    generate events - like automatic compositing flushing rendering to a
    parent pixmap which then triggers damage - then it happens entirely
    before we start writing the GetImage reply header.
    
    Note that we do not do the same for GetSpans, but that's okay. The only
    way to get to GetSpans is through miCopyArea or miCopyPlane - where the
    callers must already call SourceValidate - or miGetImage - which this
    commit now protects with SourceValidate.
    
    Fixes: xorg/xserver#902
    Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
    (cherry picked from commit 516e75dbb6bbf97c7af9c2226242ffd9259fec11)

commit 2320fd4b52a60411714170d516fc58e6ec516353
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Oct 9 11:27:12 2019 -0400

    mi: Add a default no-op miSourceValidate
    
    Slightly simplifies the callers since they don't need to check for
    non-NULL anymore.
    
    I do extremely hate the workarounds here to suppress misprite taking the
    cursor down though. Surely there's a better way.
    
    [1.20: Do not in fact simplify the callers as above, since it would
    change the ABI. - ajax]
    
    Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
    (cherry picked from commit ff310903f34ac34c916ad74e919d1ac12aea4715)

commit 07efd81b819f21046afc0bb7e19a6cdf7f3c7ea9
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Mon Jul 1 13:20:39 2019 +0200

    compiler.h: Do not include sys/io.h on ARM with glibc
    
    <sys/io.h> on ARM hasn't worked for a long, long time, so it was removed
    it from glibc upstream.
    
    Remove the include to avoid a compilation failure on ARM with glibc.
    
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/840
    (cherry picked from commit fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba)

commit 03b91e17ce72649b2d6946213f5a7d152bfe7098
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Wed Nov 6 10:45:43 2019 -0800

    xfree86: Call ScreenInit for protocol screens before GPU screens
    
    During startup, the xfree86 DDX's InitOutput() calls PreInit for
    protocol screens first, and then GPU screens. On teardown, dix_main()
    calls CloseScreen in the reverse order: GPU screens first starting with
    the last one and then working backwards, and then protocol screens also
    in reverse order.
    
    InitOutput() calls ScreenInit in the wrong order: for GPU screens first and then
    for protocol screens. This causes a problem for drivers that have global state
    that is tied to the first screen that calls ScreenInit.
    
    Fix this by simply re-ordering the for loops to call PreInit for
    protocol screens first and then for GPU screens second.
    
    (cherry picked from commit e5e9a8ca91d1c087edd8788a110251ad940dbc94)

commit 325f694e97a117aec47aa2e1a9b2b28c3c47994e
Author: Alex Goins <agoins@nvidia.com>
Date:   Tue Sep 17 18:36:35 2019 -0500

    modesetting: Implement ms_covering_randr_crtc() for ms_present_get_crtc()
    
    ms_present_get_crtc() returns an RRCrtcPtr, but derives it from a xf86CrtcPtr
    found via ms_dri2_crtc_covering_drawable()=>ms_covering_crtc(). As a result, it
    depends on all associated DIX ScreenRecs having an xf86CrtcConfigPtr DDX
    private.
    
    Some DIX ScreenRecs don't have an xf86CrtcConfigPtr DDX private, but do have an
    rrScrPrivPtr DDX private. Given that we can derive all of the information we
    need from RandR, we can support these screens by avoiding the use of xf86Crtc.
    This change implements an RandR-based path for ms_present_get_crtc(), allowing
    drawables to successfully fall back to syncing to the primary output, even if
    the slave doesn't have an xf86CrtcConfigPtr DDX private.
    
    Without this change, if a slave doesn't have an xf86CrtcConfigPtr DDX private,
    drawables will fall back to 1 FPS if they overlap an output on that slave.
    
    Signed-off-by: Alex Goins <agoins@nvidia.com>
    (cherry picked from commit 562c7888be538c4d043ec1f374a9d9afa0b305a4)

commit aa43dce15f69624ce939bb69bafc3df5a9b78dbb
Author: Alex Goins <agoins@nvidia.com>
Date:   Tue Sep 17 18:03:34 2019 -0500

    modesetting: Fix ms_covering_crtc() segfault with non-xf86Crtc slave
    
    DIX ScreenRecs don't necessarily have an xf86CrtcConfigPtr DDX private.
    ms_covering_crtc() assumes that they do, which can result in a segfault.
    
    Update ms_covering_crtc() to check the XF86_CRTC_CONFIG_PTR() returned pointer
    before dereferencing it. This will still mean that ms_covering_crtc() can't fall
    back to the primary output when a drawable overlaps a slave output (going to the
    1 FPS default instead), but it won't segfault.
    
    Signed-off-by: Alex Goins <agoins@nvidia.com>
    (cherry picked from commit 797e7a0ceb673fe2870c673e248835526a84d000)

commit 341a4787157c68597951727d5d11a2813a31ec7e
Author: Alex Goins <agoins@nvidia.com>
Date:   Wed Aug 28 18:24:16 2019 -0500

    modesetting: Fix ms_covering_crtc() segfault with non-modesetting slave primary
    
    ms_covering_crtc() uses RRFirstOutput() to determine a primary output to fall
    back to if a drawable is overlapping a slave output.
    
    If the primary output is a slave output, RRFirstOutput() will return a slave
    output even if passed a master ScreenPtr. ms_covering_crtc() dereferences the
    output's devPrivate, which is invalid for non-modesetting outputs, and can
    crash.
    
    Changing RRFirstOutput() could have unintended side effects for other callers,
    so this change replaces the call to RRFirstOutput() with ms_first_output().
    ms_first_output() ignores the primary output if it doesn't match the given
    ScreenPtr, choosing the first connected output instead.
    
    Signed-off-by: Alex Goins <agoins@nvidia.com>
    (cherry picked from commit 3ef9029ace4245d9f8929aa71e22bc6a6f40b7b3)

commit 2dd9dfc8d9a5dc906ee06d667a756ab267f55e64
Author: Alex Goins <agoins@nvidia.com>
Date:   Wed Sep 4 12:25:31 2019 -0500

    randr: Fix RRCrtcDetachScanoutPixmap() segfault during server teardown
    
    During server teardown, mrootdraw is NULL, which can cause segfaults if
    master->Stop{,Flipping}PixmapTracking() don't do NULL checking. In this case we
    shouldn't need to do master->Stop{,Flipping}PixmapTracking() anyway, so just
    skip it.
    
    Signed-off-by: Alex Goins <agoins@nvidia.com>
    (cherry picked from commit c82f814313a813d7e1a2d7d3b1f7561810446b34)

commit 642c1f83b9ed2452ceb20457a4423a8f52a7a8c4
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Mon Nov 4 20:03:17 2019 +0100

    glamor/xwayland: Define EGL_NO_X11
    
    Define EGL_NO_X11 everywhere were we also define MESA_EGL_NO_X11_HEADERS,
    EGL_NO_X11 is the MESA_EGL_NO_X11_HEADERS equivalent for the egl headers
    shipped with libglvnd.
    
    This fixes the xserver not building with the libglvnd-1.2.0 headers:
    
    In file included from /usr/include/EGL/eglplatform.h:128,
                     from /usr/include/epoxy/egl_generated.h:11,
                     from /usr/include/epoxy/egl.h:46,
                     from glamor_priv.h:43,
                     from glamor_composite_glyphs.c:25:
    /usr/include/X11/Xlib.h:222:2: error: conflicting types for 'GC'
      222 | *GC;
          |  ^~
    In file included from glamor.h:34,
                     from glamor_priv.h:32,
                     from glamor_composite_glyphs.c:25:
    ../include/gcstruct.h:282:3: note: previous declaration of 'GC' was here
      282 | } GC;
          |   ^~
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit 741bd73429e337071f49509ddcc5fb392e20b0f6)

commit 2f55e8dc270fb65e8ff013c5e846a1a510c761e0
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Oct 9 16:03:17 2019 -0400

    meson: Apparently 1.2 is < 1.2.0
    
    Siiiigh.
    
    (cherry picked from commit 3340ddf37743fdf197dfc16a97107435ff53c6e4)

commit e16eb696f2238796827794d2d3b23f268cf4daf0
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Oct 9 15:17:47 2019 -0400

    meson: Fix another reference to "gl" 9.2.0
    
    Previous commit e6ef2b12 missed a spot.
    
    (cherry picked from commit c7486613b0dc586f93f6ba293d9b55c69995b05c)

commit a57729d3180ee4bc3ae012cfd03fe5188d858a83
Author: Marvin Schmidt <marv@exherbo.org>
Date:   Tue Sep 24 09:58:43 2019 +0200

    build: glx: Lower gl version to work with libglvnd
    
    When using mesa with libglvnd support, mesa will no longer install the
    gl, glx, egl pkg-config files but instead let libglvnd provide them.
    libglvnd maintainers decided to change the versioning as it was
    mesa-specific previously. Now the libraries have versions of the API
    they expose[1].
    This causes problems when building the X server:
    
      checking for glproto >= 1.4.17 gl >= 9.2.0... no
      configure: error: Package requirements (glproto >= 1.4.17 gl >= 9.2.0) were not met:
    
      Requested 'gl >= 9.2.0' but version of gl is 1.2
    
    Lower the version requirement to 1.2 to allow building against libglvnd
    provided libraries
    
    [1] https://github.com/NVIDIA/libglvnd/commit/0dfaea2bcb7cdcc785f95e244223bd004a2d7fba
    
    (cherry picked from commit e6ef2b12404dfec7f23592a3524d2a63d9d25802)

commit 3491f1dc5c701656e2f69f74b459dfcaef9451d6
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Wed Oct 2 18:26:07 2019 +0200

    modesetting: Fix broken manpage in autoconf build
    
    The autoconf build for the modesetting driver still relied on
    xorg-macros.m4 for string replacements and did not include the
    top-level manpages.am.  As a result, no substitutions took place after
    commit 2e497bf887aca832dc0dd30d071c5288ab5c1e15.
    
    This should be a candidate for the 1.20 branch.
    
    Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
    (cherry picked from commit de0d39f825cce7422986011ee9d5db91f15e2987)

commit df1f8f691d7550a18d2076a44c109b1cb6da05ae
Author: Alexander Tsoy <alexander@tsoy.me>
Date:   Mon Sep 23 18:23:40 2019 +0300

    configure: Set libdrm flags correctly if only XORG is enabled
    
    This fixes modesetting driver build failure which can be triggered with
    the following configure options:
    
    $ ./configure --disable-dri --disable-dri2 --disable-dri3
    --disable-config-udev --enable-xorg
    
    Bugzilla: https://bugs.gentoo.org/689768
    Signed-off-by: Alexander Tsoy <alexander@tsoy.me>
    Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
    (cherry picked from commit 334f1107146a2e6ebf6f7743b77aec2ad5c46f75)

commit fada61e89dd1f20fe8e2e0fb9e4baefb45b4b848
Author: Matt Turner <mattst88@gmail.com>
Date:   Fri Aug 9 20:22:29 2019 -0700

    dix: Assert noPanoramiXExtension is false in PanoramiX code
    
    When compiling with link time optimization, GCC thinks it's discovered
    undefined behavior:
    
    events.c: In function 'XineramaConfineCursorToWindow':
    events.c:609:13: warning: iteration 2147483647 invokes undefined behavior [-Waggressive-loop-optimizations]
    events.c:609:11: note: within this loop
    events.c:605:49: warning: array subscript -1 is below array bounds of 'struct _Window *[16]' [-Warray-bounds]
    events.c:606:31: warning: array subscript -1 is below array bounds of 'struct _Screen *[16]' [-Warray-bounds]
    events.c:610:39: warning: array subscript -2 is below array bounds of 'struct _Screen *[16]' [-Warray-bounds]
    events.c:617:38: warning: array subscript -2 is below array bounds of 'struct _Window *[16]' [-Warray-bounds]
    events.c:619:35: warning: array subscript -2 is below array bounds of 'struct _Screen *[16]' [-Warray-bounds]
    
    This results from
    
        i = PanoramiXNumScreens - 1;
    
        RegionCopy(&pSprite->Reg1, &pSprite->windows[i]->borderSize);
        off_x = screenInfo.screens[i]->x;
        off_y = screenInfo.screens[i]->y;
    
    where GCC believes that PanoramiXNumScreens might be 0. Unfortunately
    GCC is just smart enough to be an annoyance because this case is not
    actually possible: XineramaConfineCursorToWindow() is only called when
    noPanoramiXExtension is false, and if noPanoramiXExtension is false then
    PanoramiXNumScreens must be >1 (see PanoramiXExtensionInit()).
    
    So, add an assert(!noPanoramiXExtension), which to my surprise provides
    GCC with information even in release builds and lets GCC understand that
    the code is not doing anything that is undefined behavior.
    
    I chose this solution instead of the proposed assert(i >= 0) because the
    same pattern occurs in CheckVirtualMotion() but is inside an
    'if (!noPanoramiXExtension)' and does not generate any warnings.
    
    Fixes: xorg/xserver#590
    Signed-off-by: Matt Turner <mattst88@gmail.com>
    (cherry picked from commit 61aa40aeb3d4efefda47f245ed4b83a1a19b1d4c)

commit e815db543450c38d1d4ec03184b8e82fa0a37498
Author: Alexander Volkov <a.volkov@rusbitech.ru>
Date:   Mon Feb 11 18:54:10 2019 +0300

    shm: Use memfd_create when possible
    
    It doesn't require shared memory dir and thus allows
    to avoid cases when this dir is detected incorrectly,
    as in https://bugreports.qt.io/browse/QTBUG-71440
    
    Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
    (cherry picked from commit f6753c117ef0f83499d5e2d6dda226fec9ddf803)

commit 05c5b970136f0a11fffa16692744bdf5a23963e8
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Sep 19 13:28:06 2018 -0700

    shm: Pick the shm dir at run time, not build time.
    
    Prodding the builder's filesystem for tmp dirs doesn't necessarily
    tell you anything about what the actual host's filesystem is going to
    look like, so we should just try the dirs at runtime.
    
    Signed-off-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit 19f6cb570becbc4e355807199c6e251fc7935132)

commit 9ee4e35bfe084fa942c2b2ce46405e048eb335a8
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Sep 19 13:20:12 2018 -0700

    shm: reindent shm_tmpfile to follow our standards.
    
    Signed-off-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit 804a9b4f57107fa2d0ed1ae0becda5bebaffe6e1)

commit b6ee04e774af1fc2e2560583c95dfac688494c2a
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Jul 1 02:31:02 2019 +0200

    Fix crash on XkbSetMap
    
    Some devices may not have keyboard information.
    
    Fixes #574
    
    (cherry picked from commit 8469bfead9515ab3644f1769a1ff51466ba8ffee)

commit 616b3e1dd19d51688e4cba380394bd93c62b50d4
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Jul 1 02:33:26 2019 +0200

    Fix crash on XkbSetMap
    
    Since group_info and width are used for the key actions allocations,
    when modifying them we need to take care of reallocation key actions if
    needed.
    
    (cherry picked from commit fabc4219622f3c0b41b1cb897c46e092377059e3)

commit c747dbb250c11c6a02641b253e7322145dc9b913
Author: Michel Dänzer <mdaenzer@redhat.com>
Date:   Mon Sep 23 18:35:41 2019 +0200

    miext/sync: Make struct _SyncObject::initialized fully ABI compatible
    
    With a 32-bit build, putting the initialized field at the end of the
    struct bumped the struct size from 20 bytes to 24, changing the layout
    of other structs embedding struct _SyncObject. While this would be
    acceptable on master, it caused crashes with 1.20.
    
    Making the initialized field a char and putting it in the hole before
    the beingDestroyed field restores the 32-bit ABI as well.
    
    Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/892
    
    Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Alex Goins <agoins@nvidia.com>
    (cherry picked from commit 0d8cc7bb180468fee72330f40d87f6e9db7b42c0)

commit 5aadaac9499c71ebf88c0e5fc658d9d56c8a7e16
Author: Andres Rodriguez <andresx7@gmail.com>
Date:   Fri Sep 6 18:32:44 2019 -0400

    xf86: Disable unused crtc functions when a lease is revoked
    
    This fixes 'non-desktop' displays staying powered on after their lease
    has been revoked.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111620
    Cc: Keith Packard <keithp@keithp.com>
    Signed-off-by: Andres Rodriguez <andresx7@gmail.com>

commit 63346c74393e1df4555f84367529802a67578ef6
Author: Carlos Garnacho <carlosg@gnome.org>
Date:   Mon Jan 7 15:33:35 2019 +0100

    xwayland: Handle the case of windows being realized before redirection
    
    If Xwayland gets to realize a window meant for composition before the
    compositor redirected windows (i.e. redirect mode is not RedirectDrawManual
    yet), the window would stay "invisible" as we wouldn't create a
    wl_surface/wl_shell_surface for it at any later point.
    
    This scenario may happen if the wayland compositor sets up a X11 socket
    upfront, but waits to raise Xwayland until there are X11 clients. In this
    case the first data on the socket is the client's, the compositor can hardly
    beat that in order to redirect subwindows before the client realizes a
    Window.
    
    In order to jump across this hurdle, allow the late creation of a matching
    (shell) surface for the WindowPtr on SetWindowPixmapProc, so it is ensured
    to be created after the compositor set up redirection.
    
    Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
    Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
    Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
    (cherry picked from commit 78cc8b6f9613fc71f6ecc7e8848d54364a250634)

commit 12db645c7fc0539752a881df7ac2bcd09e3cb17b
Author: Carlos Garnacho <carlosg@gnome.org>
Date:   Mon Jan 7 15:33:31 2019 +0100

    xwayland: Refactor surface creation into a separate function
    
    This is just called from xwl_window_realize() ATM, but will be useful in
    future commits.
    
    Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
    (cherry picked from commit c2e8ae964052944312c5023ca7ea5c41a92990e5)

commit e0af09061f9e8397ca564ec3bbedea51974455d4
Author: Carlos Garnacho <carlosg@gnome.org>
Date:   Mon Jan 7 15:20:05 2019 +0100

    xwayland: Separate DamagePtr into separate window data
    
    This will be dissociated in future commits to handle the cases
    where windows are being realized before there is a compositor
    handling redirection.
    
    In that case, we still want the DamagePtr to be registered upfront
    on RealizeWindowProc before a corresponding xwl_window might be
    created. Most notably, it cannot be lazily created on
    SetWindowPixmapProc as damage accounting gets broken.
    
    Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
    (cherry picked from commit 4e50440ae20c537d6a4edf356cda67dd33d4e5a8)

commit 045add84927051a33569ed701097e1fd514bf0ca
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Aug 16 14:56:19 2019 -0400

    glx: Fix previous context validation in xorgGlxMakeCurrent
    
    vnd has already verified that the context tag is valid before this gets
    called, and we only set the context tag private data to non-null for
    indirect clients. Mesa happens to be buggy and doesn't send MakeCurrent
    requests nearly as much as it should for direct contexts, but if you fix
    that, then unbinding a direct context would fail here with
    GLXBadContextTag.
    
    Sadly Mesa will still need to carry a workaround here for broken
    servers, but we should still fix the server.
    
    (cherry picked from commit 95dcc81cb122e5a4c5b38e84ef46eb872b2e1431)

commit 8449c8623d6208b77e76596e8b10250817d3e8ab
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Aug 19 14:27:54 2019 -0400

    miext/sync: Fix needless ABI change
    
    The initialized field was added in:
    
        commit 82f01ad7869e3f2be51e41a8246dab5982bbc36a
        Author: Alex Goins <agoins@nvidia.com>
        Date:   Wed Apr 10 13:48:02 2019 -0500
    
            xsync: Add resource inside of SyncCreate, export SyncCreate
    
    But it added this field not at the end of SyncObject. It may not have
    been _usefully_ possible to create those from another extension prior to
    that commit, but that's still an ABI-incompatible change.
    
    (cherry picked from commit 194ba38728b34a76885275dae153057c8afaf72e)

commit 39b3005c329bc63676df72c43529d641bf305bcd
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Tue May 21 10:50:42 2019 -0700

    GLX: Set GlxServerExports::{major,minor}Version
    
    Commit 56c0a71fdd94a008e5d746261f70a713c4767f93 incremented the
    GLXSERVER_VENDOR_ABI_MINOR_VERSION define, but this define was not actually
    being used to set glxServer.minorVersion.
    
    Update the initializer for glxServer to use the correct version numbers.
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    (cherry picked from commit b4231d69028adc8123801a7552b40a15ea928d1b)

commit d3034ef2f5121d85ae766a73fda4e523399043a9
Author: Kyle Brenneman <kbrenneman@nvidia.com>
Date:   Thu May 2 07:17:21 2019 -0600

    GLX: Add a function to change a clients vendor list.
    
    Add a new function, GlxServerExports::setClientScreenVendor, which will change
    the vendor that handles GLX requests for a screen, but only for requests from
    a specific client.
    
    v2: Increment the GLXVND minor version number.
    v3: Note the GLXVND version requirement for setClientScreenVendor.
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit 56c0a71fdd94a008e5d746261f70a713c4767f93)

commit abeae4a6d356653d50026707ecc2afceac83631e
Author: Kyle Brenneman <kbrenneman@nvidia.com>
Date:   Wed May 8 08:44:54 2019 -0600

    GLX: Use the sending client for looking up XID's
    
    When GlxGetXIDMap looks up an unknown XID, it will now look up a vendor based
    on the screen number for the XID and the client that sent the current request.
    
    In GlxGetXIDMap, if the XID is for a regular X window, then it won't be in the
    (XID -> vendor) mapping, so we have to look up a vendor by screen number.
    
    With this change, GlxGetXIDMap will use the (screen -> vendor) map for
    whichever client sent the current request, instead of using the global
    (screen -> vendor) map.
    
    Since GlxGetXIDMap doesn't take a ClientPtr argument, GlxDispatchRequest will
    store the client for the current request in a global variable. That way, the
    ABI for GLXVND doesn't need to change.
    
    v2: Fix an error check in GlxDispatchRequest.
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit 8b67ec7cc6fda243480a5a8ca118b66242f3eb2c)

commit 1fdb7cbce538f0b37304a3cfc9fae4ff2fe9ece9
Author: Kyle Brenneman <kbrenneman@nvidia.com>
Date:   Thu Oct 19 15:14:51 2017 -0600

    GLX: Add a per-client vendor mapping.
    
    Each client now has its own (screen, vendor) mapping.
    
    Currently, it's just a copy of the global mapping, but later changes will allow
    it to change.
    
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    (cherry picked from commit 37a36a6b5b887d5c5a17a6931ceba8ad5d1bb6d5)

commit 82f01ad7869e3f2be51e41a8246dab5982bbc36a
Author: Alex Goins <agoins@nvidia.com>
Date:   Wed Apr 10 13:48:02 2019 -0500

    xsync: Add resource inside of SyncCreate, export SyncCreate
    
    As shown by DRI3 adding the SyncCreateFenceFromFD() function, extensions may
    want to create a fence, then initialize it in their own way. This currently
    can't be done without adding a function directly to Xext/sync.c due to the fact
    that the RTFence resource type is private and there is no external interface to
    add to it.
    
    To facilitate other X extensions creating fences and initializing them, this
    change exports SyncCreate() and adds the resource directly within it. Callers no
    longer need to call AddResource() after SyncCreate(), they only need to
    initialize the SyncObject.
    
    To prevent FreeFence() and FreeCounter() from segfaulting if the call to
    AddResource() fails before the sync object is initialized, this adds a new
    'initialized' parameter to SyncObject that, when FALSE, causes FreeFence() and
    FreeCounter() to skip de-initialization and simply free the object.
    Initialization after adding the resource shouldn't otherwise be a problem due to
    the single-threaded nature of X.
    
    Signed-off-by: Alex Goins <agoins@nvidia.com>
    Reviewed-by: James Jones <jajones@nvidia.com>
    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    (cherry picked from commit 7f962c70b6d9c346477f23f6c15211e749110078)

commit dfd51be3ca2a244bbca27a95310b60e0c14940df
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Tue Jul 23 11:01:47 2019 +0200

    xwayland: Do not free a NULL GBM bo
    
    Both `gbm_bo_create()` and `gbm_bo_create_with_modifiers()` can fail and
    return `NULL`.
    
    If that occurs, `xwl_glamor_gbm_create_pixmap()` will not create a
    pixmap for the (NULL) GBM bo, but would still try to free the bo which
    leads to a crash in mesa:
    
      [...]
      #7  <signal handler called>
      #8  in gbm_bo_destroy (bo=0x0) at ../src/gbm/main/gbm.c:439
      #9  in xwl_glamor_gbm_create_pixmap () at xwayland-glamor-gbm.c:245
      #10 in ProcCreatePixmap () at dispatch.c:1440
      #11 in Dispatch () at dispatch.c:478
      #12 in dix_main () at main.c:276
    
    To avoid the crash, only free the GBM bo if not `NULL`.
    
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    Bugzilla: https://bugzilla.redhat.com/1729925
    (cherry picked from commit d9ec525059dbe96fc893c73c0362be2a6dd73e85)

commit df7ee10d9812897b297c67fde29f0b134ffba3ec
Author: Adam Jackson <ajax@redhat.com>
Date:   Mon Jul 15 11:38:44 2019 -0400

    xwayland: Expand the RANDR screen size limits
    
    There's not really a good way to query this from the wayland server, so
    just set the maximum to the X11 protocol limits. While we're at it,
    lower the minimum screen size to something implausibly small too, just
    in case.
    
    Fixes: xorg/xserver#850
    Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
    (cherry picked from commit d0850241c6218f61127c45c2f95d6e791c3fea44)

commit 44c693f45d6abd6f7f3bd2f756d35811db143af7
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Fri Jun 28 16:55:11 2019 +0200

    xwayland: Update screen pixmap on output resize
    
    Running Xwayland non-rootless and resizing the output would lead to a
    crash while trying to update the larger areas of the root window.
    
