summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniml3 <danimoral1001@gmail.com>2021-05-19 15:56:21 +0200
committeralk3pInjection <webmaster@raspii.tech>2023-12-27 00:35:28 +0800
commit10f58ef0c1d3aaf020eba1115138df8ffba12cdd (patch)
treee68ece05a246921e6b8d48dffcac96ab201358d0
parentd47e606936f1ca73824ece2d53060ffc42b93d09 (diff)
CompositionEngine: Request device composition for the Udfps touched layer
The FOD layers should be always composed by the device to set the custom zpos bits to the kernel. By default all layers are set to device composition and the proprietary libsdmextension.so moves some to client composition. Unfortunately that also affects the Udfps touched layer. After this commit the layer below the Udfps touched layer is forced to be client composition. For unknown reasons libsdmextension will not change the Udfps touched layer to client composition anymore. tests: - Run 'adb shell dumpsys SurfaceFlinger' and ensure that the Udfps touched layer is composed by the device - Ensure that the Udfps touched layer correctly sets the zpos bits on the kernel while / after using WFD Signed-off-by: daniml3 <danimoral1001@gmail.com> Signed-off-by: Arian <arian.kulmer@web.de> Change-Id: I8aeb98d18557ad4e971eaba74700ceb3058273ab
-rw-r--r--services/surfaceflinger/CompositionEngine/src/Output.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index d085752b2a..251e63836d 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -28,6 +28,7 @@
#include <compositionengine/LayerFE.h>
#include <compositionengine/LayerFECompositionState.h>
#include <compositionengine/RenderSurface.h>
+#include <compositionengine/UdfpsExtension.h>
#include <compositionengine/impl/HwcAsyncWorker.h>
#include <compositionengine/impl/Output.h>
#include <compositionengine/impl/OutputCompositionState.h>
@@ -943,7 +944,10 @@ void Output::writeCompositionState(const compositionengine::CompositionRefreshAr
compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition() const {
compositionengine::OutputLayer* layerRequestingBgComposition = nullptr;
- for (auto* layer : getOutputLayersOrderedByZ()) {
+ for (size_t i = 0; i < getOutputLayerCount(); i++) {
+ compositionengine::OutputLayer* layer = getOutputLayerOrderedByZByIndex(i);
+ compositionengine::OutputLayer* nextLayer = getOutputLayerOrderedByZByIndex(i + 1);
+
auto* compState = layer->getLayerFE().getCompositionState();
// If any layer has a sideband stream, we will disable blurs. In that case, we don't
@@ -957,6 +961,16 @@ compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition
if (compState->backgroundBlurRadius > 0 || compState->blurRegions.size() > 0) {
layerRequestingBgComposition = layer;
}
+
+ // If the next layer is the Udfps touched layer, enable client composition for it
+ // because that somehow leads to the Udfps touched layer getting device composition
+ // consistently.
+ if ((nextLayer != nullptr && layerRequestingBgComposition == nullptr) &&
+ (strncmp(nextLayer->getLayerFE().getDebugName(), UDFPS_TOUCHED_LAYER_NAME,
+ strlen(UDFPS_TOUCHED_LAYER_NAME)) == 0)) {
+ layerRequestingBgComposition = layer;
+ break;
+ }
}
return layerRequestingBgComposition;
}