backends/drm: relax direct scanout rules for color management

The GL renderer currently doesn't apply any transformations except clipping,
so allowing direct scanout is okay as long as colorimetry and transfer
function match.
wilder/Plasma/6.2
Xaver Hugl 2 years ago
parent 22d0631b1b
commit 8d5ebb5e15
  1. 6
      src/backends/drm/drm_egl_layer.cpp

@ -90,10 +90,14 @@ bool EglGbmLayer::doAttemptScanout(GraphicsBuffer *buffer, const ColorDescriptio
if (directScanoutDisabled) {
return false;
}
if (color != m_pipeline->colorDescription() || m_pipeline->output()->channelFactors() != QVector3D(1, 1, 1) || m_pipeline->iccProfile()) {
if (m_pipeline->output()->channelFactors() != QVector3D(1, 1, 1) || m_pipeline->iccProfile()) {
// TODO use GAMMA_LUT, CTM and DEGAMMA_LUT to allow direct scanout with HDR
return false;
}
const auto &targetColor = m_pipeline->colorDescription();
if (color.colorimetry() != targetColor.colorimetry() || color.transferFunction() != targetColor.transferFunction()) {
return false;
}
// kernel documentation says that
// "Devices that don’t support subpixel plane coordinates can ignore the fractional part."
// so we need to make sure that doesn't cause a difference vs the composited result

Loading…
Cancel
Save