From 4f0273e5e66b0dd5917c4273d7f0ecaef1ecd146 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Tue, 31 Mar 2026 13:50:05 +0200 Subject: [PATCH] =?UTF-8?q?wayland:=20fix=20SHM=20buffer=20format=20?= =?UTF-8?q?=E2=80=94=20DRM=5FFORMAT=5FARGB8888=20not=20WL=5FSHM=5FFORMAT?= =?UTF-8?q?=5FARGB8888?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WL_SHM_FORMAT_ARGB8888 == 0, which the DRM/GLES2 renderer interprets as DRM_FORMAT_INVALID. This caused: - "Unsupported pixel format 0x0" on the first frame upload attempt - wlr_texture_from_buffer assertion failure when the scene renderer retried the upload lazily during an active render pass Use DRM_FORMAT_ARGB8888 (0x34325241) from instead. Texture creation now succeeds at wlr_scene_buffer_set_buffer time, so the lazy path is never reached. Verified: steel-blue test square visible in nested Sway session; smoke test PASS. Co-Authored-By: Claude Sonnet 4.6 --- src/backend/wayland/wl_backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index ac99a42..cab478e 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -130,6 +130,7 @@ #include /* Phase 18: scene graph compositing */ #include /* Phase 18: buffer allocator */ #include /* Phase 29+: WM-owned SHM surface buffers */ +#include /* Phase 29+: DRM_FORMAT_ARGB8888 */ #include /* Phase 29+: software pixel rendering */ #include /* Phase 23: hardware cursor tracking */ #include /* Phase 23: xcursor theme */ @@ -2421,7 +2422,7 @@ shm_buf_begin_data_ptr(struct wlr_buffer *buf, uint32_t flags, struct wm_shm_surface *s = wl_container_of(buf, s, wlr_buf); (void)flags; *out_data = s->data; - *out_fmt = WL_SHM_FORMAT_ARGB8888; + *out_fmt = DRM_FORMAT_ARGB8888; *out_stride = s->stride; return true; }