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

Commit ffc31d17 authored by Matt Buckley's avatar Matt Buckley
Browse files

Add ADPF FMQ flag to SF FlagManager

Bug: 315894228
Test: manual
Change-Id: Ie33ed642451daea786ea0f3efcfd96792487625f
parent 415c59e4
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ cc_defaults {
        "android.hardware.power-ndk_shared",
        "librenderengine_deps",
        "libtimestats_deps",
        "libsurfaceflinger_common_deps",
        "surfaceflinger_defaults",
    ],
    cflags: [
@@ -82,7 +83,6 @@ cc_defaults {
        "libinput",
        "libutils",
        "libSurfaceFlingerProp",
        "server_configurable_flags",
    ],
    static_libs: [
        "libaidlcommonsupport",
@@ -95,10 +95,8 @@ cc_defaults {
        "libscheduler",
        "libserviceutils",
        "libshaders",
        "libsurfaceflinger_common",
        "libtimestats",
        "libtonemap",
        "libsurfaceflingerflags",
    ],
    header_libs: [
        "android.hardware.graphics.composer@2.1-command-buffer",
+11 −18
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ cc_defaults {
        "libSurfaceFlingerProp",
        "libui",
        "libutils",
        "server_configurable_flags",
    ],
    static_libs: [
        "liblayers_proto",
@@ -90,24 +89,23 @@ filegroup {

cc_library {
    name: "libcompositionengine",
    defaults: ["libcompositionengine_defaults"],
    static_libs: [
        "libsurfaceflinger_common",
        "libsurfaceflingerflags",
    defaults: [
        "libcompositionengine_defaults",
        "libsurfaceflinger_common_deps",
    ],
    srcs: [
        ":libcompositionengine_sources",
    ],
    local_include_dirs: ["include"],
    export_include_dirs: ["include"],
    shared_libs: [
        "server_configurable_flags",
    ],
}

cc_library {
    name: "libcompositionengine_mocks",
    defaults: ["libcompositionengine_defaults"],
    defaults: [
        "libcompositionengine_defaults",
        "libsurfaceflinger_common_test_deps",
    ],
    srcs: [
        "mock/CompositionEngine.cpp",
        "mock/Display.cpp",
@@ -123,11 +121,6 @@ cc_library {
        "libgtest",
        "libgmock",
        "libcompositionengine",
        "libsurfaceflinger_common_test",
        "libsurfaceflingerflags_test",
    ],
    shared_libs: [
        "server_configurable_flags",
    ],
    local_include_dirs: ["include"],
    export_include_dirs: ["include"],
@@ -140,7 +133,10 @@ cc_test {
        "frameworks/native/services/surfaceflinger/common/include",
        "frameworks/native/services/surfaceflinger/tests/unittests",
    ],
    defaults: ["libcompositionengine_defaults"],
    defaults: [
        "libcompositionengine_defaults",
        "libsurfaceflinger_common_test_deps",
    ],
    srcs: [
        ":libcompositionengine_sources",
        "tests/planner/CachedSetTest.cpp",
@@ -166,14 +162,11 @@ cc_test {
        "librenderengine_mocks",
        "libgmock",
        "libgtest",
        "libsurfaceflinger_common_test",
        "libsurfaceflingerflags_test",
    ],
    shared_libs: [
        // For some reason, libvulkan isn't picked up from librenderengine
        // Probably ASAN related?
        "libvulkan",
        "server_configurable_flags",
    ],
    sanitize: {
        hwaddress: true,
+4 −5
Original line number Diff line number Diff line
@@ -53,7 +53,10 @@ cc_library_static {
cc_test {
    name: "libscheduler_test",
    test_suites: ["device-tests"],
    defaults: ["libscheduler_defaults"],
    defaults: [
        "libscheduler_defaults",
        "libsurfaceflinger_common_test_deps",
    ],
    srcs: [
        "tests/FrameTargeterTest.cpp",
        "tests/PresentLatencyTrackerTest.cpp",
@@ -63,9 +66,5 @@ cc_test {
        "libgmock",
        "libgtest",
        "libscheduler",
        "libsurfaceflingerflags_test",
    ],
    shared_libs: [
        "server_configurable_flags",
    ],
}
+26 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ cc_library_static {
    ],
    static_libs: [
        "libsurfaceflingerflags",
        "android.os.flags-aconfig-cc",
    ],
}

@@ -45,5 +46,30 @@ cc_library_static {
    ],
    static_libs: [
        "libsurfaceflingerflags_test",
        "android.os.flags-aconfig-cc-test",
    ],
}

cc_defaults {
    name: "libsurfaceflinger_common_deps",
    shared_libs: [
        "server_configurable_flags",
    ],
    static_libs: [
        "libsurfaceflinger_common",
        "libsurfaceflingerflags",
        "android.os.flags-aconfig-cc",
    ],
}

cc_defaults {
    name: "libsurfaceflinger_common_test_deps",
    shared_libs: [
        "server_configurable_flags",
    ],
    static_libs: [
        "libsurfaceflinger_common_test",
        "libsurfaceflingerflags_test",
        "android.os.flags-aconfig-cc-test",
    ],
}
+13 −5
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <server_configurable_flags/get_flags.h>
#include <cinttypes>

#include <android_os.h>
#include <com_android_graphics_surfaceflinger_flags.h>

namespace android {
@@ -109,6 +110,7 @@ void FlagManager::dump(std::string& result) const {

    /// Trunk stable server flags ///
    DUMP_SERVER_FLAG(refresh_rate_overlay_on_external_display);
    DUMP_SERVER_FLAG(adpf_use_fmq_channel);

    /// Trunk stable readonly flags ///
    DUMP_READ_ONLY_FLAG(connected_display);
@@ -158,7 +160,7 @@ bool FlagManager::getServerConfigurableFlag(const char* experimentFlagName) cons
        return getServerConfigurableFlag(serverFlagName);                                   \
    }

#define FLAG_MANAGER_FLAG_INTERNAL(name, syspropOverride, checkForBootCompleted)                \
#define FLAG_MANAGER_FLAG_INTERNAL(name, syspropOverride, checkForBootCompleted, owner)         \
    bool FlagManager::name() const {                                                            \
        if (checkForBootCompleted) {                                                            \
            LOG_ALWAYS_FATAL_IF(!mBootCompleted,                                                \
@@ -166,21 +168,24 @@ bool FlagManager::getServerConfigurableFlag(const char* experimentFlagName) cons
                                __func__);                                                      \
        }                                                                                       \
        static const std::optional<bool> debugOverride = getBoolProperty(syspropOverride);      \
        static const bool value = getFlagValue([] { return flags::name(); }, debugOverride);    \
        static const bool value = getFlagValue([] { return owner ::name(); }, debugOverride);   \
        if (mUnitTestMode) {                                                                    \
            /*                                                                                  \
             * When testing, we don't want to rely on the cached `value` or the debugOverride.  \
             */                                                                                 \
            return flags::name();                                                               \
            return owner ::name();                                                              \
        }                                                                                       \
        return value;                                                                           \
    }

#define FLAG_MANAGER_SERVER_FLAG(name, syspropOverride) \
    FLAG_MANAGER_FLAG_INTERNAL(name, syspropOverride, true)
    FLAG_MANAGER_FLAG_INTERNAL(name, syspropOverride, true, flags)

#define FLAG_MANAGER_READ_ONLY_FLAG(name, syspropOverride) \
    FLAG_MANAGER_FLAG_INTERNAL(name, syspropOverride, false)
    FLAG_MANAGER_FLAG_INTERNAL(name, syspropOverride, false, flags)

#define FLAG_MANAGER_SERVER_FLAG_IMPORTED(name, syspropOverride, owner) \
    FLAG_MANAGER_FLAG_INTERNAL(name, syspropOverride, true, owner)

/// Legacy server flags ///
FLAG_MANAGER_LEGACY_SERVER_FLAG(test_flag, "", "")
@@ -216,4 +221,7 @@ FLAG_MANAGER_READ_ONLY_FLAG(protected_if_client, "")
/// Trunk stable server flags ///
FLAG_MANAGER_SERVER_FLAG(refresh_rate_overlay_on_external_display, "")

/// Trunk stable server flags from outside SurfaceFlinger ///
FLAG_MANAGER_SERVER_FLAG_IMPORTED(adpf_use_fmq_channel, "", android::os)

} // namespace android
Loading