From 58debd72a3087e369e9ec94765c0b7204b1e6211 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 11 Mar 2021 03:54:10 +0100 Subject: [PATCH] Only scanout when the texture matches the display size Otherwise drmModeAtomicCommit() in DrmOutput::doAtomicCommit() fails due to unmatched buffer sizes. While rendering continues working properly, this makes drm freak out and try to go back to a previous state (see the test commit in presentAtomically()) that in turn starts issuing screen events to every process even though it's just to say the same thing. The fact that this happens per frame makes the system unusable as soon as fullscreen starts happening on a scaled display. Another thing we could do is get EglGbmBackend::scanout() to take care of the resizing. --- src/plugins/platforms/drm/egl_gbm_backend.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/platforms/drm/egl_gbm_backend.cpp b/src/plugins/platforms/drm/egl_gbm_backend.cpp index 238dbdbd8f..d07974aa07 100644 --- a/src/plugins/platforms/drm/egl_gbm_backend.cpp +++ b/src/plugins/platforms/drm/egl_gbm_backend.cpp @@ -698,8 +698,7 @@ bool EglGbmBackend::scanout(int screenId, KWaylandServer::SurfaceInterface *surf } auto buffer = surface->buffer(); Output output = m_outputs[screenId]; - if (buffer->linuxDmabufBuffer()->size() != output.output->modeSize() - && output.output->isBeingRecorded()) { + if (buffer->linuxDmabufBuffer()->size() != output.output->modeSize()) { return false; } EglDmabufBuffer *dmabuf = static_cast(buffer->linuxDmabufBuffer());