summaryrefslogtreecommitdiff
path: root/sdm/libs/hwc2/hwc_layers.cpp
diff options
context:
space:
mode:
authorSushil Chauhan <sushilchauhan@codeaurora.org>2018-07-10 12:06:01 -0700
committerSushil Chauhan <sushilchauhan@codeaurora.org>2018-07-26 15:17:03 -0700
commit9735cf866932dba9849dcb30e2e487ef6f305eda (patch)
tree1b621f194bbf30c80eb869c5d2bb067b6e550be5 /sdm/libs/hwc2/hwc_layers.cpp
parente4cef09d736850f19fecc610426f32765cc23c89 (diff)
sdm: Allow Skip Validate when Partial Update is disabled
Allow Skip Validate, if the Partial Update feature is not enabled on Display and surface is getting updated on the updating layer(s). CRs-Fixed: 2280394 Change-Id: I0524818fb4cbb11dcc8fc993fa7ae536bd555709
Diffstat (limited to 'sdm/libs/hwc2/hwc_layers.cpp')
-rw-r--r--sdm/libs/hwc2/hwc_layers.cpp32
1 files changed, 25 insertions, 7 deletions
diff --git a/sdm/libs/hwc2/hwc_layers.cpp b/sdm/libs/hwc2/hwc_layers.cpp
index 840119ec..b4b3e348 100644
--- a/sdm/libs/hwc2/hwc_layers.cpp
+++ b/sdm/libs/hwc2/hwc_layers.cpp
@@ -305,7 +305,21 @@ HWC2::Error HWCLayer::SetLayerBuffer(buffer_handle_t buffer, int32_t acquire_fen
}
HWC2::Error HWCLayer::SetLayerSurfaceDamage(hwc_region_t damage) {
- // Check if there is an update in SurfaceDamage rects
+ surface_updated_ = true;
+ if ((damage.numRects == 1) && (damage.rects[0].bottom == 0) && (damage.rects[0].right == 0)) {
+ surface_updated_ = false;
+ }
+
+ if (!layer_->flags.updating && surface_updated_) {
+ needs_validate_ = true;
+ }
+
+ if (!partial_update_enabled_) {
+ SetDirtyRegions(damage);
+ return HWC2::Error::None;
+ }
+
+ // Check if there is an update in SurfaceDamage rects.
if (layer_->dirty_regions.size() != damage.numRects) {
needs_validate_ = true;
} else {
@@ -319,12 +333,7 @@ HWC2::Error HWCLayer::SetLayerSurfaceDamage(hwc_region_t damage) {
}
}
- layer_->dirty_regions.clear();
- for (uint32_t i = 0; i < damage.numRects; i++) {
- LayerRect rect;
- SetRect(damage.rects[i], &rect);
- layer_->dirty_regions.push_back(rect);
- }
+ SetDirtyRegions(damage);
return HWC2::Error::None;
}
@@ -1002,4 +1011,13 @@ bool HWCLayer::IsScalingPresent() {
return ((src_width != dst_width) || (dst_height != src_height));
}
+void HWCLayer::SetDirtyRegions(hwc_region_t surface_damage) {
+ layer_->dirty_regions.clear();
+ for (uint32_t i = 0; i < surface_damage.numRects; i++) {
+ LayerRect rect;
+ SetRect(surface_damage.rects[i], &rect);
+ layer_->dirty_regions.push_back(rect);
+ }
+}
+
} // namespace sdm