diff options
author | Arun Kumar K.R <akumarkr@codeaurora.org> | 2016-06-01 16:56:52 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-06-06 11:40:46 -0700 |
commit | 2c0ff8de8a746512c3f932f32d40b0457453b4ca (patch) | |
tree | 2737a496a5fe73cf76149975a6a38cf6a68ea4ac /sdm/libs/hwc2/hwc_layers.cpp | |
parent | 5f57d11c6fc747e39b9660d06d90d8cc22abecbf (diff) | |
download | display-2c0ff8de8a746512c3f932f32d40b0457453b4ca.tar.gz |
sdm: Fixes for HWC2
- Return HWC2::Error::HasChanges from Validate(), when the
composition types changes compared to requested.
- Reset release_fence_fd after pushing to queue so that it
doesn't get pushed again.
- Clear dirty and visible regions on every call to set them.
- Maintain client requested and SDM selected comp types.
Change-Id: Iff2a52c99a15cdbfccc4c0206f3958d0a2eb1642
Crs-fixed: 1023408
Diffstat (limited to 'sdm/libs/hwc2/hwc_layers.cpp')
-rw-r--r-- | sdm/libs/hwc2/hwc_layers.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sdm/libs/hwc2/hwc_layers.cpp b/sdm/libs/hwc2/hwc_layers.cpp index 25918984..dd43dbbc 100644 --- a/sdm/libs/hwc2/hwc_layers.cpp +++ b/sdm/libs/hwc2/hwc_layers.cpp @@ -89,6 +89,7 @@ HWC2::Error HWCLayer::SetLayerBuffer(buffer_handle_t buffer, int32_t acquire_fen HWC2::Error HWCLayer::SetLayerSurfaceDamage(hwc_region_t damage) { auto num_dirty_rects = damage.numRects; + layer_->dirty_regions.clear(); if (num_dirty_rects > 0) { for (uint32_t i = 0; i <= damage.numRects; i++) { LayerRect rect; @@ -128,7 +129,7 @@ HWC2::Error HWCLayer::SetLayerColor(hwc_color_t color) { HWC2::Error HWCLayer::SetLayerCompositionType(HWC2::Composition type) { layer_->flags = {}; // Reset earlier flags - composition_ = type; // Used to compute changes + client_requested_ = type; switch (type) { case HWC2::Composition::Client: layer_->flags.skip = true; @@ -213,6 +214,7 @@ HWC2::Error HWCLayer::SetLayerTransform(HWC2::Transform transform) { HWC2::Error HWCLayer::SetLayerVisibleRegion(hwc_region_t visible) { auto num_dirty_rects = visible.numRects; + layer_->visible_regions.clear(); if (num_dirty_rects > 0) { for (uint32_t i = 0; i <= visible.numRects; i++) { LayerRect rect; @@ -490,24 +492,26 @@ uint32_t HWCLayer::RoundToStandardFPS(float fps) { return frame_rate; } -void HWCLayer::SetComposition(const LayerComposition &source) { - auto composition = HWC2::Composition::Invalid; - switch (source) { +void HWCLayer::SetComposition(const LayerComposition &sdm_composition) { + auto hwc_composition = HWC2::Composition::Invalid; + switch (sdm_composition) { case kCompositionGPU: - composition = HWC2::Composition::Client; + hwc_composition = HWC2::Composition::Client; break; case kCompositionHWCursor: - composition = HWC2::Composition::Cursor; + hwc_composition = HWC2::Composition::Cursor; break; default: - composition = HWC2::Composition::Device; + hwc_composition = HWC2::Composition::Device; break; } // Update solid fill composition - if (layer_->composition == kCompositionSDE && layer_->flags.solid_fill != 0) { - composition = HWC2::Composition::SolidColor; + if (sdm_composition == kCompositionSDE && layer_->flags.solid_fill != 0) { + hwc_composition = HWC2::Composition::SolidColor; } - composition_ = composition; + device_selected_ = hwc_composition; + + return; } void HWCLayer::PushReleaseFence(int32_t fence) { release_fences_.push(fence); |