diff --git a/src/backends/drm/egl_gbm_backend.cpp b/src/backends/drm/egl_gbm_backend.cpp index 368ca53e0b..ec64ea2426 100644 --- a/src/backends/drm/egl_gbm_backend.cpp +++ b/src/backends/drm/egl_gbm_backend.cpp @@ -552,6 +552,10 @@ bool EglGbmBackend::doesRenderFit(const Output &output, const Output::RenderData if (output.forceXrgb8888 && render.gbmSurface->format() != DRM_FORMAT_XRGB8888) { return false; } + if (!output.output->isFormatSupported(render.gbmSurface->format()) + || output.output->supportedModifiers(render.gbmSurface->format()) != render.gbmSurface->modifiers()) { + return false; + } QSize surfaceSize = output.output->bufferSize(); if (surfaceSize != render.gbmSurface->size()) { return false; diff --git a/src/backends/drm/gbm_surface.cpp b/src/backends/drm/gbm_surface.cpp index 595c7da4bd..c0248c10e4 100644 --- a/src/backends/drm/gbm_surface.cpp +++ b/src/backends/drm/gbm_surface.cpp @@ -40,6 +40,7 @@ GbmSurface::GbmSurface(DrmGpu *gpu, const QSize &size, uint32_t format, QVector< , m_gpu(gpu) , m_size(size) , m_format(format) + , m_modifiers(modifiers) { if (!m_surface) { qCCritical(KWIN_DRM) << "Could not create gbm surface!" << strerror(errno); @@ -138,4 +139,9 @@ uint32_t GbmSurface::format() const return m_format; } +QVector GbmSurface::modifiers() const +{ + return m_modifiers; +} + } diff --git a/src/backends/drm/gbm_surface.h b/src/backends/drm/gbm_surface.h index 60c1420b41..f2e8a51f1c 100644 --- a/src/backends/drm/gbm_surface.h +++ b/src/backends/drm/gbm_surface.h @@ -40,6 +40,7 @@ public: QSize size() const; bool isValid() const; uint32_t format() const; + QVector modifiers() const; private: gbm_surface *m_surface; @@ -47,6 +48,7 @@ private: EGLSurface m_eglSurface = EGL_NO_SURFACE; QSize m_size; const uint32_t m_format; + const QVector m_modifiers; QSharedPointer m_currentBuffer; QSharedPointer m_currentDrmBuffer;