wlroots/include
Jonathan Marler 002659e6f4 backend/x11: add SHM readback fallback when buffer import fails
On some NVIDIA systems, the DRI3 modifier list only advertises
DRM_FORMAT_MOD_INVALID while the renderer requires a specific
modifier (e.g. BLOCK_LINEAR). As a result, the X11 backend cannot
import renderer buffers via DRI3 and output commits fail.

Allow the renderer to allocate buffers with its preferred modifier
when DRI3 doesn't expose explicit modifiers. If buffer import fails,
fall back to CPU readback: read pixels from the rendered texture into
shared memory and upload the result to a pixmap via xcb_shm_put_image
before presenting it.

This ensures the X11 backend can still produce output even when the
X server cannot import the renderer's buffers.

While implementing this fallback, split the existing SHM capability
flag into two:

  have_shm: SHM extension available (required for readback fallback)
  have_shm_pixmaps: server supports shared pixmaps

Also fix the SHM version check which incorrectly used || instead of
a proper >= 1.2 comparison.

Tested with labwc 0.9.5 (WLR_BACKENDS=x11) on Ubuntu 24.04 with an
NVIDIA GeForce GTX 1650 (driver 580.126.18), where output commits
previously failed with "Failed to commit frame".
2026-03-10 18:58:56 -06:00
..
backend backend/x11: add SHM readback fallback when buffer import fails 2026-03-10 18:58:56 -06:00
interfaces types/wlr_input_device: move init and finish function to private API 2022-03-07 16:37:41 +00:00
render render/vulkan: relax minimum Vulkan API version to 1.0 2026-03-06 15:45:05 +01:00
types types/wlr_buffer: add buffer_get_drm_format helper function 2026-02-06 13:53:46 +00:00
util util/mem: Move memdup to new util/mem.c file 2025-07-17 16:39:58 +01:00
wlr util/box: Add wlr_box_intersects 2026-03-09 22:09:40 +00:00
xcursor Add some missing includes/declarations 2023-06-05 21:06:19 +00:00
xwayland treewide: make type-check helpers take const pointers 2026-03-06 16:04:21 +08:00
meson.build render/color: add fallback stub when LCMS2 is disabled 2024-06-04 17:45:51 +00:00