drm_hwcomposer: Use 16 bit value for plane alpha
The upstream version of the alpha property uses 16 bits to make it future
proof. Since HWC2 already passes in a float expand our internal
representation instead of just shifting for DRM.
Signed-off-by: Stefan Schake <stschake@gmail.com>
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index ede75e0..1940964 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -830,7 +830,7 @@
layer->acquire_fence = acquire_fence_.Release();
layer->release_fence = std::move(release_fence);
layer->SetDisplayFrame(display_frame_);
- layer->alpha = static_cast<uint8_t>(255.0f * alpha_ + 0.5f);
+ layer->alpha = static_cast<uint16_t>(65535.0f * alpha_ + 0.5f);
layer->SetSourceCrop(source_crop_);
layer->SetTransform(static_cast<int32_t>(transform_));
}