Find a file
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
.gitlab-ci xwayland/ci: Enforce various code style checks 2026-01-25 11:47:31 -08:00
composite composite: Skip copying parent pixmap contents when possible 2026-02-14 12:37:18 -08:00
config Strip trailing whitespace from source files 2026-01-25 10:40:02 -08:00
damageext damage: drop swapping request length fields 2026-01-25 10:39:59 -08:00
dbe dbe: fix byte swapping in SProcDbeSwapBuffers() 2026-01-25 10:40:00 -08:00
dix dix: avoid null ptr deref at doListFontsAndAliases 2026-02-14 18:55:55 +00:00
doc Strip trailing whitespace from source files 2026-01-25 10:40:02 -08:00
dri3 dri: prevent out-of-bounds read in dri3_fd_from_pixmap 2026-01-25 10:40:03 -08:00
exa Move sizeof to second argument in calloc calls 2026-01-25 10:39:55 -08:00
fb Strip trailing whitespace from source files 2026-01-25 10:40:02 -08:00
glamor glamor: fix Option "GlxVendorLibrary" 2026-01-25 10:40:03 -08:00
glx glx: Don't blindly write 8 bytes in GLX single replies 2026-01-25 10:40:02 -08:00
hw modesetting: fix PRESENT_FLIP_REASON_BUFFER_FORMAT gets overwritten 2026-02-14 20:48:29 +00:00
include xkb: Make the RT_XKBCLIENT resource private 2026-01-25 10:40:03 -08:00
man man pages: strip trailing whitespace 2026-01-25 10:40:01 -08:00
mi mi: use common implementation of bit counting function 2026-01-25 10:40:01 -08:00
miext Strip trailing whitespace from source files 2026-01-25 10:40:02 -08:00
os os: make FormatInt64() handle LONG_MIN correctly 2026-01-25 10:40:03 -08:00
present present: Fix use-after-free in present_create_notifies() 2026-01-25 10:40:03 -08:00
pseudoramiX pseudoramiX: drop swapping request length fields 2026-01-25 10:39:58 -08:00
randr Strip trailing whitespace from source files 2026-01-25 10:40:02 -08:00
record Strip trailing whitespace from source files 2026-01-25 10:40:02 -08:00
render render: fix multiple mem leaks on err paths 2026-02-14 18:50:30 +00:00
test Strip trailing whitespace from source files 2026-01-25 10:40:02 -08:00
Xext Xext/xtest: avoid null dereference in ProcXTestFakeInput() 2026-01-25 10:40:03 -08:00
xfixes xfixes: Check request length for SetClientDisconnectMode 2026-01-25 10:40:01 -08:00
Xi Xi: handle allocation failure in add_master_func() 2026-01-25 10:40:03 -08:00
xkb xkb: Fix locked/latched indicator desync across multiple keyboards 2026-02-01 17:53:18 -08:00
.appveyor.yml appveyor: Add libxcvt build dep 2021-11-04 13:03:25 +00:00
.dir-locals.el .dir-locals.el: Add missing final newline 2019-10-01 17:05:28 +00:00
.git-blame-ignore-revs Ignore the coding style change commit during git blame 2026-01-25 10:39:58 -08:00
.gitignore Clean up the .gitignore file 2024-01-12 00:50:24 +00:00
.gitlab-ci.yml xwayland/ci: Enforce various code style checks 2026-01-25 11:47:31 -08:00
.mailmap Update mailmap for Peter Harris 2026-01-25 10:40:01 -08:00
.travis.yml travis: Add OSX meson build to matrix 2019-05-02 15:42:58 +00:00
COPYING COPYING: add author to HPND-sell-MIT-disclaimer-xserver 2026-02-14 20:27:44 +00:00
meson.build meson.build: include Xephyr in output of which ddx we're building 2026-01-25 10:40:02 -08:00
meson_options.txt os: drop SUN-DES-1 authentication 2026-01-25 10:39:53 -08:00
README.md Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
SECURITY.md Create a SECURITY.md file 2026-01-25 10:40:03 -08:00
xorg-server.m4 Strip trailing whitespace from source files 2026-01-25 10:40:02 -08:00
xorg-server.pc.in pkgconfig files: Add URL 2026-01-25 10:40:01 -08:00
xserver.ent.in doc: relocate xserver.ent in the package root directory 2011-05-14 11:22:26 -07:00

X Server

The X server accepts requests from client applications to create windows, which are (normally rectangular) "virtual screens" that the client program can draw into.

Windows are then composed on the actual screen by the X server (or by a separate composite manager) as directed by the window manager, which usually communicates with the user via graphical controls such as buttons and draggable titlebars and borders.

For a comprehensive overview of X Server and X Window System, consult the following article: https://en.wikipedia.org/wiki/X_server

All questions regarding this software should be directed at the Xorg mailing list:

https://lists.freedesktop.org/mailman/listinfo/xorg

The primary development code repository can be found at:

https://gitlab.freedesktop.org/xorg/xserver

For patch submission instructions, see:

https://www.x.org/wiki/Development/Documentation/SubmittingPatches

As with other projects hosted on freedesktop.org, X.Org follows its Code of Conduct, based on the Contributor Covenant. Please conduct yourself in a respectful and civilized manner when using the above mailing lists, bug trackers, etc:

https://www.freedesktop.org/wiki/CodeOfConduct