Commit 1d058a79 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: fix format choosing

The logic was inverted and would choose the format after the first one that
is suitable. On most hardware that wouldn't cause noticable issues as that
will choose the ARGB variant of the normal format, but some Intel hardware
doesn't support these and thus a lower bit depth format than intended gets
used.

BUG: 450779
parent f70a2c79
Pipeline #141910 passed with stage
in 14 minutes and 21 seconds
......@@ -853,10 +853,10 @@ std::optional<GbmFormat> EglGbmBackend::chooseFormat(Output &output) const
for (const auto &format : qAsConst(m_formats)) {
if (output.output->isFormatSupported(format.drmFormat)) {
int bpc = std::max(format.redSize, std::max(format.greenSize, format.blueSize));
if (bpc <= output.output->maxBpc() && !fallback.has_value()) {
fallback = format;
} else {
if (bpc <= output.output->maxBpc()) {
return format;
} else if (!fallback.has_value()) {
fallback = format;
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment