summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Noelle Scobie <nscobie@google.com> 2024-11-20 21:53:20 -0500
committer Noelle Scobie <nscobie@google.com> 2024-11-21 10:56:33 -0500
commitc6acad1f9efccfe3cdb85132aca078a5445cf2d1 (patch)
tree822e98e93878e589a62182611556308d35edc0f4
parent887598b92d4f48d15a2f6f60a21c709545b711ca (diff)
Add r/w opt-in rollout flag for RenderEngine on Graphite
This flag will allow some devices to opt in to RE-Graphite as a preview rollout progresses. Making it a R/W flag will allow for A/B comparison. Test: manual validation of aconfig flag / sysprop combos Bug: b/293371537 Flag: com.android.graphics.surfaceflinger.flags.graphite_renderengine_preview_rollout Change-Id: I30a59986d1da2dc8355c2b3cf2da436c6cc64120
-rw-r--r--libs/renderengine/include/renderengine/RenderEngine.h8
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp15
-rw-r--r--services/surfaceflinger/common/FlagManager.cpp2
-rw-r--r--services/surfaceflinger/common/include/common/FlagManager.h1
-rw-r--r--services/surfaceflinger/surfaceflinger_flags_new.aconfig7
5 files changed, 28 insertions, 5 deletions
diff --git a/libs/renderengine/include/renderengine/RenderEngine.h b/libs/renderengine/include/renderengine/RenderEngine.h
index 0fd982e812..95c4d033e2 100644
--- a/libs/renderengine/include/renderengine/RenderEngine.h
+++ b/libs/renderengine/include/renderengine/RenderEngine.h
@@ -38,6 +38,14 @@
#define PROPERTY_DEBUG_RENDERENGINE_BACKEND "debug.renderengine.backend"
/**
+ * Allows opting particular devices into an initial preview rollout of RenderEngine on Graphite.
+ *
+ * Only applicable within SurfaceFlinger, and if relevant aconfig flags are enabled.
+ */
+#define PROPERTY_DEBUG_RENDERENGINE_GRAPHITE_PREVIEW_OPTIN \
+ "debug.renderengine.graphite_preview_optin"
+
+/**
* Turns on recording of skia commands in SkiaGL version of the RE. This property
* defines number of milliseconds for the recording to take place. A non zero value
* turns on the recording.
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 1c61b11cf9..3da0dc9d44 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -797,6 +797,12 @@ void SurfaceFlinger::bootFinished() {
}));
}
+bool shouldUseGraphiteIfCompiledAndSupported() {
+ return FlagManager::getInstance().graphite_renderengine() ||
+ (FlagManager::getInstance().graphite_renderengine_preview_rollout() &&
+ base::GetBoolProperty(PROPERTY_DEBUG_RENDERENGINE_GRAPHITE_PREVIEW_OPTIN, false));
+}
+
void chooseRenderEngineType(renderengine::RenderEngineCreationArgs::Builder& builder) {
char prop[PROPERTY_VALUE_MAX];
property_get(PROPERTY_DEBUG_RENDERENGINE_BACKEND, prop, "");
@@ -825,14 +831,13 @@ void chooseRenderEngineType(renderengine::RenderEngineCreationArgs::Builder& bui
// is used by layertracegenerator (which also needs SurfaceFlinger.cpp). :)
#if COM_ANDROID_GRAPHICS_SURFACEFLINGER_FLAGS_GRAPHITE_RENDERENGINE || \
COM_ANDROID_GRAPHICS_SURFACEFLINGER_FLAGS_FORCE_COMPILE_GRAPHITE_RENDERENGINE
- const bool useGraphite = FlagManager::getInstance().graphite_renderengine() &&
+ const bool useGraphite = shouldUseGraphiteIfCompiledAndSupported() &&
renderengine::RenderEngine::canSupport(kVulkan);
#else
const bool useGraphite = false;
- if (FlagManager::getInstance().graphite_renderengine()) {
- ALOGE("RenderEngine's Graphite Skia backend was requested with the "
- "debug.renderengine.graphite system property, but it is not compiled in this "
- "build! Falling back to Ganesh backend selection logic.");
+ if (shouldUseGraphiteIfCompiledAndSupported()) {
+ ALOGE("RenderEngine's Graphite Skia backend was requested, but it is not compiled in "
+ "this build! Falling back to Ganesh backend selection logic.");
}
#endif
const bool useVulkan = useGraphite ||
diff --git a/services/surfaceflinger/common/FlagManager.cpp b/services/surfaceflinger/common/FlagManager.cpp
index bd151beaba..f257c7cf10 100644
--- a/services/surfaceflinger/common/FlagManager.cpp
+++ b/services/surfaceflinger/common/FlagManager.cpp
@@ -115,6 +115,7 @@ void FlagManager::dump(std::string& result) const {
DUMP_ACONFIG_FLAG(adpf_gpu_sf);
DUMP_ACONFIG_FLAG(adpf_native_session_manager);
DUMP_ACONFIG_FLAG(adpf_use_fmq_channel);
+ DUMP_ACONFIG_FLAG(graphite_renderengine_preview_rollout);
/// Trunk stable readonly flags ///
DUMP_ACONFIG_FLAG(adpf_fmq_sf);
@@ -265,6 +266,7 @@ FLAG_MANAGER_ACONFIG_FLAG(begone_bright_hlg, "debug.sf.begone_bright_hlg");
FLAG_MANAGER_ACONFIG_FLAG(refresh_rate_overlay_on_external_display, "")
FLAG_MANAGER_ACONFIG_FLAG(adpf_gpu_sf, "")
FLAG_MANAGER_ACONFIG_FLAG(adpf_native_session_manager, "");
+FLAG_MANAGER_ACONFIG_FLAG(graphite_renderengine_preview_rollout, "");
/// Trunk stable server (R/W) flags from outside SurfaceFlinger ///
FLAG_MANAGER_ACONFIG_FLAG_IMPORTED(adpf_use_fmq_channel, "", android::os)
diff --git a/services/surfaceflinger/common/include/common/FlagManager.h b/services/surfaceflinger/common/include/common/FlagManager.h
index fd2306fe0e..a461627eef 100644
--- a/services/surfaceflinger/common/include/common/FlagManager.h
+++ b/services/surfaceflinger/common/include/common/FlagManager.h
@@ -53,6 +53,7 @@ public:
bool adpf_use_fmq_channel() const;
bool adpf_native_session_manager() const;
bool adpf_use_fmq_channel_fixed() const;
+ bool graphite_renderengine_preview_rollout() const;
/// Trunk stable readonly flags ///
bool adpf_fmq_sf() const;
diff --git a/services/surfaceflinger/surfaceflinger_flags_new.aconfig b/services/surfaceflinger/surfaceflinger_flags_new.aconfig
index 34a935a223..2c44e4ce0d 100644
--- a/services/surfaceflinger/surfaceflinger_flags_new.aconfig
+++ b/services/surfaceflinger/surfaceflinger_flags_new.aconfig
@@ -173,6 +173,13 @@ flag {
} # frame_rate_category_mrr
flag {
+ name: "graphite_renderengine_preview_rollout"
+ namespace: "core_graphics"
+ description: "R/W flag to enable Skia's Graphite Vulkan backend in RenderEngine, IF it is already compiled with force_compile_graphite_renderengine, AND the debug.renderengine.graphite_preview_optin sysprop is set to true."
+ bug: "293371537"
+} # graphite_renderengine_preview_rollout
+
+flag {
name: "latch_unsignaled_with_auto_refresh_changed"
namespace: "core_graphics"
description: "Ignore eAutoRefreshChanged with latch unsignaled"