diff options
Diffstat (limited to 'hwc2_device/HwcLayer.cpp')
-rw-r--r-- | hwc2_device/HwcLayer.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/hwc2_device/HwcLayer.cpp b/hwc2_device/HwcLayer.cpp index c278732..dd5359f 100644 --- a/hwc2_device/HwcLayer.cpp +++ b/hwc2_device/HwcLayer.cpp @@ -53,7 +53,7 @@ HWC2::Error HwcLayer::SetLayerBlendMode(int32_t mode) { */ HWC2::Error HwcLayer::SetLayerBuffer(buffer_handle_t buffer, int32_t acquire_fence) { - acquire_fence_ = UniqueFd(acquire_fence); + layer_data_.acquire_fence = MakeSharedFd(acquire_fence); buffer_handle_ = buffer; buffer_handle_updated_ = true; @@ -202,9 +202,14 @@ void HwcLayer::ImportFb() { } } -void HwcLayer::PopulateLayerData(bool test) { +void HwcLayer::PopulateLayerData() { ImportFb(); + if (!layer_data_.bi) { + ALOGE("%s: Invalid state", __func__); + return; + } + if (blend_mode_ != BufferBlendMode::kUndefined) { layer_data_.bi->blend_mode = blend_mode_; } @@ -214,10 +219,6 @@ void HwcLayer::PopulateLayerData(bool test) { if (sample_range_ != BufferSampleRange::kUndefined) { layer_data_.bi->sample_range = sample_range_; } - - if (!test) { - layer_data_.acquire_fence = std::move(acquire_fence_); - } } /* SwapChain Cache */ @@ -227,7 +228,7 @@ bool HwcLayer::SwChainGetBufferFromCache(BufferUniqueId unique_id) { return false; } - int seq = swchain_lookup_table_[unique_id]; + auto seq = swchain_lookup_table_[unique_id]; if (swchain_cache_.count(seq) == 0) { return false; @@ -274,7 +275,7 @@ void HwcLayer::SwChainAddCurrentBuffer(BufferUniqueId unique_id) { return; } - int seq = swchain_lookup_table_[unique_id]; + auto seq = swchain_lookup_table_[unique_id]; if (swchain_cache_.count(seq) == 0) { swchain_cache_[seq] = {}; |