1
0
Fork 0

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>
This commit is contained in:
Stefan Schake 2018-05-04 18:03:00 +02:00
parent d2ad301ea1
commit 025d0a65c4
3 changed files with 3 additions and 3 deletions

View file

@ -551,7 +551,7 @@ int DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,
DrmHwcRect<int> display_frame;
DrmHwcRect<float> source_crop;
uint64_t rotation = 0;
uint64_t alpha = 0xFF;
uint64_t alpha = 0xFFFF;
if (comp_plane.type() != DrmCompositionPlane::Type::kDisable) {
if (source_layers.size() > 1) {

View file

@ -141,7 +141,7 @@ struct DrmHwcLayer {
DrmHwcNativeHandle handle;
uint32_t transform;
DrmHwcBlending blending = DrmHwcBlending::kNone;
uint8_t alpha = 0xff;
uint16_t alpha = 0xffff;
DrmHwcRect<float> source_crop;
DrmHwcRect<int> display_frame;

View file

@ -830,7 +830,7 @@ void DrmHwcTwo::HwcLayer::PopulateDrmLayer(DrmHwcLayer *layer) {
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_));
}