commit 6bf62381d0a1fb54226a10f9d0e6b03aff12f3aa
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Tue Jul 12 16:09:23 2022 +0300

    xserver 21.1.4

commit 06b23cccb1166fcccc2f5fe7259b3ef9e1d0f32e
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jul 5 11:11:06 2022 +1000

    xkb: add request length validation for XkbSetGeometry
    
    No validation of the various fields on that report were done, so a
    malicious client could send a short request that claims it had N
    sections, or rows, or keys, and the server would process the request for
    N sections, running out of bounds of the actual request data.
    
    Fix this by adding size checks to ensure our data is valid.
    
    ZDI-CAN 16062, CVE-2022-2319.
    
    This vulnerability was discovered by:
    Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 6907b6ea2b4ce949cb07271f5b678d5966d9df42)

commit e3a530540f2f13739b0233ec51d7a3985a7ec4be
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jul 5 09:50:41 2022 +1000

    xkb: swap XkbSetDeviceInfo and XkbSetDeviceInfoCheck
    
    XKB often uses a FooCheck and Foo function pair, the former is supposed
    to check all values in the request and error out on BadLength,
    BadValue, etc. The latter is then called once we're confident the values
    are good (they may still fail on an individual device, but that's a
    different topic).
    
    In the case of XkbSetDeviceInfo, those functions were incorrectly
    named, with XkbSetDeviceInfo ending up as the checker function and
    XkbSetDeviceInfoCheck as the setter function. As a result, the setter
    function was called before the checker function, accessing request
    data and modifying device state before we ensured that the data is
    valid.
    
    In particular, the setter function relied on values being already
    byte-swapped. This in turn could lead to potential OOB memory access.
    
    Fix this by correctly naming the functions and moving the length checks
    over to the checker function. These were added in 87c64fc5b0 to the
    wrong function, probably due to the incorrect naming.
    
    Fixes ZDI-CAN 16070, CVE-2022-2320.
    
    This vulnerability was discovered by:
    Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
    
    Introduced in c06e27b2f6fd9f7b9f827623a48876a225264132
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit dd8caf39e9e15d8f302e54045dd08d8ebf1025dc)

commit e75840565775dc95b848b366aeed44066a9d8a28
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jul 5 12:40:47 2022 +1000

    xkb: switch to array index loops to moving pointers
    
    Most similar loops here use a pointer that advances with each loop
    iteration, let's do the same here for consistency.
    
    No functional changes.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
    (cherry picked from commit f1070c01d616c5f21f939d5ebc533738779451ac)

commit f3d9c6ff12b5a8a1a9f316b096d5573060747ff9
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Mon Jul 4 14:16:43 2022 -0700

    xquartz: Add missing files to distribution tarball
    
    Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1346
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

commit 147c17fc786c268ec51dc0f0655e69f6493f7ef2
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sat Jul 2 14:15:50 2022 -0700

    XQuartz: Improve type safety for X11Controller's application menu editor
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 4cfdc5af31ae8282903d0f65cff858330b9f9d1a)

commit 9e2fc7e2484be7c577ee5baf3765734beef9adc2
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sat Jul 2 14:17:18 2022 -0700

    xquartz: Fix a possible crash when editing the Application menu due to mutaing immutable arrays
    
    Crashing on exception: -[__NSCFArray replaceObjectAtIndex:withObject:]: mutating method sent to immutable object
    
    Application Specific Backtrace 0:
    0   CoreFoundation                      0x00007ff80d2c5e9b __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007ff80d027e48 objc_exception_throw + 48
    2   CoreFoundation                      0x00007ff80d38167b _CFThrowFormattedException + 194
    3   CoreFoundation                      0x00007ff80d382a25 -[__NSCFArray removeObjectAtIndex:].cold.1 + 0
    4   CoreFoundation                      0x00007ff80d2e6c0b -[__NSCFArray replaceObjectAtIndex:withObject:] + 119
    5   X11.bin                             0x00000001003180f9 -[X11Controller tableView:setObjectValue:forTableColumn:row:] + 169
    
    Fixes: https://github.com/XQuartz/XQuartz/issues/267
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit dfd057996b26420309c324ec844a5ba6dd07eda3)

commit 86ace20398a6c559e89213622538134b72e448b1
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Fri Jul 1 14:26:06 2022 -0700

    xquartz: Use correct defines when building to support Sparkle updates
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit aa636b97c66343b25e508b9c73d8505e8c11b1d9)

commit 855b96a85bc0711460a2542573a9a3959d1bfefa
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Sun Dec 19 16:51:39 2021 +0200

    xfree86: Fix event data alignment in inputtest driver
    
    This fixes address sanitizer errors when running unit tests. The
    additional copying may reduce performance by a small amount, but we
    don't care about that because this driver is used for testing only.
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
    (cherry picked from commit 7d2014e7d523e10623203582b9f573303750f087)

commit 9d05ee10c231edacc69b342677ae8c3cc32f97e5
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Sun Jan 16 10:42:15 2022 +0200

    dix: Don't send touch end to clients that do async grab without touches
    
    GTK3 menu widget creates a selection for touch and other events and
    after receiving touch events creates an async grab that excludes touch
    events. Unfortunately it relies on X server not sending the touch end
    event in order to function properly. Sending touch end event will cause
    it to think that the initiating touch ended and when it actually ends,
    the ButtonRelease event will make it think that the menu should be
    closed. As a result, the menu will be open only for the duration of the
    touch making it useless.
    
    This commit reverts f682e0563f736ed2c2c612ed575e05b6e3db945e.
    
    Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1255
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
    (cherry picked from commit 43e934a19f644cddedae73602e86429c9dc5074a)

commit b713e717c34d539486f661c03a0f1b35b3208d21
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Sun Jan 23 22:18:52 2022 +0200

    dix: Correctly save replayed event into GrabInfoRec
    
    When processing events we operate on InternalEvent pointers. They may
    actually refer to a an instance of DeviceEvent, GestureEvent or any
    other event that comprises the InternalEvent union. This works well in
    practice because we always look into event type before doing anything,
    except in the case of copying the event.
    
    *dst_event = *src_event would copy whole InternalEvent event and would
    cause out of bounds read in case the pointed to event was not
    InternalEvent but e.g. DeviceEvent.
    
    This regression has been introduced in
    23a8b62d34344575f9df9d057fb74bfefa94a77b.
    
    Fixes https://gitlab.freedesktop.org/xorg/xserver/-/issues/1261
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
    (cherry picked from commit 6ef5c05728f8b18170fbc8415d7502495a08670b)

commit cd3d21d8c44a35c22b7eca61a58bb5620b116102
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Wed Jan 26 00:05:55 2022 +0100

    xkb: fix XkbSetMap when changing a keysym without changing a keytype
    
    As the comment says:
    
    "symsPerKey/mapWidths must be filled regardless of client-side flags"
    
    so we always have to call CheckKeyTypes which will notably fill mapWidths
    and nTypes. That is needed for CheckKeySyms to work since it checks the
    width. Without it, any request with XkbKeySymsMask but not
    XkbKeyTypesMask will fail because of the missing width information, for
    instance this:
    
      XkbDescPtr xkb;
      if (!(xkb = XkbGetMap (dpy, XkbKeyTypesMask|XkbKeySymsMask, XkbUseCoreKbd))) {
        fprintf (stderr, "ERROR getting map\n");
        exit(1);
      }
      XFlush (dpy);
      XSync (dpy, False);
    
      XkbMapChangesRec changes = { .changed = 0 };
      int oneGroupType[XkbNumKbdGroups] = { XkbOneLevelIndex };
    
      if (XkbChangeTypesOfKey(xkb, keycode, 1, XkbGroup1Mask, oneGroupType, &changes)) {
        fprintf(stderr, "ERROR changing type of key\n");
        exit(1);
      }
      XkbKeySymEntry(xkb,keycode,0,0) = keysym;
    
      if (!XkbChangeMap(dpy,xkb,&changes)) {
        fprintf(stderr, "ERROR changing map\n");
        exit(1);
      }
    
      XkbFreeKeyboard (xkb, 0, TRUE);
      XFlush (dpy);
      XSync (dpy, False);
    
    This had being going under the radar since about ever until commit
    de940e06f8733d87bbb857aef85d830053442cfe ("xkb: fix key type index check
    in _XkbSetMapChecks") fixed checking the values of kt_index, which was
    previously erroneously ignoring errors and ignoring all other checks, just
    because nTypes was not set, precisely because CheckKeyTypes was not called.
    
    Note: yes, CheckKeyTypes is meant to be callable without XkbKeyTypesMask, it
    does properly check for that and just fills nTypes and mapWidths in that
    case.
    
    Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    (cherry picked from commit 0217cc6e0cf5013366105a90f5f91ccc4bab5425)

commit f575524314e9f20a1ff639f6bd65386cdbd083f4
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Thu Feb 3 20:04:52 2022 +0200

    Revert "os: Try to discover the current seat with the XDG_SEAT var first"
    
    This reverts commit b27eaa72837eebe80adfe6c257a71a6b9eaf66ee.

commit 419fbf639d8f53d39449c157a9554bd5482ed64f
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sun Jun 26 10:31:54 2022 -0700

    XQuartz: Add TCC reason keys to Info.plist
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 9ce7264889e36fddbdf6bac332225ad6f628ad5d)

commit 66ac50090dd191f1b16daf338ca3b46d9147fbbd
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sun Jun 26 02:40:20 2022 -0700

    XQuartz: Build the bundle trampoline when using meson
    
    This brings the change for e1fdc856aedfcb4788011415930a0c6861df5123 into meson based builds
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit b00cf4aef881e00533f995c141c3586749cd7ca1)

commit 033d93a021e86dd5ce9b2b3a1554a72c7031a7f2
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Mon Jun 20 17:08:53 2022 -0700

    meson: Support building Xnest and Xorg on darwin
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit ef8101560eefd6160df6d4b57ddb65ea2328c441)

commit 433f53a1a08390a038176b7c1207512cf1dd3f44
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Mon Jun 20 20:19:06 2022 -0700

    tests: Fix build failure from missing micmap.c
    
    FAILED: test/tests
    clang  -o test/tests test/tests.p/.._mi_miinitext.c.o test/tests.p/fixes.c.o test/tests.p/input.c.o test/tests.p/list.c.o test/tests.p/misc.c.o test/tests.p/signal-logging.c.o test/tests.p/string.c.o test/tests.p/test_xkb.c.o test/tests.p/tests-common.c.o test/tests.p/tests.c.o test/tests.p/touch.c.o test/tests.p/xfree86.c.o test/tests.p/xtest.c.o test/tests.p/hashtabletest.c.o -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -fvisibility=hidden -O0 -g3 -gdwarf-2 -mmacosx-version-min=10.9 -Werror=unguarded-availability-new -Werror=format -Werror=objc-method-access -Werror=incompatible-pointer-types -F/Applications/Utilities/XQuartz.app/Contents/Frameworks -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -arch x86_64 -O0 -g3 -gdwarf-2 -mmacosx-version-min=10.9 -Werror=unguarded-availability-new -Werror=format -Werror=objc-method-access -Werror=incompatible-pointer-types -F/Applications/Utilities/XQuartz.app/Contents/Frameworks -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -arch x86_64 -Wl,-rpath,/opt/X11/lib mi/liblibxserver_mi.a dix/liblibxserver_dix.a composite/liblibxserver_composite.a damageext/liblibxserver_damageext.a dbe/liblibxserver_dbe.a randr/liblibxserver_randr.a miext/damage/liblibxserver_miext_damage.a render/liblibxserver_render.a present/liblibxserver_present.a Xext/liblibxserver_xext.a miext/sync/liblibxserver_miext_sync.a xfixes/liblibxserver_xfixes.a Xi/liblibxserver_xi.a xkb/liblibxserver_xkb.a record/liblibxserver_record.a os/liblibxserver_os.a os/liblibxlibc.a glx/liblibglxvnd.a hw/xfree86/common/libxorg_common.a hw/xfree86/loader/libxorg_loader.a hw/xfree86/ddc/libxorg_ddc.a hw/xfree86/xkb/libxorg_xkb.a hw/xfree86/i2c/libxorg_i2c.a hw/xfree86/modes/libxorg_modes.a hw/xfree86/os-support/libxorg_os_support.a hw/xfree86/parser/libxorg_parser.a hw/xfree86/ramdac/libxorg_ramdac.a fb/liblibxserver_fb.a Xext/liblibxserver_xext_vidmode.a dix/liblibxserver_main.a config/liblibxserver_config.a /opt/X11/lib/libpixman-1.dylib /opt/X11/lib/libxcvt.dylib /opt/X11/lib/libxkbfile.dylib /opt/X11/lib/libXfont2.dylib /opt/X11/lib/libXdmcp.dylib -lm /opt/X11/lib/libxshmfence.dylib -ldl -lpthread /opt/X11/lib/libXau.dylib /opt/X11/lib/libGL.dylib
    Undefined symbols for architecture x86_64:
      "_micmapScrPrivateKeyRec", referenced from:
          _DGAInstallCmap in libxorg_common.a(xf86DGA.c.o)
          _xf86HandleColormaps in libxorg_common.a(xf86cmap.c.o)
          _CMapInstallColormap in libxorg_common.a(xf86cmap.c.o)
          _CMapEnterVT in libxorg_common.a(xf86cmap.c.o)
          _CMapSwitchMode in libxorg_common.a(xf86cmap.c.o)
          _CMapSetDGAMode in libxorg_common.a(xf86cmap.c.o)
          _CMapChangeGamma in libxorg_common.a(xf86cmap.c.o)
          ...
    ld: symbol(s) not found for architecture x86_64
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 6645ff59069d603806d749e8af73893cf88d2c06)

commit 3868f364728ae0cc35621bbfdd36bfa2e3f09fda
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Mon Jun 20 20:05:46 2022 -0700

    xf86-input-inputtest: Fix build on systems without SOCK_NONBLOCK
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 707f23dab8787b4154011186206dc9964e2ebc11)

commit afcaaac96767d773422512e755e5ad3691a0627c
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Mon Jun 20 19:51:39 2022 -0700

    print_edid: Fix a format string error
    
    ../hw/xfree86/ddc/print_edid.c:511:20: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
                       det_mon->type - DS_VENDOR);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 199b8c0853c92ce19a589186f326621477401b74)

commit 6bb98fc62ddf8b0dd90f7b0b45978a0d0425ed5a
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Tue Jun 21 11:46:14 2022 -0700

    xquartz: Update autotools-based builds of XQuartz to account for recent changes
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

commit 4ea6f661edbbd84b3f2b308675bd2aa848b53746
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Mon Jun 20 20:32:26 2022 -0700

    Revert "meson: Bump requirement to meson-0.50.0"
    
    This bump is causing issues with our CI.  Sorry about that.
    
    This reverts commit a6a20a7c40f86b5586286aaa614e6b64a5987d82
    
    (cherry picked from commit 8cd0397e5b4c1f0e0add1fea67f82b811214bf3e)

commit a6a20a7c40f86b5586286aaa614e6b64a5987d82
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sun Jun 19 23:06:40 2022 -0700

    meson: Provide options to set CFBundleVersion and CFBundleVersionString in XQuartz
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 4f5999826aa478ba5f138e74cfccdf3b854c8e54)

commit 37285e6252ce3afca5bc205121f83271548dfca9
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sun Jun 19 19:56:26 2022 -0700

    xquartz: Update copyright for 2022
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit b12f5dc62d964d0279e1fa9403259cfd8e491285)

commit 96e7b55c5d6898a6715b62d5e01581617d218997
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sun Jun 19 19:55:44 2022 -0700

    xquartz: Update Sparkle configuration to use SUPublicEDKey
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 1d90bef30c4dfe13dd5e70fea606a02380cbcee6)

commit 6465263be8ae98283f8e99a3e95d04e786386040
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sun Jun 19 22:18:16 2022 -0700

    meson: Bump requirement to meson-0.50.0
    
    WARNING: Project specifies a minimum meson_version '>= 0.47.0' but uses features which were added in newer versions:
     * 0.50.0: {'install arg in configure_file'}
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 0a27f96d1d0e474b308be982fa7069d3ae0d9892)

commit e48acd9c40c09b7c66a7bfc6650afc216ba78cca
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Thu Jun 16 00:10:26 2022 -0700

    XQuartz: Ensure scroll events are delivered to a single window (not both X11 and AppKit)
    
    Fixes: https://github.com/XQuartz/XQuartz/issues/130
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 4532b696c644cb7f21e96cf76d3e6b21ccc0e309)

commit 140d9a0f75194d4079d5cd1e4ad4683c6f47683e
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sat Feb 20 14:21:01 2021 -0800

    xquartz: Fold spaces related preferences into NSUserDefaults+XQuartzDefaults
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit f40610e0b4f2b4ae54ef6bbff756cb4a60e17e3b)

commit 03ec5b132f0b3e07f9340faaacaa2455717fd8d1
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sat Feb 20 14:00:14 2021 -0800

    xquartz pbproxy: Adopt NSUserDefaults+XQuartzDefaults for preferences
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 6134c73aebc3f928639e8f802be49ec8ecc17e66)

commit 6df6178bb917f596ec2f61a3aabf99eea620b6ec
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Fri Feb 19 22:49:11 2021 -0800

    xquartz: Create a separate category for organizing user preferences
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit 963ba6d9adf578ec8d7ed12ae22dece76b895172)

commit c6c1cba397ffa203123a8a6690dee728089e7325
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sat Sep 10 22:32:56 2016 -0700

    os/connection: Improve abstraction for launchd secure sockets
    
    This changes away from hard-coding the /tmp/launch-* path to now
    supporting a generic <absolute path to unix socket>[.<screen>]
    format for $DISPLAY.
    
    cf-libxcb: d978a4f69b30b630f28d07f1003cf290284d24d8
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    CC: Adam Jackson <ajax@kemper.freedesktop.org>
    (cherry picked from commit 83d0d911069d502232d719882cd1c5cd090defa1)

commit 663af2f17eec2cc064f3d1e25e00fb840c441964
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Sun Jun 12 22:06:01 2022 -0700

    X11Application: Ensure TIS operations are done on the main thread
    
    Fixes: https://github.com/XQuartz/XQuartz/issues/205
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit b1afcecc61d841f95e786e4f4f84184f91d149f1)

commit bd3564cf377deace41b359740331d84e3086e916
Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date:   Fri Apr 23 02:15:30 2021 -0700

    rootless: Dead code removal (ROOTLESS_REDISPLAY_DELAY is already defined)
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
    (cherry picked from commit c11b55f3c0c64645bca964aece825de0bdd92b1f)

commit 53173fdab492f0f638f6616fcf01af0b9ea6338d
Author: Olivier Fourdan <ofourdan@redhat.com>
Date:   Thu Jan 20 10:20:38 2022 +0100

    render: Fix build with gcc 12
    
    The xserver fails to compile with the latest gcc 12:
    
     render/picture.c: In function ‘CreateSolidPicture’:
     render/picture.c:874:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds]
      874 |     pPicture->pSourcePict->type = SourcePictTypeSolidFill;
          |                          ^~
     render/picture.c:868:45: note: object of size 16 allocated by ‘malloc’
      868 |     pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill));
          |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     render/picture.c: In function ‘CreateLinearGradientPicture’:
     render/picture.c:906:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds]
      906 |     pPicture->pSourcePict->linear.type = SourcePictTypeLinear;
          |                          ^~
     render/picture.c:899:45: note: object of size 32 allocated by ‘malloc’
      899 |     pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient));
          |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     render/picture.c: In function ‘CreateConicalGradientPicture’:
     render/picture.c:989:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds]
      989 |     pPicture->pSourcePict->conical.type = SourcePictTypeConical;
          |                          ^~
     render/picture.c:982:45: note: object of size 32 allocated by ‘malloc’
      982 |     pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient));
          |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     cc1: some warnings being treated as errors
     ninja: build stopped: subcommand failed.
    
    This is because gcc 12 has become stricter and raises a warning now.
    
    Fix the warning/error by allocating enough memory to store the union
    struct.
    
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
    Acked-by: Michel Dänzer <mdaenzer@redhat.com>
    Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1256
    (cherry picked from commit c6b0dcb82d4db07a2f32c09a8c09c85a5f57248e)

commit 69774044716039fa70655b3bc6dd6a4ff4535cfd
Author: Błażej Szczygieł <spaz16@wp.pl>
Date:   Thu Jan 13 00:47:27 2022 +0100

    present: Check for NULL to prevent crash
    
    Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1275
    Signed-off-by: Błażej Szczygieł <spaz16@wp.pl>
    Tested-by: Aaron Plattner <aplattner@nvidia.com>
    (cherry picked from commit 22d5818851967408bb7c903cb345b7ca8766094c)

commit 85397cc2efe8fa73461cd21afe700829b2eca768
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Mon Jan 3 00:23:30 2022 +0200

    xserver 21.1.3
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>

commit 001feb6692b77254db6a4906a82fa1bdadfd7b85
Author: Adam Jackson <ajax@redhat.com>
Date:   Tue Oct 26 11:46:37 2021 -0400

    glx/dri: Filter out fbconfigs that don't have a supported pixmap format
    
    For depth 30 in particular it's not uncommon for the DDX to not have
    a configured pixmap format. Since the client expects to back both
    GLXPixmaps and GLXPbuffers with X Pixmaps, trying to use an x2rgb10
    fbconfig would fail along various paths to CreatePixmap. Filter these
    fbconfigs out so the client can't ask for something that we know won't
    work.
    
    (cherry picked from commit f6c070a1ac05801c52ae60efb7dc4b3142653b7d)

commit 66890ca569291a53ea9cdc6ec19070173e522260
Author: Jocelyn Falempe <jfalempe@redhat.com>
Date:   Fri Dec 17 10:18:25 2021 +0100

    xf86/logind: fix missing call to vtenter if the platform device is not paused
    
    If there is one platform device, which is not paused nor resumed,
    systemd_logind_vtenter() will never get called.
    This break suspend/resume, and switching to VT on system with Nvidia
    proprietary driver.
    This is a regression introduced by f5bd039633fa83
    
    So now call systemd_logind_vtenter() if there are no paused
    platform devices.
    
    Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1271
    Fixes: f5bd0396 - xf86/logind: fix call systemd_logind_vtenter after receiving drm device resume
    
    Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
    Tested-by: Olivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>

commit fec0e2501b424ec6cfbf4c7983727acfafea0ccb
Author: Jocelyn Falempe <jfalempe@redhat.com>
Date:   Thu Dec 16 15:46:43 2021 +0100

    xf86/logind: Fix compilation error when built without logind/platform bus
    
    This was introduced by commit 8eb1396d
    
    Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1269
    Fixes: da9d012a9 - xf86/logind: Fix drm_drop_master before vt_reldisp
    
    Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>

commit 8223a9d6d9ed2b9a4c1e6373f6ab854fdbda9ead
Author: Matthieu Herrb <matthieu@herrb.eu>
Date:   Tue Nov 16 23:38:46 2021 +0100

    Convert more funcs to use InternalEvent.
    
    This fixes a crash when a DeviceEvent struct converted to
    InteralEvent was beeing copied as InternalEvent (and thus
    causing out of bounds reads) in ActivateGrabNoDelivery()
    in events.c: 3876    *grabinfo->sync.event = *real_event;
    
    Possible fix for https://gitlab.freedesktop.org/xorg/xserver/-/issues/1253
    
    Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
    (cherry picked from commit 5b8817a019845e1066c373022133985a0e2d718f)

commit b27eaa72837eebe80adfe6c257a71a6b9eaf66ee
Author: nerdopolis <bluescreen_avenger@verizon.net>
Date:   Fri Oct 8 18:15:29 2021 -0400

    os: Try to discover the current seat with the XDG_SEAT var first
    
    (cherry picked from commit ca1dfdc9aa4b548de624d3a9af5147a998ba3d79)

commit 9852b29380673484aea25771a3e812c8e8a40393
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Wed Dec 15 15:46:09 2021 +0200

    xserver 21.1.2
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>

commit 9fe2991075aca3321d59d03f3e45faca6cb718b8
Author: Sam James <sam@gentoo.org>
Date:   Wed Dec 15 10:41:22 2021 +0200

    hw/xfree86: fix sbus build for SPARC
    
    Initially reported downstream in Gentoo. Manifests with errors like:
    ```
    gnu/bin/ld: hw/xfree86/common/libxorg_common.a(xf86fbBus.c.o): in function `xf86ClaimFbSlot':
    xf86fbBus.c:(.text+0x20): undefined reference to `sbusSlotClaimed'
    /usr/lib/gcc/sparc-unknown-linux-gnu/11.2.0/../../../../sparc-unknown-linux-gnu/bin/ld: xf86fbBus.c:(.text+0x2c): undefined reference to `sbusSlotClaimed'
    ```
    
    While we use the headers in meson.build, we don't reference xf86sbusBus.c
    which defines the missing symbols like sbusSlotClaimed.
    
    Bug: https://bugs.gentoo.org/828513
    Signed-off-by: Sam James <sam@gentoo.org>
    (cherry picked from commit 6c1a1fcc4bff90546ebc954f428c6df97005ea50)

commit 0b67785cd13e65d37416f75ab938bdc49cf4732f
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Wed Dec 15 10:41:21 2021 +0200

    render: Fix out of bounds access in SProcRenderCompositeGlyphs()
    
    ZDI-CAN-14192, CVE-2021-4008
    
    This vulnerability was discovered and the fix was suggested by:
    Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
    (cherry picked from commit ebce7e2d80e7c80e1dda60f2f0bc886f1106ba60)

commit 7209982d2a89f2e27d2f83f8952e9512be813aa4
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Wed Dec 15 10:41:20 2021 +0200

    Xext: Fix out of bounds access in SProcScreenSaverSuspend()
    
    ZDI-CAN-14951, CVE-2021-4010
    
    This vulnerability was discovered and the fix was suggested by:
    Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
    (cherry picked from commit 6c4c53010772e3cb4cb8acd54950c8eec9c00d21)

commit 6f09e7d3913a8188e32062f5e196bebb06bab140
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Wed Dec 15 10:41:19 2021 +0200

    xfixes: Fix out of bounds access in *ProcXFixesCreatePointerBarrier()
    
    ZDI-CAN-14950, CVE-2021-4009
    
    This vulnerability was discovered and the fix was suggested by:
    Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
    (cherry picked from commit b5196750099ae6ae582e1f46bd0a6dad29550e02)

commit a82d523edb30e5856adca9f258ac716108c71f19
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Wed Dec 15 10:41:18 2021 +0200

    record: Fix out of bounds access in SwapCreateRegister()
    
    ZDI-CAN-14952, CVE-2021-4011
    
    This vulnerability was discovered and the fix was suggested by:
    Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
    (cherry picked from commit e56f61c79fc3cee26d83cda0f84ae56d5979f768)

commit a39218d99c6961dda0142d9956eb7404a37d9bd2
Author: Matthieu Herrb <matthieu@herrb.eu>
Date:   Wed Dec 15 10:41:17 2021 +0200

    remove the PRE_RELEASE message.
    
    With the new numbering scheme, XORG_VERISON_SNAP doesn't mean
    a pre-release version anymore.
    
    Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
    (cherry picked from commit 4de9666b6d3c86660d728ddfc13d88700e5ff20d)

commit fc2eb7e8cc19a41e034f2f4286af58f8b4825d65
Author: Matt Turner <mattst88@gmail.com>
Date:   Tue Dec 7 21:39:58 2021 -0800

    test: #undef NDEBUG so assert is not compiled away
    
    (cherry picked from commit d189102c783653a10931051175de24277a157331)

commit 7caf29ca6607ddf4c19a81d19c0f4acc6deb8936
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Sat Nov 13 16:42:36 2021 +0200

    meson: Correctly set DDXOSVERRORF and DDXBEFORERESET on xwin
    
    This worked with autotools, but not meson build system.
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
    (cherry picked from commit 04c93b98e9e4593aa2e6701bb08f5e27c3544d8a)

commit 101791f80fdefea738421a414177899db7c76e83
Author: Jonathan Gray <jsg@jsg.id.au>
Date:   Fri Dec 3 19:17:18 2021 +1100

    glamor: fix free of uninitialised pointers
    
    Attempting to run fvwm on a x61/965gm with xserver 1.21.1 with the
    modesetting driver on OpenBSD/amd64 would cause the xserver to
    reliably crash.
    
    I tracked this down to the free() calls introduced in
    2906ee5e4a722138cccb3265a615da7705a52589
    (d1ca47e1242b51c79cec7287f52c36c8e494706b in branch).
    
    clang also warns about this:
    glamor_program.c:296:13: warning: variable 'vs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:290:9: warning: variable 'vs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:288:9: warning: variable 'vs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:277:13: warning: variable 'vs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:296:13: warning: variable 'fs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:290:9: warning: variable 'fs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:288:9: warning: variable 'fs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    glamor_program.c:277:13: warning: variable 'fs_prog_string' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    
    Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
    Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
    Fixes: 2906ee5e4 ("glamor: Fix leak in glamor_build_program()")
    (cherry picked from commit 5ac6319776b13f96a2b336da4b35237618a5b001)

commit 2c6989f81e62bac05a583c39fa09a06172d1ece5
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Dec 2 10:41:03 2021 +1000

    xkb: fix XkbSetMap check for the keytypes count
    
    The previous if/else condition resulted in us always setting the key
    type count to the current number of key types. Split this up correctly.
    
    Regression introduced in de940e06f8733d87bbb857aef85d830053442cfe
    
    Fixes #1249
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit be16bd8543f80ad2933ec9c37f082617c7084165)

commit 49444ce9f7ad34fff6ff94a9db95337f4bfd7b03
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Sat Nov 13 17:23:54 2021 +0200

    Revert "hw/xfree86: Propagate physical dimensions from DRM connector"
    
    Quite a lot of applications currently expect the screen DPI exposed by
    the X server to be 96 even when the real display DPI is different.
    Additionally, currently Xwayland completely ignores any hardware
    information and sets the DPI to 96. Accordingly the new behavior, even
    if it fixes a bug, should not be enabled automatically to all users.
    
    A better solution would be to make the default DPI stay as is and enable
    the correct behavior with a command line option (maybe -dpi auto, or
    similar). For now let's just revert the bug fix.
    
    This reverts commit 05b3c681ea2f478c0cb941c2f8279919cf78de6d.
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
    (cherry picked from commit 35af1299e73483eaf93d913a960e1d1738bc7de6)

commit 6f11b3c803898e0effe6ade2ae951f5758936152
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu Nov 11 06:35:19 2021 +1000

    dri2: add crocus to the list of va_gl users
    
    (cherry picked from commit a7b0a7fabd137183cc42a5edb15697e354c4450c)

commit 8eb1396d3ecfd2bf968105a99759ae9445bdf768
Author: Jocelyn Falempe <jfalempe@redhat.com>
Date:   Thu Nov 18 14:51:21 2021 +0100

    xf86/logind: Fix drm_drop_master before vt_reldisp
    
    When switching to VT, the ioctl DRM_DROP_MASTER must be done before
    the ioctl VT_RELDISP. Otherwise the kernel can't change the modesetting
    reliably, and this leads to the console not showing up in some cases, like
    after unplugging a docking station with a DP or HDMI monitor.
    
    Before doing the VT_RELDISP, send a dbus message to logind, to
    pause the drm device, so logind will do the ioctl DRM_DROP_MASTER.
    
    With this patch, it changes the order logind will send the resume
    event, and drm will be sent last instead of first.
    so there is a also fix to call systemd_logind_vtenter() at the right time.
    
    Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit da9d012a9c760896941769d4127e3cfb1a7a9f03)

commit 6834f977a5eadbc3289f27b2bb83997132a39fdd
Author: Jocelyn Falempe <jfalempe@redhat.com>
Date:   Thu Nov 18 14:45:42 2021 +0100

    xf86/logind: fix call systemd_logind_vtenter after receiving drm device resume
    
    logind send the resume event for input devices and drm device,
    in any order. if we call vt_enter before logind resume the drm device,
    it leads to a driver error, because logind has not done the
    DRM_IOCTL_SET_MASTER on it.
    
    Keep the old workaround to make sure we call systemd_logind_vtenter at
    least once if there are no platform device
    
    Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    (cherry picked from commit f5bd039633fa8360a10bd2aabb0111571f6275b0)

commit 0ed7b1224ef17ff3d27e791e03e0d98dd6373c8a
Author: nerdopolis <bluescreen_avenger@verizon.net>
Date:   Fri Oct 8 21:51:43 2021 -0400

    xfree86: On Linux, while only seat0 can have TTYs, don't assmume all seat0s have TTYs
    
    (cherry picked from commit b8c12aac651d626c5120e6e8e18b42e7528caf43)

commit 6b997fb74e5c9473ee3989fca8d592a3a0d16067
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Sun Nov 7 01:33:56 2021 +0200

    xserver 21.1.1
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>

commit 70a0c48ff3bb7e3392035ef333cc5c8453508f33
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Sat Nov 6 20:09:48 2021 +0200

    Makefile.am: Add missing meson build files to release tarball

commit db0da823f55734baf4c1e4de680e7091f33aac17
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
Date:   Sun Oct 31 11:28:28 2021 +0100

    Make xf86CompatOutput() return NULL when there are no privates
    
    Some drivers (mach64 w/o DRI for instance) don't initialize privates.
    
    Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
    (cherry picked from commit 80eeff3ebac772e25c9107199989e677457dbe06)

commit fdb266ff814f6abb6ce006ecbac5ba78a92cdbca
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Tue Nov 2 14:04:08 2021 +0000

    s/__/@/ in inputtestdrv manpage
    
    Update manpage subsitution style for 2e497bf8
    
    (cherry picked from commit 0099412ea4347b02e61ea21946f309f2535cc07b)

commit 27a0ee32ccef8d621aaa758c804fc9a5ceeb5a56
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Wed Oct 27 13:36:45 2021 +0300

    xserver 21.1
    
    Signed-off-by: Povilas Kanapickas <povilas@radix.lt>

commit d4944ceda1727180bbee1c582b4ac0796c2748cc
Author: Mario Kleiner <mario.kleiner.de@gmail.com>
Date:   Mon Oct 18 08:14:04 2021 +0200

    Fix RandR leasing for more than 1 simultaneously active lease.
    
    Due to a switched order of parameters in the xorg_list_add()
    call inside ProcRRCreateLease(), adding a new lease for RandR
    output leasing does not actually add the new RRLeasePtr lease
    record to the list of existing leases for a X-Screen, but instead
    replaces the existing list with a new list that has the new lease
    as the only element, and probably leaks a bit of memory.
    
    Therefore the server "forgets" all active leases for a screen,
    except for the last added lease. If multiple leases are created
    in a session, then destruction of all leases but the last one
    will fail in many cases, e.g., during server shutdown in
    RRCloseScreen(), or resource destruction, e.g., in
    RRCrtcDestroyResource().
    
    Most importantly, it fails if a client simply close(fd)'es the
    DRM master descriptor to release a lease, quits, gets killed or
    crashes. In this case the kernel will destroy the lease and shut
    down the display output, then send a lease event via udev to the
    ddx, which e.g., in the modesetting-ddx will trigger a call to
    drmmode_validate_leases().
    
    That function is supposed to detect the released lease and tell
    the server to terminate the lease on the server side as well,
    via xf86CrtcLeaseTerminated(), but this doesn't happen for all
    the leases the server has forgotten. The end result is a dead
    video output, as the server won't reinitialize the crtc's
    corresponding to the terminated but forgotten lease.
    
    This bug was observed when using the amdvlk AMD OSS Vulkan
    driver and trying to lease multiple VKDisplay's, and also
    under Mesa radv, as both Mesa Vulkan/WSI/Display and amdvlk
    terminate leases by simply close()ing the lease fd, not by
    sending explicit RandR protocol requests to free leases.
    
    Leasing worked, but ending a session with multiple active
    leases ended in a lot of unpleasant darkness.
    
    Fixing the wrong argument order to xorg_list_add() fixes the
    problem. Tested on single-X-Screen and dual-X-Screen setups,
    with one, two or three active leases.
    
    Please merge this for the upcoming server 21.1 branch.
    Merging into server 1.20 would also make a lot of sense.
    
    Fixes: e4e3447603b5fd3a38a92c3f972396d1f81168ad
    Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
    Cc: Keith Packard <keithp@keithp.com>
    (cherry picked from commit f467f85ca1f780d5c7cf3c20888e399708d761ac)

commit e59faa4b8cc5aaa19474a5e7ca3a99d08006f8c5
Author: Povilas Kanapickas <povilas@radix.lt>
Date:   Thu Oct 14 17:33:40 2021 +0300

    xserver 21.1 RC 2

commit 3fb94f3c5ca73f15a78dbc6904380b9b9e402bf4
Author: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Date:   Fri Jul 23 09:23:45 2021 +0100

    dix/privates.c: Avoid undefined behaviour after realloc()
    
    Adding the offset between the realloc result and the old allocation to
    update pointers into the new allocation is undefined behaviour: the
    old pointers are no longer valid after realloc() according to the C
    standard. While this works on almost all architectures and compilers,
    it causes  problems on architectures that track pointer bounds (e.g.
    CHERI or Arm's Morello): the DevPrivateKey pointers will still have the
    bounds of the previous allocation and therefore any dereference will
    result in a run-time trap.
    
    I found this due to a crash (dereferencing an invalid capability) while
    trying to run `XVnc` on a CHERI-RISC-V system. With this commit I can
    successfully connect to the XVnc instance running inside a QEMU with a
    VNC viewer on my host.
    
    This also changes the check whether the allocation was moved to use
    uintptr_t instead of a pointer since according to the C standard:
    "The value of a pointer becomes indeterminate when the object it
    points to (or just past) reaches the end of its lifetime." Casting to an
    integer type avoids this undefined behaviour.
    
    Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
    (cherry picked from commit f9f705bf3cf0d169d54a70f235cc99e106dbda43)

commit b89fdd523e2c9e9b0cdf37b263833c4b0a8868b8
Author: nerdopolis <rbos@rbos>
Date:   Thu Sep 30 08:51:18 2021 -0400

    xf86: Accept devices with the 'simpledrm' driver.
    
    SimpleDRM 'devices' are a fallback device, and do not have a busid
    so they are getting skipped. This will allow simpledrm to work
    with the modesetting driver
    
    (cherry picked from commit b9218fadf3c09d83566549279d68886d8258f79c)

commit fbc690ccaf12d6536951d0ba403dfbb92c7c4115
Author: Mario Kleiner <mario.kleiner.de@gmail.com>
Date:   Fri Oct 1 09:47:41 2021 +0200

    modesetting: Consider RandR primary output for selectioh of sync crtc.
    
    The "sync crtc" is the crtc used to drive the display timing of a
    drawable under DRI2 and DRI3/Present. If a drawable intersects
    multiple video outputs, then normally the crtc is chosen which has
    the largest intersection area with the drawable.
    
    If multiple outputs / crtc's have exacty the same intersection
    area then the crtc chosen was simply the first one with maximum
    intersection. Iow. the choice was random, depending on plugging
    order of displays.
    
    This adds the ability to choose a preferred output in such a tie
    situation. The RandR output marked as "primary output" is chosen
    on such a tie.
    
    This new behaviour and its implementation is consistent with other
    video ddx drivers. See amdgpu-ddx, ati-ddx and nouveau-ddx for
    reference. This commit is a straightforward port from amdgpu-ddx.
    
    Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
    (cherry picked from commit 4b75e65766a9ef3a26d4c1c9d7af9fc6d1d7be5b)

commit 22f4ff1026eeffc566f87453d7f1f70dc23ad4e0
Author: Mario Kleiner <mario.kleiner.de@gmail.com>
Date:   Fri Oct 1 08:49:10 2021 +0200
