backends/drm: reduce "max bpc" to what is actually used

This prevents triggering a bug in the BenQ GW2765 monitor, and should
in theory have no downsides.

BUG: 449906
FIXED-IN: 5.24.5
This commit is contained in:
Xaver Hugl 2022-04-28 02:23:18 +02:00
parent 7a279522a8
commit 05877a8321

View file

@ -231,7 +231,11 @@ void DrmPipeline::prepareAtomicModeset()
m_connector->getProp(DrmConnector::PropertyIndex::Underscan_hborder)->setPending(hborder);
}
if (const auto bpc = m_connector->getProp(DrmConnector::PropertyIndex::MaxBpc)) {
bpc->setPending(bpc->maxValue());
uint64_t preferred = 8;
if (auto backend = dynamic_cast<EglGbmBackend *>(gpu()->platform()->renderBackend()); backend && backend->prefer10bpc()) {
preferred = 10;
}
bpc->setPending(std::min(bpc->maxValue(), preferred));
}
m_pending.crtc->setPending(DrmCrtc::PropertyIndex::Active, activePending());