summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-02-09dix: Correctly save replayed event into GrabInfoRecPovilas Kanapickas3-3/+18
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>
2022-02-06meson: Remove config macros that are no longer usedPovilas Kanapickas1-5/+0
All of the macros in question are not used in current xserver sources. Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2022-02-06config/wscons: Always attach the "ws" driver for pointer devices,nia1-2/+2
rather than "mouse". Both OpenBSD and NetBSD (the only downstream users of this code) are both patching in this currently. Signed-off-by: Nia Alarie <nia@NetBSD.org>
2022-02-06config/wscons: Fix build and add support for NetBSDnia3-3/+14
Signed-off-by: Nia Alarie <nia@NetBSD.org>
2022-02-03xephyr: Don't check for SeatId anymorenerdopolis1-18/+16
After a change for the xserver to automatically determine the seat based on the XDG_SEAT variable, xephyr stopped working. This was because of an old feature where xephyr used to handle evdev directly. This was dropped some time ago, and now this check is not needed
2022-02-03xkb: fix XkbSetMap when changing a keysym without changing a keytypeSamuel Thibault1-6/+5
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>
2022-02-03dix: Hold input lock for AttachDevice()tholin1-0/+3
Fix the following race: Possible data race during read of size 8 at 0xA112510 by thread #6 Locks held: 1, at address 0x366B40 at 0x14C8B9: GetMaster (devices.c:2691) by 0x15CFC5: IsFloating (events.c:346) by 0x2B9554: miPointerGetScreen (mipointer.c:527) by 0x1A5136: xf86PostButtonEventM (xf86Xinput.c:1379) by 0x1A52BD: xf86PostButtonEvent (xf86Xinput.c:1345) by 0x485F45B: EvdevProcessEvent (in /usr/lib64/xorg/modules/input/evdev_drv.so) by 0x485FDAC: EvdevReadInput (in /usr/lib64/xorg/modules/input/evdev_drv.so) by 0x195427: xf86ReadInput (xf86Events.c:247) by 0x2CC113: InputReady (inputthread.c:180) by 0x2CE4EA: ospoll_wait (ospoll.c:657) by 0x2CC077: InputThreadDoWork (inputthread.c:369) by 0x484A336: mythread_wrapper (hg_intercepts.c:406) This conflicts with a previous write of size 8 by thread #1 Locks held: none at 0x14D2C6: AttachDevice (devices.c:2609) by 0x15CF85: ReattachToOldMaster (events.c:1457) by 0x1647DD: DeactivateKeyboardGrab (events.c:1700) by 0x25D7F1: ProcXIUngrabDevice (xigrabdev.c:169) by 0x2552AD: ProcIDispatch (extinit.c:398) by 0x155291: Dispatch (dispatch.c:479) by 0x158CBA: dix_main (main.c:276) by 0x143A3D: main (stubmain.c:34) Address 0xa112510 is 336 bytes inside a block of size 904 alloc'd at 0x4846571: calloc (vg_replace_malloc.c:1328) by 0x14A0B3: AddInputDevice (devices.c:260) by 0x1A31A0: xf86ActivateDevice (xf86Xinput.c:365) by 0x1A4549: xf86NewInputDevice (xf86Xinput.c:948) by 0x1A4B44: NewInputDeviceRequest (xf86Xinput.c:1090) by 0x1B81FE: device_added (udev.c:282) by 0x1B8516: config_udev_init (udev.c:439) by 0x1B7091: config_init (config.c:50) by 0x197970: InitInput (xf86Init.c:814) by 0x158C6B: dix_main (main.c:250) by 0x143A3D: main (stubmain.c:34) Block was alloc'd by thread #1 The steps to trigger the race are: 1. Main thread does cleanup at mipointer.c:360 setting the slave device's miPointerPtr to null. 2. Input thread use MIPOINTER in mipointer.c and get the slave's miPointerPtr = null. 3. Main thread updates dev->master at devices.c:2609. 4. MIPOINTER would now return the master's miPointerPtr but the input thread already got the slave's miPointerPtr in step 2 and segfaults by null ptr deref. Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1260 Signed-off-by: Thomas Lindroth <thomas.lindroth@gmail.com>
2022-01-29xf86: Accept devices with the 'hyperv_drm' driverThomas Zimmermann1-0/+3
Put in a workaround to accept devices of the kernel's hyperv_drm driver. Makes Xorg work on HyperV Gen 1/2 with the DRM graphics stack. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2022-01-25render: Fix build with gcc 12Olivier Fourdan1-4/+4
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
2022-01-19present: Check for NULL to prevent crashBłażej Szczygieł1-0/+6
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>
2022-01-18xwayland: Raise the FD limit to the maxOlivier Fourdan1-1/+36
Xwayland may open a fair amount of file descriptors for passing Wayland buffers, even more so when using the `wl_shm` either for the pointer cursors or for when GLAMOR is not usable. As a result, Xwayland may hit the (soft) limit of file descriptors leading to a Wayland protocol error and the termination of Xwayland. To mitigate that risk, raise the limit to the maximum (hard) limit of file descriptors (unless of course the limit was set explicitly from the command line with "-lf"). Note that for completeness, the Wayland compositor may have to do the same, otherwise the limit might get reached on the compositor side as well. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Suggested-by: Simon Ser <contact@emersion.fr> Acked-by: Michel Dänzer <mdaenzer@redhat.com> Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1283
2022-01-14xwayland/glx: Flip order of sRGB & non-sRGB fbconfigsMichel Dänzer1-5/+6
The sRGB ones came before the non-sRGB ones, which broke some clients. Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1225 Acked-by: Olivier Fourdan <ofourdan@redhat.com>
2021-12-24xwayland/present: Run fallback timer callback after more than a secondMichel Dänzer2-5/+26
If the Wayland compositor doesn't send a pending frame event, e.g. because the Wayland surface isn't visible anywhere, it could happen that the timer kept getting pushed back and never fired. This resulted in an enormous list of pending vblank events, which could take minutes to process when the frame event finally arrived. Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1110 Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> Tested-by: Jaap Buurman <jaapbuurman@gmail.com>
2021-12-20xf86/logind: fix missing call to vtenter if the platform device is not pausedJocelyn Falempe1-4/+13
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>
2021-12-20xf86/logind: Fix compilation error when built without logind/platform busJocelyn Falempe3-15/+14
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>
2021-12-19Convert more funcs to use InternalEvent.Matthieu Herrb3-29/+30
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>
2021-12-19Remove *-config.h.in which were only used by autotoolsPovilas Kanapickas6-962/+0
2021-12-19glx/dri: Filter out fbconfigs that don't have a supported pixmap formatAdam Jackson1-0/+20
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.
2021-12-17Fix spelling of XwaylandMichel Dänzer2-3/+3
There were just 3 outliers, let's try to prevent them from spreading.
2021-12-16hw/xfree86/os-support/solaris/sun_vid.c: Fix error messageAndrea Monaco1-1/+1
This is minor, but that error message says a wrong function name. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-14hw/xfree86: fix sbus build for SPARCSam James2-1/+5
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>
2021-12-14render: Fix out of bounds access in SProcRenderCompositeGlyphs()Povilas Kanapickas1-0/+9
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>
2021-12-14Xext: Fix out of bounds access in SProcScreenSaverSuspend()Povilas Kanapickas1-1/+1
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>
2021-12-14xfixes: Fix out of bounds access in *ProcXFixesCreatePointerBarrier()Povilas Kanapickas1-2/+4
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>
2021-12-14record: Fix out of bounds access in SwapCreateRegister()Povilas Kanapickas1-2/+2
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>
2021-12-10remove the PRE_RELEASE message.Matthieu Herrb1-13/+0
With the new numbering scheme, XORG_VERISON_SNAP doesn't mean a pre-release version anymore. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
2021-12-08test: #undef NDEBUG so assert is not compiled awayMatt Turner24-0/+72
2021-12-07Xwayland: implement drm-lease-v1Drew DeVault8-13/+608
This commit allows X11 clients running through Xwayland to lease non-desktop connectors from the Wayland compositor by implementing support for drm-lease-v1. In order to not deadlock with the Wayland compositor if its response to a lease request is delayed, the new interface in _rrScrPriv introduced in the last commit is used, which makes it possible to block the X11 client while a response is pending. Leasing normal outputs is not yet supported, all connectors offered for lease will be advertised as non-desktop. Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com> Reviewed-by: Simon Ser <contact@emersion.fr> Acked-by: Olivier Fourdan <ofourdan@redhat.com> Acked-by: Michel Dänzer <mdaenzer@redhat.com>
2021-12-07randr: add new interface to allow delaying lease responsesXaver Hugl3-5/+36
Add a new interface to _rrScrPriv to make it possible for the server to delay answering a lease request, at the cost of blocking the client. This is needed for implementing drm-lease-v1, as the Wayland protocol has no defined time table for responding to lease requests. Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com> Acked-by: Michel Dänzer <mdaenzer@redhat.com>
2021-12-07require wayland-protocols 1.22Xaver Hugl1-1/+1
This is needed for implementing drm-lease-v1 Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com> Acked-by: Michel Dänzer <mdaenzer@redhat.com>
2021-12-07Update the CI to provide wayland-protocols 1.22Xaver Hugl2-3/+3
This is needed for implementing drm-lease-v1 Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com> Acked-by: Michel Dänzer <mdaenzer@redhat.com>
2021-12-06Better fix for xf86CompatOut() when there are no privatesMatthieu Herrb1-2/+2
XF86_CRTC_CONFIG_PTR() will derefence privates[-1] in this case. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
2021-12-05Initialize Mode->name in xf86CVTMode()Matthieu Herrb1-0/+4
This was overlooked when converting the function to use libxcvt. Bring back name initialization from old code. This was causing a segfault in xf86LookupMode() if modes where name is NULL are present the modePool list. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
2021-12-04xwayland: Fix a race condition when setting up input devicesPovilas Kanapickas1-17/+59
The compositor may send us wl_seat and its capabilities before sending e.g. relative_pointer_manager or pointer_gesture interfaces. This would result in devices being created in capabilities handler, but listeners not, because the interfaces weren't available at the time. So we manually attempt to setup listeners again. Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-12-04xwayland: Implement support for touchpad gesturesPovilas Kanapickas4-0/+249
The implementation is relatively straightforward because both wayland and Xorg use libinput semantics for touchpad gestures. Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-12-03meson: Correctly set DDXOSVERRORF and DDXBEFORERESET on xwinPovilas Kanapickas1-0/+2
This worked with autotools, but not meson build system. Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-12-03glamor: fix free of uninitialised pointersJonathan Gray1-2/+2
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()")
2021-12-03xkb: fix XkbSetMap check for the keytypes countPeter Hutterer1-7/+6
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>
2021-12-02xwayland/eglstream: Prefer EGLstream if availableOlivier Fourdan1-6/+2
Currently, when given the choice, Xwayland will pick the GBM backend over the EGLstream backend if both are available, unless the command line option “-eglstream” is specified. The NVIDIA proprietary driver had no support for GBM until driver series 495, but starting with the driver series 495, both can be used. But there are other requirements with the rest of the stack, typically Mesa, egl-wayland, libglvnd as documented in the NVIDIA driver. So if the NVIDIA driver series 495 gets installed, Xwayland will pick the GBM backend even if EGLstream is available and may fail to render properly. To avoid that issue, prefer EGLstream if EGLstream and all the Wayland interfaces are available, and fallback to GBM automatically unless “-eglstream” was specified. With this, the compositor, given the choice, can decide which actual backend Xwayland would use by advertising (or not) the Wayland "wl_eglstream_controller" interface. This change has no impact on compositors which do not have support for EGLstream in the first place. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Acked-by: Michel Dänzer <mdaenzer@redhat.com>
2021-12-02xwayland/glamor: Log backend selected for debugOlivier Fourdan1-0/+2
Add (verbose) statements to trace the actual backend used with glamor. That can be useful for debugging. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2021-12-01xwayland/glamor: Change errors to verbose messagesOlivier Fourdan3-5/+9
On a normal startup sequence, the Xwayland glamor backend would log an error whenever a required Wayland protocol is missing. Those are not really errors though, more informational messages along the glamor backend selection process. Demote those errors to verbose messages to reduce the verbosity of Xwayland at startup by default. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2021-12-01xwayland/eglstream: Demote EGLstream device warningOlivier Fourdan1-1/+1
If no EGLstream capable device is found at startup, Xwayland's EGLstream backend will log an error message "glamor: No eglstream capable devices found". However, considering that the vast majority of drivers do not implement EGLstream, the lack of EGLstream capable device is more of the norm than the exception. Change the error message to a log verbose message. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Simon Ser <contact@emersion.fr> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2021-11-22xf86/logind: Fix drm_drop_master before vt_reldispJocelyn Falempe3-0/+27
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>
2021-11-22xf86/logind: fix call systemd_logind_vtenter after receiving drm device resumeJocelyn Falempe1-4/+6
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>
2021-11-16Revert "hw/xfree86: Propagate physical dimensions from DRM connector"Povilas Kanapickas3-28/+14
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>
2021-11-11dri2: add crocus to the list of va_gl usersDave Airlie1-1/+2
2021-11-08meson: Bump version after X server 21.1 branch offPovilas Kanapickas1-1/+1
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2021-11-06meson: add subproject fallback for libxcvtSimon Ser1-2/+2
Depends on: https://gitlab.freedesktop.org/xorg/lib/libxcvt/-/merge_requests/6 Signed-off-by: Simon Ser <contact@emersion.fr>
2021-11-06meson: use add_project_arguments instead of add_global_argumentsSimon Ser1-4/+4
add_global_arguments affects subprojects too. add_project_arguments only affects the current project. Signed-off-by: Simon Ser <contact@emersion.fr>
2021-11-06xfree86: On Linux, while only seat0 can have TTYs, don't assmume all seat0s ↵nerdopolis3-2/+21
have TTYs