Initial unified commit for Android 14, with TrebleDroid GSI target, syncing up to 20240208

This commit is contained in:
Andy CrossGate Yan
2024-02-17 16:46:38 +08:00
commit e9902a4450
281 changed files with 169698 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
From 09fac47349b2e39d2e53b2b638b98d17d3bd18a4 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 20 Nov 2023 22:00:14 +0800
Subject: [PATCH 1/2] Revert "CompositionEngine: Request device composition for
the Udfps touched layer"
This reverts commit 69fad8aa4098b007fe17472902159705fdcd957f.
---
.../CompositionEngine/src/Output.cpp | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index 2eb1a5c399..793959cea6 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -22,7 +22,6 @@
#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>
@@ -901,10 +900,7 @@ void Output::writeCompositionState(const compositionengine::CompositionRefreshAr
compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition() const {
compositionengine::OutputLayer* layerRequestingBgComposition = nullptr;
- for (size_t i = 0; i < getOutputLayerCount(); i++) {
- compositionengine::OutputLayer* layer = getOutputLayerOrderedByZByIndex(i);
- compositionengine::OutputLayer* nextLayer = getOutputLayerOrderedByZByIndex(i + 1);
-
+ for (auto* layer : getOutputLayersOrderedByZ()) {
auto* compState = layer->getLayerFE().getCompositionState();
// If any layer has a sideband stream, we will disable blurs. In that case, we don't
@@ -918,16 +914,6 @@ 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;
}
--
2.34.1

View File

@@ -0,0 +1,157 @@
From 9428b1b39a473592423f2d2f7812cf3815a68b86 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 20 Nov 2023 22:00:23 +0800
Subject: [PATCH 2/2] Revert "surfaceflinger: Add support for Udfps extension
lib"
This reverts commit 8655d06e960235c0f9ad079be3541fee2a0359f7.
---
.../CompositionEngine/Android.bp | 14 +--------
.../compositionengine/UdfpsExtension.h | 29 -------------------
.../CompositionEngine/src/OutputLayer.cpp | 13 +--------
.../CompositionEngine/src/UdfpsExtension.cpp | 27 -----------------
4 files changed, 2 insertions(+), 81 deletions(-)
delete mode 100644 services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
delete mode 100644 services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
diff --git a/services/surfaceflinger/CompositionEngine/Android.bp b/services/surfaceflinger/CompositionEngine/Android.bp
index cdec4abdba..f3a0186e3e 100644
--- a/services/surfaceflinger/CompositionEngine/Android.bp
+++ b/services/surfaceflinger/CompositionEngine/Android.bp
@@ -61,10 +61,7 @@ cc_defaults {
cc_library {
name: "libcompositionengine",
- defaults: [
- "libcompositionengine_defaults",
- "surfaceflinger_udfps_lib_defaults",
- ],
+ defaults: ["libcompositionengine_defaults"],
srcs: [
"src/planner/CachedSet.cpp",
"src/planner/Flattener.cpp",
@@ -86,7 +83,6 @@ cc_library {
"src/OutputLayer.cpp",
"src/OutputLayerCompositionState.cpp",
"src/RenderSurface.cpp",
- "src/UdfpsExtension.cpp",
],
local_include_dirs: ["include"],
export_include_dirs: ["include"],
@@ -115,14 +111,6 @@ cc_library {
export_include_dirs: ["include"],
}
-cc_library_static {
- name: "surfaceflinger_udfps_lib",
- srcs: [
- "src/UdfpsExtension.cpp",
- ],
- export_include_dirs: ["include"],
-}
-
cc_test {
name: "libcompositionengine_test",
test_suites: ["device-tests"],
diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
deleted file mode 100644
index 4306cb4a02..0000000000
--- a/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2021-2022 The LineageOS Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdint.h>
-
-#ifndef __UDFPS_EXTENSION__H__
-#define __UDFPS_EXTENSION__H__
-
-#define UDFPS_BIOMETRIC_PROMPT_LAYER_NAME "BiometricPrompt"
-#define UDFPS_LAYER_NAME "UdfpsControllerOverlay"
-#define UDFPS_TOUCHED_LAYER_NAME "SurfaceView[UdfpsControllerOverlay](BLAST)"
-
-extern uint32_t getUdfpsZOrder(uint32_t z, bool touched);
-extern uint64_t getUdfpsUsageBits(uint64_t usageBits, bool touched);
-
-#endif /* __UDFPS_EXTENSION__H__ */
diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
index a314553dd2..0ac0ecb727 100644
--- a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
@@ -19,7 +19,6 @@
#include <compositionengine/DisplayColorProfile.h>
#include <compositionengine/LayerFECompositionState.h>
#include <compositionengine/Output.h>
-#include <compositionengine/UdfpsExtension.h>
#include <compositionengine/impl/HwcBufferCache.h>
#include <compositionengine/impl/OutputCompositionState.h>
#include <compositionengine/impl/OutputLayer.h>
@@ -449,17 +448,7 @@ void OutputLayer::writeOutputDependentGeometryStateToHWC(HWC2::Layer* hwcLayer,
sourceCrop.bottom, to_string(error).c_str(), static_cast<int32_t>(error));
}
- uint32_t z_udfps = z;
- if ((strncmp(getLayerFE().getDebugName(), UDFPS_LAYER_NAME, strlen(UDFPS_LAYER_NAME)) == 0) ||
- (strncmp(getLayerFE().getDebugName(), UDFPS_BIOMETRIC_PROMPT_LAYER_NAME,
- strlen(UDFPS_BIOMETRIC_PROMPT_LAYER_NAME)) == 0)) {
- z_udfps = getUdfpsZOrder(z, false);
- } else if (strncmp(getLayerFE().getDebugName(), UDFPS_TOUCHED_LAYER_NAME,
- strlen(UDFPS_TOUCHED_LAYER_NAME)) == 0) {
- z_udfps = getUdfpsZOrder(z, true);
- }
-
- if (auto error = hwcLayer->setZOrder(z_udfps); error != hal::Error::NONE) {
+ if (auto error = hwcLayer->setZOrder(z); error != hal::Error::NONE) {
ALOGE("[%s] Failed to set Z %u: %s (%d)", getLayerFE().getDebugName(), z,
to_string(error).c_str(), static_cast<int32_t>(error));
}
diff --git a/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp b/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
deleted file mode 100644
index 2d9d086dd2..0000000000
--- a/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2020 The LineageOS Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef TARGET_PROVIDES_UDFPS_LIB
-#include <compositionengine/UdfpsExtension.h>
-
-uint32_t getUdfpsZOrder(uint32_t z, __unused bool touched) {
- return z;
-}
-
-uint64_t getUdfpsUsageBits(uint64_t usageBits, __unused bool touched) {
- return usageBits;
-}
-#endif
--
2.34.1