From 48aa5decef4db82092617e720b758a3a6f956bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 6 Apr 2026 15:19:59 +0200 Subject: [PATCH] wayland: shm: included decoded fourcc name when logging shm formats --- wayland.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/wayland.c b/wayland.c index 1ffd62a6..246a5ceb 100644 --- a/wayland.c +++ b/wayland.c @@ -1,5 +1,6 @@ #include "wayland.h" +#include #include #include #include @@ -247,17 +248,32 @@ shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) #if defined(_DEBUG) bool have_description = false; + const char c4 = (format >> 24) & 0xff; + const char c3 = (format >> 16) & 0xff; + const char c2 = (format >> 8) & 0xff; + const char c1 = (format >> 0) & 0xff; for (size_t i = 0; i < ALEN(shm_formats); i++) { if (shm_formats[i].format == format) { - LOG_DBG("shm: 0x%08x: %s", format, shm_formats[i].description); + LOG_DBG("shm: 0x%08x: %c%c%c%c - %s", + format, + isprint(c1) ? c1 : ' ', + isprint(c2) ? c2 : ' ', + isprint(c3) ? c3 : ' ', + isprint(c4) ? c4 : ' ', + shm_formats[i].description); have_description = true; break; } } if (!have_description) - LOG_DBG("shm: 0x%08x: unknown", format); + LOG_DBG("shm: 0x%08x: %c%c%c%c - unknown", + format, + isprint(c1) ? c1 : ' ', + isprint(c2) ? c2 : ' ', + isprint(c3) ? c3 : ' ', + isprint(c4) ? c4 : ' '); #endif }