platforms/drm: fix buffer re-using

We don't always have explicit modifiers when we're using AMS

CCBUG: 442677
This commit is contained in:
Xaver Hugl 2021-09-20 14:27:05 +02:00
parent cf7cc0d43e
commit e004f1b7fc

View file

@ -279,8 +279,9 @@ bool DrmPipeline::checkTestBuffer()
QSharedPointer<DrmBuffer> buffer;
// try to re-use buffers if possible.
const auto &checkBuffer = [this, backend, &buffer](const QSharedPointer<DrmBuffer> &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;
}