From 68d1e2f42a51bb0f779488b06ba721a6db462487 Mon Sep 17 00:00:00 2001 From: Aleix Pol Gonzalez Date: Wed, 5 Jun 2024 17:08:55 +0200 Subject: [PATCH] wayland: Log an entry when an unsupported buffer was submitted It's fine to be conservative about what kind of buffers we support, but failing silently only makes it hard on such cases. Signed-off-by: Victoria Fischer --- .../scenes/opengl/basiceglsurfacetexture_wayland.cpp | 3 +++ src/wayland/display.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.cpp b/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.cpp index 44bb8604b9..022626cda7 100644 --- a/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.cpp +++ b/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.cpp @@ -41,6 +41,7 @@ bool BasicEGLSurfaceTextureWayland::create() } else if (m_pixmap->buffer()->shmAttributes()) { return loadShmTexture(m_pixmap->buffer()); } else { + qCDebug(KWIN_OPENGL) << "Failed to create BasicEGLSurfaceTextureWayland for a buffer of unknown type" << m_pixmap->buffer(); return false; } } @@ -57,6 +58,8 @@ void BasicEGLSurfaceTextureWayland::update(const QRegion ®ion) updateDmabufTexture(m_pixmap->buffer()); } else if (m_pixmap->buffer()->shmAttributes()) { updateShmTexture(m_pixmap->buffer(), region); + } else { + qCDebug(KWIN_OPENGL) << "Failed to update BasicEGLSurfaceTextureWayland for a buffer of unknown type" << m_pixmap->buffer(); } } diff --git a/src/wayland/display.cpp b/src/wayland/display.cpp index cbf95f103f..82b7d09324 100644 --- a/src/wayland/display.cpp +++ b/src/wayland/display.cpp @@ -238,6 +238,7 @@ GraphicsBuffer *Display::bufferForResource(wl_resource *resource) } else if (auto buffer = ShmClientBuffer::get(resource)) { return buffer; } else { + Q_ASSERT_X(false, Q_FUNC_INFO, "Failed to find matching GraphicsBuffer for wl_resource"); return nullptr; } }