backends/drm: Make sure we respect the alpha property range

This is in part a workaround for an issue in Qualcomm drivers where the
range for alpha is 0-UINT8_MAX (255). We were setting a value too big
and this would make the whole pipeline fail.

Instead set the top of the property range which is what we were doing
after all, resulting in more explicit code to what we were trying to
achieve.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
This commit is contained in:
Aleix Pol Gonzalez 2024-05-03 17:00:57 +02:00 committed by Aleix Pol Gonzalez
parent b3f7924539
commit 0db46e3966

View file

@ -346,7 +346,7 @@ bool DrmPipeline::prepareAtomicModeset(DrmAtomicCommit *commit)
commit->addEnum(primary->rotation, {DrmPlane::Transformation::Rotate0});
}
if (primary->alpha.isValid()) {
commit->addProperty(primary->alpha, 0xFFFF);
commit->addProperty(primary->alpha, primary->alpha.maxValue());
}
if (primary->pixelBlendMode.isValid()) {
commit->addEnum(primary->pixelBlendMode, DrmPlane::PixelBlendMode::PreMultiplied);
@ -356,7 +356,7 @@ bool DrmPipeline::prepareAtomicModeset(DrmAtomicCommit *commit)
commit->addEnum(cursor->rotation, DrmPlane::Transformations(DrmPlane::Transformation::Rotate0));
}
if (cursor->alpha.isValid()) {
commit->addProperty(cursor->alpha, 0xFFFF);
commit->addProperty(cursor->alpha, cursor->alpha.maxValue());
}
if (cursor->pixelBlendMode.isValid()) {
commit->addEnum(cursor->pixelBlendMode, DrmPlane::PixelBlendMode::PreMultiplied);