From 0db46e3966eddefd7cf0e06437e7dfc074f50827 Mon Sep 17 00:00:00 2001 From: Aleix Pol Gonzalez Date: Fri, 3 May 2024 17:00:57 +0200 Subject: [PATCH] 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 --- src/backends/drm/drm_pipeline.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/drm/drm_pipeline.cpp b/src/backends/drm/drm_pipeline.cpp index 7d1f71576a..fde9a98c13 100644 --- a/src/backends/drm/drm_pipeline.cpp +++ b/src/backends/drm/drm_pipeline.cpp @@ -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);