diff options
-rw-r--r-- | libs/hwui/Android.bp | 1 | ||||
-rw-r--r-- | libs/hwui/Properties.cpp | 8 | ||||
-rw-r--r-- | libs/hwui/Properties.h | 3 | ||||
-rw-r--r-- | libs/hwui/aconfig/hwui_flags.aconfig | 7 | ||||
-rw-r--r-- | libs/hwui/renderthread/EglManager.cpp | 5 |
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, |