diff --git a/src/backends/drm/drm_egl_layer_surface.cpp b/src/backends/drm/drm_egl_layer_surface.cpp index cd36fd3900..219334a26d 100644 --- a/src/backends/drm/drm_egl_layer_surface.cpp +++ b/src/backends/drm/drm_egl_layer_surface.cpp @@ -216,7 +216,7 @@ bool EglGbmLayerSurface::doesSurfaceFit(const Surface &surface, const QSize &siz return surface.gbmSurface && surface.gbmSurface->size() == size && formats.contains(surface.gbmSurface->format()) - && (surface.gbmSurface->modifiers().empty() || surface.gbmSurface->modifiers() == formats[surface.gbmSurface->format()]); + && (surface.forceLinear || surface.gbmSurface->modifiers().empty() || surface.gbmSurface->modifiers() == formats[surface.gbmSurface->format()]); } std::optional EglGbmLayerSurface::createSurface(const QSize &size, const QMap> &formats) const @@ -279,7 +279,8 @@ std::optional EglGbmLayerSurface::createSurface(con { Surface ret; ret.importMode = importMode; - ret.gbmSurface = createGbmSurface(size, format, modifiers, importMode == MultiGpuImportMode::DumbBuffer || m_bufferTarget != BufferTarget::Normal); + ret.forceLinear = importMode == MultiGpuImportMode::DumbBuffer || m_bufferTarget != BufferTarget::Normal; + ret.gbmSurface = createGbmSurface(size, format, modifiers, ret.forceLinear); if (!ret.gbmSurface) { return std::nullopt; } diff --git a/src/backends/drm/drm_egl_layer_surface.h b/src/backends/drm/drm_egl_layer_surface.h index 184e6777e1..1adfd6964d 100644 --- a/src/backends/drm/drm_egl_layer_surface.h +++ b/src/backends/drm/drm_egl_layer_surface.h @@ -72,6 +72,7 @@ private: MultiGpuImportMode importMode; std::shared_ptr currentBuffer; std::shared_ptr currentFramebuffer; + bool forceLinear = false; }; bool checkSurface(const QSize &size, const QMap> &formats); bool doesSurfaceFit(const Surface &surface, const QSize &size, const QMap> &formats) const;