From e004f1b7fcfd479632078d1ad24df31884bce0d0 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Mon, 20 Sep 2021 14:27:05 +0200 Subject: [PATCH] platforms/drm: fix buffer re-using We don't always have explicit modifiers when we're using AMS CCBUG: 442677 --- src/plugins/platforms/drm/drm_pipeline.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/drm/drm_pipeline.cpp b/src/plugins/platforms/drm/drm_pipeline.cpp index eaa2a9c109..0b81bd4028 100644 --- a/src/plugins/platforms/drm/drm_pipeline.cpp +++ b/src/plugins/platforms/drm/drm_pipeline.cpp @@ -279,8 +279,9 @@ bool DrmPipeline::checkTestBuffer() QSharedPointer buffer; // try to re-use buffers if possible. const auto &checkBuffer = [this, backend, &buffer](const QSharedPointer &buf){ + const auto &mods = supportedModifiers(buf->format()); if (buf->format() == backend->drmFormat() - && (!m_gpu->atomicModeSetting() || supportedModifiers(buf->format()).contains(buf->modifier())) + && (mods.isEmpty() || mods.contains(buf->modifier())) && buf->size() == sourceSize()) { buffer = buf; }