Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f23c500e authored by Tom Murphy's avatar Tom Murphy Committed by Android (Google) Code Review
Browse files

Merge "Skip eglCreateContext telemetry for HWUI contexts" into main

parents 6a87e8e6 102ba128
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ cc_defaults {
                "aconfig_text_flags_c_lib",
                "server_configurable_flags",
                "libaconfig_storage_read_api_cc",
                "libgraphicsenv",
            ],
            static_libs: [
                "libEGL_blobCache",
+8 −0
Original line number Diff line number Diff line
@@ -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);
}
+3 −0
Original line number Diff line number Diff line
@@ -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;
+7 −0
Original line number Diff line number Diff line
@@ -98,6 +98,13 @@ flag {
  bug: "335172671"
}

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"
+5 −0
Original line number Diff line number Diff line
@@ -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,