Commit graph xserver/hw/xfree86/drivers/video/modesetting/driver.h
Author SHA1 Message Date
Herman Semenoff
08619070f8 modesetting: fix crash on flip queue retry and use-after-free in drm event queue
сheck for non-retryable errors (errno != EBUSY/EAGAIN) in do_queue_flip_on_crtc to prevent invalid retry and event flush loops
I find in drm events and prevent use-after-free in ms_drm_sequence_handler and ms_drm_abort_scrn by safely restarting queue iteration when event callbacks modify DRM queue
Marks page flip sequences with kernel_queued upon successful submission to prevent premature freeing of queue entries

Affected issues:
- https://github.com/X11Libre/xserver/issues/1200
- https://github.com/X11Libre/xserver/issues/2174
- https://github.com/X11Libre/xserver/issues/3432

Signed-off-by: Herman Semenoff <GermanAizek@yandex.ru>
2026-10-21 01:24:14 +03:00
Enrico Weigelt, metux IT consult
a79d0cf1c9 xfree86: parentheses around macro argument symbols
For safety, add extra parantheses on each used macro argument.
In most cases not strictly necessary, but better have some strict
and automatically enforcable policy here than wasting time on
judging individual cases.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-24 09:11:12 +02:00
stefan11111
b756fea016 modesetting: Port modesetting to glamor_egl_init2
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2026-05-05 16:05:07 +02:00
stefan11111
b7bf58922f modesetting: Check for GLAMOR instead of GLAMOR_HAS_GBM
Now gbm required for the modesetting driver.
`GLAMOR_HAS_GBM` is defined even if glamor isn't built.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2026-02-09 14:19:16 +01:00
Ville Syrjälä
d3ec45f01c modesetting: Use IN_FORMATS_ASYNC for async flips
Use the IN_FORMATS_ASYNC blob (as opposed to the normal
IN_FORMATS blob) to determine which formats/modifiers are
supported. This will allow the client to allocate buffers
which can actually be async flipped.

In order to guarantee that the most optimal modifier is
always used we also need to force a modifier renegotiation
when swicthing between sync and async flips. Otherwise eg.
sync flips might end up using a less optimal sync+async
modifier instead of a more optimal sync-only modifier.

Signed-off-by: notbabaisyou <though-went-some-simple@proton.me>
Link: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1816
2025-11-06 15:56:07 +01:00
stefan11111
8b8cde2cb2 modesetting: add "CursorSize" option
Some checks are pending
Build X servers / xserver-build-ubuntu (push) Waiting to run
Build X servers / drivers-build-ubuntu (push) Waiting to run
Build X servers / xserver-build-mingw32-ubuntu (push) Waiting to run
Build X servers / xserver-build-macos (push) Waiting to run
Build X servers / xserver-build-freebsd (push) Waiting to run
Build X servers / xserver-build-dragonflybsd (push) Waiting to run
Build X servers / Release pushed tag (push) Blocked by required conditions
check PRs for merge conflicts / notify (push) Waiting to run
delete old workflow runs / delete_old_workflow_runs (push) Waiting to run
delete old workflow runs / purge_deleted_branch_workflows (push) Waiting to run
On certain setups, it might still be useful to force a particular cursor
size via xorg.conf.
For example, if on a system the automatic probes fail, or if the user wants
a particular cursor size, that is higher that the minimum size.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-21 16:12:46 +02:00
stefan11111
036432980b modesetting: Initialize the cursor image with the smallest size supported by all CRTCs.
Some checks are pending
Build X servers / xserver-build-ubuntu (push) Waiting to run
Build X servers / drivers-build-ubuntu (push) Waiting to run
Build X servers / xserver-build-mingw32-ubuntu (push) Waiting to run
Build X servers / xserver-build-macos (push) Waiting to run
Build X servers / xserver-build-freebsd (push) Waiting to run
Build X servers / xserver-build-dragonflybsd (push) Waiting to run
Build X servers / Release pushed tag (push) Blocked by required conditions
check PRs for merge conflicts / notify (push) Waiting to run
delete old workflow runs / delete_old_workflow_runs (push) Waiting to run
delete old workflow runs / purge_deleted_branch_workflows (push) Waiting to run
We try to find the smallest size we can use for the cursor image.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-13 14:01:04 +02:00
notbabaisyou
e6c980f08e hw/modesetting: Fix up cursor size probing.
Some checks are pending
Build X servers / xserver-build-ubuntu (push) Waiting to run
Build X servers / drivers-build-ubuntu (push) Waiting to run
Build X servers / xserver-build-mingw32-ubuntu (push) Waiting to run
Build X servers / xserver-build-macos (push) Waiting to run
Build X servers / xserver-build-freebsd (push) Waiting to run
Build X servers / Release pushed tag (push) Blocked by required conditions
check PRs for merge conflicts / notify (push) Waiting to run
modesetting has a sort of broken concept of getting the cursor dimensions since 1f41320e1c, which causes issues on virtual machines and older AMD hardware. Our solution is to use SIZE_HINTS which is available in i915 since 2023 otherwise fallback to getting the cursor size provided by the driver, if a driver wants to have a more optimal cursor size, it is more than welcome to implement SIZE_HINTS in it's DRM interface.

Taken from my own fork of Xorg.

v2: Fix some bugs in the implemenation.
2025-08-28 16:56:25 +02:00
Enrico Weigelt, metux IT consult
34c3a9c7e2 treewide: fix serverGeneration int type mismatch
The global (exported) serverGeneration field is `unsigned long`, while
many other places copy it and compare it two other integer types, eg.
plain `int` (which is signed). Even if it's unlikely ever reaching such
high number of generations that it will ever make trouble, it's still
a good idea to clean this up and use the same type everywhere.

For clearity, introducing a typedef `x_server_generation_t` which is
used everywhere, instead of raw `unsigned long`.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:52:03 +02:00
Enrico Weigelt, metux IT consult
baa36c8a39 xfree86: drivers: move modesetting into video subdir
In preparation of potentially more drivers being move in-tree,
put the video drivers into `video` subdirectory.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 17:54:22 +02:00
Renamed from hw/xfree86/drivers/modesetting/driver.h (Browse further)