Commit graph

9307 commits

Author SHA1 Message Date
Peter Hutterer
a29c8a352c modesetting: add NULL check for drmModeObjectGetProperties in VRR check
Co-Authored-by: Claude Code <noreply@anthropic.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2184>
2026-04-28 02:37:43 +00:00
Peter Hutterer
b67e0233e6 hw/xwayland: fix missing NULL checks in DRM lease allocation paths
Allocate first, then request so the cleanup path is simpler.

Co-Authored-by: Claude Code <noreply@anthropic.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2184>
2026-04-28 02:37:43 +00:00
Peter Hutterer
47002f8efc hw/xwayland: handle wl_array_add failure in keyboard_handle_key
wl_array_add() can return NULL, if that happens bail out and discard the
key event.

Co-Authored-by: Claude Code <noreply@anthropic.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2184>
2026-04-28 02:37:43 +00:00
Olivier Fourdan
756ccb5730 xwayland: Add a new command line option to enable selection bridge
Add a new commmand line option to enable the Xwayland
clipboard selection bridge when running in rootful mode.

By default, clipboard selection bridge is disabled to keep the default
of having Xwayland rootful running isolated from the rest of the
applications.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2139>
2026-04-27 14:24:04 +02:00
Olivier Fourdan
13b3930491 xwayland: Implement clipboard and primary selection
So that it is possible to copy and paste between Xwayland rootful and
other Wayland or even X11 clients outside of Xwayland.

Limitation: It does not support incremental transfer.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1873
Assisted-by: Cursor AI
Assisted-by: Claude Code <noreply@anthropic.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2139>
2026-04-27 14:24:04 +02:00
Olivier Fourdan
36ffe2b6e7 xwayland: Add primary selection and data device protocols
This is preparation work for the next commit.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2139>
2026-04-27 14:24:04 +02:00
Olivier Fourdan
b9f55422db xwayland: Add xwl_seat to the Xwayland types
For some reason, xwl_seat wasn't listed in the Xwayland types.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2139>
2026-04-27 14:24:04 +02:00
Olivier Fourdan
36f53145e4 xwayland: Avoid NULL pointer dereference in damage_report()
Commit 34934c37d6 restored calling register_damage() in
xwl_realize_window() before ensure_surface_for_window().

However if register_damage() succeeds and ensure_surface_for_window()
returns NULL, it would exit without "unregistering" the damage hook.

The X11 window, however, may still get damages reports, in which case
xwl_window_from_window() would return NULL, causing a NULL pointer
dereference in damage_report().

To avoid the issue, make sure we unregister the damage report if
ensure_surface_for_window() has failed, and add an early exit in
damage_report() if xwl_window is NULL.

v2: unregister_damage() unconditionally if ensure_surface_for_window()
    failed (Michel Dänzer)

Fixes: commit 34934c37d6 ("revert: register damage before ensure_surface_for_window")
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/work_items/1886
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2190>
2026-04-24 07:16:12 +00:00
Michel Dänzer
6357c9afce xwayland: Handle GetCurrentClient returning NULL in xwl_reparent_window
It's not the WM client in that case.

Fixes crash.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/work_items/1885
Fixes: 6aacf04f51 ("xwayland: Add heuristic for WM windows based on reparenting")
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2188>
2026-04-21 11:28:17 +00:00
Olivier Fourdan
c39b1591b2 xwayland: Do not use pointer crossing count for slave devices
Commit 0e08e5083 ("xwayland: prevent X11 get enter event when pointer is
over Wayland client") introduced a pointer crossing count to avoid
sending spurious pointer enter events when the pointer is withing a
Wayland native surface.

However, that change breaks tablet devices, as the pointer enter count
is only updated from the wl_pointer enter/leave events, a slave X11
device such as a tablet pointer would report a lost focus and the event
wrongly sent to the root window.

To avoid the issue, revert partially commit 0e08e5083 to return FALSE
as before for the slave devices. The rest of the logic from commit
0e08e5083 remains unchanged, so that we do not send spurious
XCrossingEvents for the pointer device when it's within a native Wayland
surface.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/work_items/1884
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2180>
2026-04-21 06:19:05 +00:00
Mikhail Dmitrichenko
c017c9ffeb vfb: use snprintf when writing XWD window name
The window name buffer after XWDFileHeader is fixed at
XWD_WINDOW_NAME_LEN (60 bytes).  sprintf could overflow when
hostname is close to maximum length and combined with the
prefix "Xvfb " + display + screen number.

Switch to snprintf to guarantee we never write beyond the
allocated buffer.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2172>
2026-04-15 23:38:29 +00:00
Alan Coopersmith
fea1757a58 xf86: drop no longer needed entries from default driver list for Intel
Now that the Intel driver is no longer the default case, we don't
need to maintain a long list of entries to override the default.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2168>
2026-04-11 18:05:19 +00:00
Olivier Fourdan
48bda9deb8 xwayland: Commit surface on configure event
Commit f5d8e112 introduced a regression, removing the call to
wl_surface_commit() except for the initial configure event.

That causes a massive GPU memory leak.

Fix the issue by restoring the wl_surface_commit() for all configure
events, as before commit f5d8e112.

Fixes: f5d8e112 ("xwayland: Avoid premature surface commit running rootfull")
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1877
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2153>
2026-04-09 08:52:39 +00:00
Pavel Ondračka
1c2e42c706 modesetting: byte-swap ARGB cursor uploads on big-endian
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2156>
2026-04-04 16:38:24 +00:00
Alan Coopersmith
c8655a856a Xvfb: handle allocation failure in vfbInstallColormap()
Reported in #1817:

xwayland-24.1.6/redhat-linux-build/../hw/vfb/InitOutput.c:416:13:
 warning[-Wanalyzer-possible-null-dereference]:
  dereference of possibly-NULL ‘ppix’

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2161>
2026-04-04 15:49:20 +00:00
Alan Coopersmith
a174db79e9 xf86: fix hotplug header include in platform_noop.c
In this branch, only hotplug.h exists, not hotplug_priv.h

Fixes: 79d39eabd ("xfree86: platform_noop: add missing functions")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2157>
2026-04-04 15:36:26 +00:00
Alan Coopersmith
5106461e31 meson: replace join_paths() with / operator
Requires meson 0.49.0, well below our current minimum of 0.60.0

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2150>
2026-03-28 10:02:41 -07:00
Alan Coopersmith
16ca2c7a11 meson: add install_tags to files meson couldnt guess on its own
Clears up a number of "Failed to guess install tag" messages from
meson-logs/meson-log.txt

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2149>
2026-03-28 16:54:18 +00:00
Jeremy Huddleston Sequoia
fbff1312ce xquartz: Bump copyrights in Info.plist to 2026
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2026-03-25 23:47:00 -07:00
Olivier Fourdan
0e580872b0 xwayland: Use viewport scale for warping coordinates
When Xwayland is used rootful with hidpi, a viewport is in effect and a
scale applied.

This is however "transparent" to the Xserver which uses unscaled
coordinates, so to set the fake cursor position with a viewport and a
scale applied, we need to factor the scale to the coordinates before
passing the coordinate to the Wayland compositor through the method
zwp_locked_pointer_v1_set_cursor_position_hint().

Failing to do that will introduce a shift when warping the cursor
position.

v2: Use an xwl_window instead of an xwl_seat to improve readability
(Michel)

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1875
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2145>
2026-03-23 08:19:50 +00:00
Diego Viola
7e7d1f027f treewide: fix typos
Signed-off-by: Diego Viola <diego.viola@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2138>
2026-03-14 16:52:19 +00:00
Alan Coopersmith
94acecdeaf ephyr: show that -name & -title take non-optional arguments in usage output
Fixes: f028e245a ("Bug #10016: Implement WM_CLASS hints in Xephyr.")
Fixes: e3c65cf1d ("xephyr: Add -title option.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2137>
2026-03-09 18:35:44 -07:00
Alan Coopersmith
0df19c5001 ephyr: add -name to Xephyr man page
Fixes: f028e245a ("Bug #10016: Implement WM_CLASS hints in Xephyr.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2137>
2026-03-09 18:35:33 -07:00
Alan Coopersmith
45607067cf ephyr: add -title to Xephyr man page
Fixes: e3c65cf1d ("xephyr: Add -title option.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2137>
2026-03-09 18:35:20 -07:00
Diego Viola
67c82078fe Restore correct spelling of "Avance Logic"
Fixes: e8f452231 ("Fix typos")
Signed-off-by: Diego Viola <diego.viola@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2136>
2026-03-03 09:13:24 -08:00
Michel Dänzer
c76d495612 Revert "xwayland: Call register_damage depending on ensure_surface_for_window"
There've been reports downstream of Xwayland segfaulting in the function
xwl_present_execute() because xwl_window_get_damage_region() returned an
invalid pointer:

 #10 RegionUninit at ../include/regionstr.h:165
 #11 RegionEmpty at ../include/regionstr.h:194
 #12 xwl_present_execute at ../hw/xwayland/xwayland-present.c:1138
 #13 xwl_present_pixmap at ../hw/xwayland/xwayland-present.c:1274
 #14 present_pixmap at ../present/present.c:249
 #15 proc_present_pixmap_common at ../present/present_request.c:166
 #16 proc_present_pixmap at ../present/present_request.c:186
 #17 Dispatch at ../dix/dispatch.c:550
 #18 dix_main at ../dix/main.c:277

The most likely reason for this is that window_get_damage() returned
NULL, which might happen if xwl_window_update_surface_window() didn't
call register_damage().

To avoid that issue, move the call to register_damage() back to
xwl_realize_window before calling ensure_surface_for_window().

This reverts commit 07f6032627.

See-also: https://bugzilla.redhat.com/2329815
See-also: https://bugzilla.redhat.com/2428249
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1862
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2135>
2026-03-03 14:05:15 +01:00
Michel Dänzer
0472d7389e xwayland: Use WindowPtr for damage closure again
This reverts commit d3448f7aad.

Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2135>
2026-03-03 14:02:49 +01:00
Michel Dänzer
ceb313f277 xwayland: Update surface window from xwl_unrealize_window
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2135>
2026-03-03 14:02:49 +01:00
Diego Viola
e8f4522312 Fix typos
Signed-off-by: Diego Viola <diego.viola@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2134>
2026-03-03 06:50:01 -03:00
Thomas Zimmermann
c12cf4f585 xf86: Accept devices with the kernel's corebootdrm driver
Add a workaround to accept devices of the kernel's corebootdrm
driver. Makes Xorg work on pre-configured displays with coreboot
and the DRM graphics stack. Review of the corebootdrm driver
happens at [1].

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/series/159820/ # [1]
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2132>
2026-02-28 02:09:35 +00:00
Alan Coopersmith
2e338890ee os: add a generic -verbose option instead of making each server add its own
Replaces Xwayland's server-specific implementation, but leaves Xorg's
since it sets global variables in the xfree86 ddx layer.  Also leaves
Xephyr's differently-spelled "-verbosity" for backwards compatibility.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2131>
2026-02-28 02:03:10 +00:00
Alan Coopersmith
12791f5027 xfree86: issue error if too many clocks entries are listed in config
Changes message issued for too many clocks from the confusing:
    "29.0" is not a valid keyword in this section.
to the more obvious:
    More than 128 Clocks defined.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2130>
2026-02-22 13:23:45 -08:00
Mario Limonciello
4ba1df3ce6 Add compatibility define for pci_device_is_boot_display()
It will take some time for a new libpciaccess to be released and
even then bumping the dependency for libpciaccess isn't attractive.
If an older libpciaccess is used just add a static inline define.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2038>
2026-02-22 07:36:50 -06:00
Mario Limonciello
41c58693c3 Add check for pci_device_linux_sysfs_boot_display()
In the case of multiple display devices that are not VGA devices
the 'boot_display' attribute read by libpciaccess can disambiguate.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2038>
2026-02-22 07:36:45 -06:00
Julian Orth
aaa8d5a955 xwayland: don't allow clients to modify the keymap
Xwayland has no way to affect the keymap of the compositor. If clients
modify the keymap, it will stay out of sync with the compositor until
some unspecified time in the future when the compositor sends the keymap
again, which might be never, requiring Xwayland to be restarted.

Signed-off-by: Julian Orth <ju.orth@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1953>
2026-02-19 13:52:28 +01:00
Jon Turney
9c35efe978 hw/xwin: Allow DefWindowProc to SetFocus() as needed after WM_ACTIVE
Don't indicate we've processed WM_ACTIVATE, so DefWindowProc can do
not-clearly specified default things with the focus.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/736>
2026-02-15 18:58:01 +00:00
Jon Turney
64d7a6b4a0 hw/xwin: More adjustments to multiwindow mode focus handling
The previous change is not enough, as WM_KILLFOCUS can apparently be
sent to the window losing focus after WM_ACTIVATE has been sent to
the window gaining focus.

Try using WM_SETFOCUS instead, as that has the correct ordering and seems
more logical.

The test "!pWin || !pWin->overrideRedirect" is confusingly written: It's
true if:

(a) pWin is NULL (= X window doesn't exist, shouldn't happen), or
(b) pWin->overrideRedirect is FALSE

i.e. the intended effect is "don't give focus to override redirect windows"

There seem to be some cases where this still isn't quite correct: A
reproduction isn't known, but it seems to be related to minimizing a
maximized Windows window, and having window activation move to a
maximized X window beneath it.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/736>
2026-02-15 18:58:01 +00:00
Jon Turney
d7d2dd8286 hw/xwin: Always set the X input focus to none when an X window loses focus
In the multiwindow WM, we need to cancel the X input focus if the
Windows input focus has gone to the desktop, or another application's
window.

We could maybe avoid some unneeded work by not doing this if the
WM_KILLFOCUS wParam is another window owned by us, which is immediately
going to be given the X input focus.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/736>
2026-02-15 18:58:00 +00:00
Jon Turney
1afb9c6a7c hw/xwin: Use revert-to-parent X focus mode in multiwindow WM
Use revert-to-parent X focus mode, as recommended in ICCCM 4.1.7

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/736>
2026-02-15 18:58:00 +00:00
Benjamin Valentin
907c501926 xf86: check return value of XF86_CRTC_CONFIG_PTR in xf86CompatOutput()
If privates[xf86CrtcConfigPrivateIndex].ptr is NULL, this will cause
a segfault.

Possible fix for !1241

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/835>
2026-02-15 18:34:26 +00:00
Edênis Freindorfer Azevedo
444822f7c1 Support XDG Base Dir Spec 0.8.
This version of the spec (latest as of 27.12.2021) adds a variable
`$XDG_STATE_HOME` that may be used for log files, as described:

```
...
$XDG_STATE_HOME defines the base directory relative to which user-specific
state files should be stored. If $XDG_STATE_HOME is either not set or
empty, a default equal to $HOME/.local/state should be used.

The $XDG_STATE_HOME contains state data that should persist between
(application) restarts, but that is not important or portable enough to
the user that it should be stored in $XDG_DATA_HOME. It may contain:

actions history (logs, history, recently used files, …)
...
```

- https://specifications.freedesktop.org/basedir/0.8/

Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/836>
2026-02-15 10:15:19 -08:00
Dongwon Kim
2114016ea0 modesetting: Empty damage once dispatch is done
This commit is to fix some regression caused by

commit 995e60a919

where DamageEmpty on damage was missing in several
places.

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1486>
2026-02-15 01:28:48 +00:00
Patrick Lerda
5582e45d94 modesetting: find the first compatible dri device as default
This change replaces the default "/dev/dri/card0" by a loop which
searches for the first compatible device.

This change avoids the error below which happens on some ARM boards:
(EE) No devices detected.
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1496>
2026-02-14 17:19:52 -08:00
Sultan Alsawaf
4689e5744e modesetting: Don't recursively force present to unflip
Present calls drmmode_set_mode_major() as part of ms_present_unflip(),
which leads to a crash due to the recursive attempt to force present to
unflip when it already is.

Fix it by simply skipping the forced present unflip when present itself is
unflipping. This also speeds up drmmmode_prepare_modeset() when present
isn't even flipping to begin with.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1791
Fixes: 899c87af1 ("modesetting: unflip before any setcrtc() calls")
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1793>
2026-02-14 16:04:01 -08:00
Thomas Zimmermann
34a53a5746 xf86: Accept devices with the kernel's vesadrm driver
Add a workaround to accept devices of the kernel's vesadrm driver.
Makes Xorg work on pre-configured displays with VESA and the DRM
graphics stack. Review of the vesadrm driver happens at [1].

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/series/146477/ # 1
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1879>
2026-02-14 23:39:34 +00:00
Thomas Zimmermann
b6b7218aed xf86: Accept devices with the kernel's efidrm driver
Add a workaround to accept devices of the kernel's efidrm driver.
Makes Xorg work on pre-configured displays with UEFI and the DRM
graphics stack. Review of the efidrm driver happens at [1].

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/series/146477/ # 1
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1879>
2026-02-14 23:39:34 +00:00
Timo Aaltonen
e45516afa6 xf86pciBus.c: use Intel ddx only for pre-gen3 hardware
Use intel ddx only on pre-gen4 hw, newer ones will fall back to modesetting.

Instead of defaulting to the Intel driver for all Intel hardware, only
default it for older hardware for which it has shown to be better for.

Note that Debian/Fedora and their derivatives, as well as the yocto project
have been carrying this patch for many years:
192254841a
ee515e44b0

so this simply aligns xserver upstream with Linux distributions.

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Co-authored-by: Balló György <ballogyor@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1887>
2026-02-14 23:33:49 +00:00
Icenowy Zheng
febc30a75b modesetting: properly use fb_id of front_bo for reverse PRIME CRTC
When doing reverse PRIME, the buffer being scaned out is still the front
BO.

Properly reuse its fb_id, to prevent adding a FB for the front_bo each
time the fb_id is requested.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2064>
2026-02-14 14:28:20 -08:00
Qiang Yu
3d5c955337 modesetting: fix PRESENT_FLIP_REASON_BUFFER_FORMAT gets overwritten
When dmabuf_capable is enabled, ms_present_check_unflip may return
with reason PRESENT_FLIP_REASON_BUFFER_FORMAT to be reported back
to client by PresentCompleteModeSuboptimalCopy. We should not
overwrite it by page flip reasons anyway when exit.

This fix also avoid changing vblank->exec_msc in present_scmd_pixmap()
which caused by page flip reasons to prevent a present to be executed
immediatly. So that we can cancel pending vblanks when new vblanks with
same msc arrive. This happens when application just starts.

This problem can be observed at least using radeonsi OGL driver, start
xserver with dmabuf_capable enabled, no window manager, glxgears will
stuck for the first several seconds. If using a composite window manager
like Mutter, we can't observe the glxgears stuck, but the prensent
complete event still shows unexpected Copy mode instead of
PresentCompleteModeSuboptimalCopy or Skip mode.

glxgears window msc is 0 at the beginning, it will send present request
with target msc = 1, 2, 3, ... N before server send back the complete
event for target msc = 1. But server side window msc is way bigger than N,
so it will think all these present requests are outdated and just show the
Nth request at the next vblank. [1 .. N-1] requests should be skipped.
But without this fix, all [1 .. N] presents will be executed with Copy
mode which causes stuck.

Fixes: a94dd9536 ("modesetting: add support for TearFree page flips")
Reviewed-by: Sultan Alsawaf <sultan@kerneltoast.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2091>
2026-02-14 20:48:29 +00:00
Alan Coopersmith
3eaaa35849 xfree86: remove leftover ev56.c source files
Commit 166ac294a replaced the function calls in these files with inline
functions in compiler.h and updated the configure scripts & meson builds
to stop compiling them, but missed actually removing the now unused sources.

Fixes: 166ac294a ("xfree86: Inline xf86{Read,Write}Mmio{8,16,32} on alpha")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2122>
2026-02-14 10:00:51 -08:00