Loading services/surfaceflinger/Android.bp +15 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,17 @@ package { default_applicable_licenses: ["frameworks_native_license"], } aconfig_declarations { name: "surfaceflinger_flags", package: "com.android.graphics.surfaceflinger.flags", srcs: ["surfaceflinger_flags.aconfig"], } cc_aconfig_library { name: "libsurfaceflingerflags", aconfig_declarations: "surfaceflinger_flags", } cc_defaults { name: "surfaceflinger_defaults", cflags: [ Loading @@ -20,6 +31,9 @@ cc_defaults { "-Wconversion", "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", ], static_libs: [ "libsurfaceflingerflags", ], } cc_defaults { Loading Loading @@ -84,6 +98,7 @@ cc_defaults { "libshaders", "libtimestats", "libtonemap", "libsurfaceflingerflags", ], header_libs: [ "android.hardware.graphics.composer@2.1-command-buffer", Loading services/surfaceflinger/SurfaceFlinger.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,8 @@ #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> #include <aidl/android/hardware/graphics/composer3/RenderIntent.h> #include <com_android_graphics_surfaceflinger_flags.h> #undef NO_THREAD_SAFETY_ANALYSIS #define NO_THREAD_SAFETY_ANALYSIS \ _Pragma("GCC error \"Prefer <ftl/fake_guard.h> or MutexUtils.h helpers.\"") Loading @@ -170,6 +172,7 @@ #define DOES_CONTAIN_BORDER false namespace android { using namespace com::android::graphics::surfaceflinger; using namespace std::chrono_literals; using namespace std::string_literals; Loading Loading @@ -490,6 +493,8 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI base::GetBoolProperty("persist.debug.sf.enable_layer_lifecycle_manager"s, true); mLegacyFrontEndEnabled = !mLayerLifecycleManagerEnabled || base::GetBoolProperty("persist.debug.sf.enable_legacy_frontend"s, false); mMiscFlagValue = flags::misc1(); } LatchUnsignaledConfig SurfaceFlinger::getLatchUnsignaledConfig() { Loading Loading @@ -731,6 +736,8 @@ void SurfaceFlinger::bootFinished() { enableRefreshRateOverlay(true); } })); LOG_ALWAYS_FATAL_IF(flags::misc1() != mMiscFlagValue, "misc1 flag is not boot stable!"); } static std::optional<renderengine::RenderEngine::RenderEngineType> Loading Loading @@ -5912,6 +5919,7 @@ status_t SurfaceFlinger::doDump(int fd, const DumpArgs& args, bool asProto) { } } } write(fd, result.c_str(), result.size()); return NO_ERROR; } Loading Loading @@ -6333,6 +6341,8 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, const std::string& comp result.append("SurfaceFlinger global state:\n"); colorizer.reset(result); StringAppendF(&result, "MiscFlagValue: %s\n", mMiscFlagValue ? "true" : "false"); getRenderEngine().dump(result); result.append("ClientCache state:\n"); Loading services/surfaceflinger/SurfaceFlinger.h +2 −0 Original line number Diff line number Diff line Loading @@ -1450,6 +1450,8 @@ private: void sfdo_setDebugFlash(int delay); void sfdo_scheduleComposite(); void sfdo_scheduleCommit(); bool mMiscFlagValue; }; class SurfaceComposerAIDL : public gui::BnSurfaceComposer { Loading services/surfaceflinger/surfaceflinger_flags.aconfig 0 → 100644 +9 −0 Original line number Diff line number Diff line package: "com.android.graphics.surfaceflinger.flags" flag { name: "misc1" namespace: "core_graphics" description: "This flag controls minor miscellaneous SurfaceFlinger changes" bug: "297389311" is_fixed_read_only: true } No newline at end of file Loading
services/surfaceflinger/Android.bp +15 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,17 @@ package { default_applicable_licenses: ["frameworks_native_license"], } aconfig_declarations { name: "surfaceflinger_flags", package: "com.android.graphics.surfaceflinger.flags", srcs: ["surfaceflinger_flags.aconfig"], } cc_aconfig_library { name: "libsurfaceflingerflags", aconfig_declarations: "surfaceflinger_flags", } cc_defaults { name: "surfaceflinger_defaults", cflags: [ Loading @@ -20,6 +31,9 @@ cc_defaults { "-Wconversion", "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", ], static_libs: [ "libsurfaceflingerflags", ], } cc_defaults { Loading Loading @@ -84,6 +98,7 @@ cc_defaults { "libshaders", "libtimestats", "libtonemap", "libsurfaceflingerflags", ], header_libs: [ "android.hardware.graphics.composer@2.1-command-buffer", Loading
services/surfaceflinger/SurfaceFlinger.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,8 @@ #include <aidl/android/hardware/graphics/composer3/DisplayCapability.h> #include <aidl/android/hardware/graphics/composer3/RenderIntent.h> #include <com_android_graphics_surfaceflinger_flags.h> #undef NO_THREAD_SAFETY_ANALYSIS #define NO_THREAD_SAFETY_ANALYSIS \ _Pragma("GCC error \"Prefer <ftl/fake_guard.h> or MutexUtils.h helpers.\"") Loading @@ -170,6 +172,7 @@ #define DOES_CONTAIN_BORDER false namespace android { using namespace com::android::graphics::surfaceflinger; using namespace std::chrono_literals; using namespace std::string_literals; Loading Loading @@ -490,6 +493,8 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI base::GetBoolProperty("persist.debug.sf.enable_layer_lifecycle_manager"s, true); mLegacyFrontEndEnabled = !mLayerLifecycleManagerEnabled || base::GetBoolProperty("persist.debug.sf.enable_legacy_frontend"s, false); mMiscFlagValue = flags::misc1(); } LatchUnsignaledConfig SurfaceFlinger::getLatchUnsignaledConfig() { Loading Loading @@ -731,6 +736,8 @@ void SurfaceFlinger::bootFinished() { enableRefreshRateOverlay(true); } })); LOG_ALWAYS_FATAL_IF(flags::misc1() != mMiscFlagValue, "misc1 flag is not boot stable!"); } static std::optional<renderengine::RenderEngine::RenderEngineType> Loading Loading @@ -5912,6 +5919,7 @@ status_t SurfaceFlinger::doDump(int fd, const DumpArgs& args, bool asProto) { } } } write(fd, result.c_str(), result.size()); return NO_ERROR; } Loading Loading @@ -6333,6 +6341,8 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, const std::string& comp result.append("SurfaceFlinger global state:\n"); colorizer.reset(result); StringAppendF(&result, "MiscFlagValue: %s\n", mMiscFlagValue ? "true" : "false"); getRenderEngine().dump(result); result.append("ClientCache state:\n"); Loading
services/surfaceflinger/SurfaceFlinger.h +2 −0 Original line number Diff line number Diff line Loading @@ -1450,6 +1450,8 @@ private: void sfdo_setDebugFlash(int delay); void sfdo_scheduleComposite(); void sfdo_scheduleCommit(); bool mMiscFlagValue; }; class SurfaceComposerAIDL : public gui::BnSurfaceComposer { Loading
services/surfaceflinger/surfaceflinger_flags.aconfig 0 → 100644 +9 −0 Original line number Diff line number Diff line package: "com.android.graphics.surfaceflinger.flags" flag { name: "misc1" namespace: "core_graphics" description: "This flag controls minor miscellaneous SurfaceFlinger changes" bug: "297389311" is_fixed_read_only: true } No newline at end of file