sdm: Fix CPU hint toggling issue
Do not toggle CPU hint for draw cycles
with 0 updating layers during video
playback session.
Change-Id: I508f782f911ea4def44209a1b1c34b0c24a47f28
Crs-fixed: 1038379
diff --git a/sdm/libs/hwc2/hwc_display_primary.cpp b/sdm/libs/hwc2/hwc_display_primary.cpp
index 4079cbc..1e19417 100644
--- a/sdm/libs/hwc2/hwc_display_primary.cpp
+++ b/sdm/libs/hwc2/hwc_display_primary.cpp
@@ -190,8 +190,11 @@
layer_stack_.flags.post_processed_output = post_processed_output_;
}
- bool one_updating_layer = SingleLayerUpdating();
- ToggleCPUHint(one_updating_layer);
+ uint32_t num_updating_layers = GetUpdatingLayersCount();
+ bool one_updating_layer = (num_updating_layers == 1);
+ if (num_updating_layers != 0) {
+ ToggleCPUHint(one_updating_layer);
+ }
uint32_t refresh_rate = GetOptimalRefreshRate(one_updating_layer);
bool final_rate = force_refresh_rate_ ? true : false;