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

Commit b073a4dc authored by Matt Buckley's avatar Matt Buckley Committed by Android (Google) Code Review
Browse files

Merge "Add additional flag for FMQ SF" into main

parents 1ca3a2f3 48eb4355
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -240,7 +240,8 @@ bool PowerAdvisor::ensurePowerHintSessionRunning() {
                                                                 &mSessionConfig);
            if (ret.isOk()) {
                mHintSession = ret.value();
                if (FlagManager::getInstance().adpf_use_fmq_channel_fixed()) {
                if (FlagManager::getInstance().adpf_use_fmq_channel_fixed() &&
                    FlagManager::getInstance().adpf_fmq_sf()) {
                    setUpFmq();
                }
            }
+2 −0
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ void FlagManager::dump(std::string& result) const {
    DUMP_SERVER_FLAG(adpf_use_fmq_channel);

    /// Trunk stable readonly flags ///
    DUMP_READ_ONLY_FLAG(adpf_fmq_sf);
    DUMP_READ_ONLY_FLAG(connected_display);
    DUMP_READ_ONLY_FLAG(enable_small_area_detection);
    DUMP_READ_ONLY_FLAG(frame_rate_category_mrr);
@@ -220,6 +221,7 @@ FLAG_MANAGER_LEGACY_SERVER_FLAG(use_skia_tracing, PROPERTY_SKIA_ATRACE_ENABLED,
                                "SkiaTracingFeature__use_skia_tracing")

/// Trunk stable readonly flags ///
FLAG_MANAGER_READ_ONLY_FLAG(adpf_fmq_sf, "")
FLAG_MANAGER_READ_ONLY_FLAG(connected_display, "")
FLAG_MANAGER_READ_ONLY_FLAG(enable_small_area_detection, "")
FLAG_MANAGER_READ_ONLY_FLAG(frame_rate_category_mrr, "debug.sf.frame_rate_category_mrr")
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ public:
    bool adpf_use_fmq_channel_fixed() const;

    /// Trunk stable readonly flags ///
    bool adpf_fmq_sf() const;
    bool connected_display() const;
    bool frame_rate_category_mrr() const;
    bool enable_small_area_detection() const;
+8 −0
Original line number Diff line number Diff line
@@ -3,6 +3,14 @@
package: "com.android.graphics.surfaceflinger.flags"
container: "system"

flag {
  name: "adpf_fmq_sf"
  namespace: "game"
  description: "Guards use of the ADPF FMQ system specifically for SurfaceFlinger"
  bug: "315894228"
  is_fixed_read_only: true
} # adpf_fmq_sf

flag {
  name: "adpf_gpu_sf"
  namespace: "game"
+5 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ protected:
    int64_t mSessionId = 123;
    SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel, true);
    SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, false);
    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, false);
};

bool PowerAdvisorTest::sessionExists() {
@@ -184,6 +185,7 @@ void PowerAdvisorTest::testGpuScenario(GpuTestConfig& config, WorkDuration& ret)
    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_gpu_sf,
                      config.adpfGpuFlagOn);
    SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, config.usesFmq);
    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, config.usesFmq);
    mPowerAdvisor->onBootFinished();
    bool expectsFmqSuccess = config.usesSharedFmqFlag && !config.fmqFull;
    if (config.usesFmq) {
@@ -789,6 +791,7 @@ TEST_F(PowerAdvisorTest, fmq_sendTargetAndActualDuration_queueFull) {

TEST_F(PowerAdvisorTest, fmq_sendHint) {
    SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, true);
    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, true);
    mPowerAdvisor->onBootFinished();
    SetUpFmq(true, false);
    auto startTime = uptimeNanos();
@@ -807,6 +810,7 @@ TEST_F(PowerAdvisorTest, fmq_sendHint) {

TEST_F(PowerAdvisorTest, fmq_sendHint_noSharedFlag) {
    SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, true);
    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, true);
    mPowerAdvisor->onBootFinished();
    SetUpFmq(false, false);
    SessionHint hint;
@@ -821,6 +825,7 @@ TEST_F(PowerAdvisorTest, fmq_sendHint_noSharedFlag) {

TEST_F(PowerAdvisorTest, fmq_sendHint_queueFull) {
    SET_FLAG_FOR_TEST(android::os::adpf_use_fmq_channel_fixed, true);
    SET_FLAG_FOR_TEST(com::android::graphics::surfaceflinger::flags::adpf_fmq_sf, true);
    mPowerAdvisor->onBootFinished();
    SetUpFmq(true, true);
    ASSERT_EQ(mBackendFmq->availableToRead(), 2uL);