summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tom Murphy <tomnom@google.com> 2024-07-25 12:50:46 +0000
committer Tom Murphy <tomnom@google.com> 2024-08-09 12:27:11 +0000
commit102ba1284e1ebcd4989b25dea429306af8f10349 (patch)
tree97d314657196e27d102c999fd1e95c357b2ad3d4
parent948ce5eb667b05bd69069c42a3101e58490215fa (diff)
Skip eglCreateContext telemetry for HWUI contexts
We want eglCreateContext telemetry to give us insights into how developers use EGL. Including HWUI telemetry in this pollutes this telemetry. Skip recording of the creation of this context using the new Egl extension. Currently this only disables the passing of GpuStatsInfo::Stats::CREATED_GLES_CONTEXT to the gpu stats. Test: Checked the code path executed correctly with the flag enabled/disabled using logging Bug: 347911216 Flag: com.android.graphics.hwui.flags.skip_eglmanager_telemetry Change-Id: Ifcadd5af263f26388026bcd70ec8dc9c2914cd0a
-rw-r--r--libs/hwui/Android.bp1
-rw-r--r--libs/hwui/Properties.cpp8
-rw-r--r--libs/hwui/Properties.h3
-rw-r--r--libs/hwui/aconfig/hwui_flags.aconfig7
-rw-r--r--libs/hwui/renderthread/EglManager.cpp5
5 files changed, 24 insertions, 0 deletions
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index d71f3b6884ae..23cd3ce965ff 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -143,6 +143,7 @@ cc_defaults {
"aconfig_text_flags_c_lib",
"server_configurable_flags",
"libaconfig_storage_read_api_cc",
+ "libgraphicsenv",
],
static_libs: [
"libEGL_blobCache",
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp
index 1217b47664dd..b6476c9d466f 100644
--- a/libs/hwui/Properties.cpp
+++ b/libs/hwui/Properties.cpp
@@ -42,6 +42,11 @@ constexpr bool hdr_10bit_plus() {
constexpr bool initialize_gl_always() {
return false;
}
+
+constexpr bool skip_eglmanager_telemetry() {
+ return false;
+}
+
constexpr bool resample_gainmap_regions() {
return false;
}
@@ -103,6 +108,7 @@ float Properties::maxHdrHeadroomOn8bit = 5.f; // TODO: Refine this number
bool Properties::clipSurfaceViews = false;
bool Properties::hdr10bitPlus = false;
+bool Properties::skipTelemetry = false;
bool Properties::resampleGainmapRegions = false;
int Properties::timeoutMultiplier = 1;
@@ -183,6 +189,8 @@ bool Properties::load() {
hwui_flags::resample_gainmap_regions());
timeoutMultiplier = android::base::GetIntProperty("ro.hw_timeout_multiplier", 1);
+ skipTelemetry = base::GetBoolProperty(PROPERTY_SKIP_EGLMANAGER_TELEMETRY,
+ hwui_flags::skip_eglmanager_telemetry());
return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw);
}
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 73e80ce4afd0..db471527b861 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -234,6 +234,8 @@ enum DebugLevel {
*/
#define PROPERTY_INITIALIZE_GL_ALWAYS "debug.hwui.initialize_gl_always"
+#define PROPERTY_SKIP_EGLMANAGER_TELEMETRY "debug.hwui.skip_eglmanager_telemetry"
+
///////////////////////////////////////////////////////////////////////////////
// Misc
///////////////////////////////////////////////////////////////////////////////
@@ -342,6 +344,7 @@ public:
static bool clipSurfaceViews;
static bool hdr10bitPlus;
+ static bool skipTelemetry;
static bool resampleGainmapRegions;
static int timeoutMultiplier;
diff --git a/libs/hwui/aconfig/hwui_flags.aconfig b/libs/hwui/aconfig/hwui_flags.aconfig
index 13c0b00daa21..a1f51687b077 100644
--- a/libs/hwui/aconfig/hwui_flags.aconfig
+++ b/libs/hwui/aconfig/hwui_flags.aconfig
@@ -99,6 +99,13 @@ flag {
}
flag {
+ name: "skip_eglmanager_telemetry"
+ namespace: "core_graphics"
+ description: "Skip telemetry in EglManager's calls to eglCreateContext to avoid polluting telemetry"
+ bug: "347911216"
+}
+
+flag {
name: "resample_gainmap_regions"
namespace: "core_graphics"
description: "Resample gainmaps when decoding regions, to improve visual quality"
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp
index 708b0113e13e..60104452f4c0 100644
--- a/libs/hwui/renderthread/EglManager.cpp
+++ b/libs/hwui/renderthread/EglManager.cpp
@@ -19,6 +19,7 @@
#include <EGL/eglext.h>
#include <GLES/gl.h>
#include <cutils/properties.h>
+#include <graphicsenv/GpuStatsInfo.h>
#include <log/log.h>
#include <sync/sync.h>
#include <utils/Trace.h>
@@ -366,6 +367,10 @@ void EglManager::createContext() {
contextAttributes.push_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG);
contextAttributes.push_back(Properties::contextPriority);
}
+ if (Properties::skipTelemetry) {
+ contextAttributes.push_back(EGL_TELEMETRY_HINT_ANDROID);
+ contextAttributes.push_back(android::GpuStatsInfo::SKIP_TELEMETRY);
+ }
contextAttributes.push_back(EGL_NONE);
mEglContext = eglCreateContext(
mEglDisplay, EglExtensions.noConfigContext ? ((EGLConfig) nullptr) : mEglConfig,