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

Commit c6acad1f authored by Noelle Scobie's avatar Noelle Scobie
Browse files

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
parent 887598b9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -37,6 +37,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
+10 −5
Original line number Diff line number Diff line
@@ -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 ||
+2 −0
Original line number Diff line number Diff line
@@ -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)
+1 −0
Original line number Diff line number Diff line
@@ -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;
+7 −0
Original line number Diff line number Diff line
@@ -172,6 +172,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"