diff options
author | Baldev Sahu <bsahu@codeaurora.org> | 2021-01-11 15:51:58 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2021-01-11 22:09:19 -0800 |
commit | 0a38f67f7c7e38f7c25b873796a303fd96ce7745 (patch) | |
tree | 1b464dc74b5e03f16ec4ea74d262efa6af9f4c99 | |
parent | 13e01178433b171a185619365512c9566f0e9ea2 (diff) |
hwc2: Skip SDE composition if all client layers are invalid
If all client layers have invalid coordinates, FB target may
not get cleared and stale FB content may get composed along
with other SDE layers. So skip all layers for such scenario
to avoid any artifacts.
Change-Id: I806cca9dfac424c6849069406ec4b62387cc2c44
-rw-r--r-- | sdm/libs/hwc2/hwc_display.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp index a4b83441..894d9224 100644 --- a/sdm/libs/hwc2/hwc_display.cpp +++ b/sdm/libs/hwc2/hwc_display.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. * Not a Contribution. * * Copyright 2015 The Android Open Source Project @@ -654,6 +654,7 @@ void HWCDisplay::BuildLayerStack() { layer_stack_ = LayerStack(); display_rect_ = LayerRect(); metadata_refresh_rate_ = 0; + bool has_valid_client_layer = false; layer_stack_.flags.animating = animating_; layer_stack_.flags.fast_path = fast_path_enabled_ && fast_path_composition_; @@ -739,6 +740,7 @@ void HWCDisplay::BuildLayerStack() { if (layer->flags.skip) { layer_stack_.flags.skip_present = true; + has_valid_client_layer |= IsValid(layer->dst_rect); } // TODO(user): Move to a getter if this is needed at other places @@ -787,6 +789,14 @@ void HWCDisplay::BuildLayerStack() { layer_stack_.layers.push_back(layer); } + // If all client layers are invalid, skip all layers + if (layer_stack_.flags.skip_present && !has_valid_client_layer) { + DLOGE("Not a single valid client layer present, skipping all"); + for (auto layer : layer_stack_.layers) { + layer->flags.skip = true; + } + } + // If layer stack needs Client composition, HWC display gets into InternalValidate state. If // validation gets reset by any other thread in this state, enforce Geometry change to ensure // that Client target gets composed by SF. |