wlroots/backend
Simon Ser af445f475a backend/drm: fix queued cursor FB overwritten with NULL
With the following sequence of events, the cursor FB fields could
end up being all set to NULL while the cursor is enabled:

1. set_cursor is called, conn->cursor_pending_fb is set to a FB
   pointer.
2. The output is committed with a buffer. crtc->cursor->queued_fb
   is set to the FB pointer, conn->cursor_pending_fb is reset to
   NULL. A page-flip event is expected in the future.
3. The output is committed with a modeset before the page-flip
   event is triggered. crtc->cursor->queued_fb is reset to NULL.

At this point all of crtc->cursor->current_fb,
crtc->cursor->queued_fb and conn->cursor_pending_fb are NULL which
is a bogus state when the cursor plane is enabled.

To avoid this issue, avoid overwriting crtc->cursor->queued_fb
with a NULL pointer on commit. The cursor logic still isn't great,
but let's keep a rework of that for a separate patch.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3734
(cherry picked from commit f5889319f7)
2024-03-03 20:41:23 -05:00
..
drm backend/drm: fix queued cursor FB overwritten with NULL 2024-03-03 20:41:23 -05:00
headless treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practical 2023-10-03 01:51:07 -04:00
libinput backend: fix build against upcoming gcc-14 (-Werror=calloc-transposed-args) 2024-01-24 09:24:20 -05:00
multi backend: drop wlr_backend_get_presentation_clock() 2023-10-30 18:39:39 +01:00
session backend/session: make optional 2022-11-25 16:15:29 +00:00
wayland backend: drop wlr_backend_get_presentation_clock() 2023-10-30 18:39:39 +01:00
x11 backend/x11: check buffer format in output_test() 2023-11-28 10:36:10 -05:00
backend.c backend: drop wlr_backend_get_presentation_clock() 2023-10-30 18:39:39 +01:00
meson.build backend/session: make optional 2022-11-25 16:15:29 +00:00