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

Commit 5b8e0fbe authored by Andy Yu's avatar Andy Yu Committed by Android (Google) Code Review
Browse files

Merge "Refactor game-related frame rate override to LayerHistory" into main

parents 191a5fd1 8c2703df
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -2782,9 +2782,16 @@ status_t SurfaceComposerClient::getHdrOutputConversionSupport(bool* isSupported)
    return statusTFromBinderStatus(status);
}

status_t SurfaceComposerClient::setOverrideFrameRate(uid_t uid, float frameRate) {
status_t SurfaceComposerClient::setGameModeFrameRateOverride(uid_t uid, float frameRate) {
    binder::Status status =
            ComposerServiceAIDL::getComposerService()->setOverrideFrameRate(uid, frameRate);
            ComposerServiceAIDL::getComposerService()->setGameModeFrameRateOverride(uid, frameRate);
    return statusTFromBinderStatus(status);
}

status_t SurfaceComposerClient::setGameDefaultFrameRateOverride(uid_t uid, float frameRate) {
    binder::Status status =
            ComposerServiceAIDL::getComposerService()->setGameDefaultFrameRateOverride(uid,
                                                                                       frameRate);
    return statusTFromBinderStatus(status);
}

+12 −1
Original line number Diff line number Diff line
@@ -477,10 +477,21 @@ interface ISurfaceComposer {

    /**
     * Set the override frame rate for a specified uid by GameManagerService.
     * This override is controlled by game mode interventions.
     * Passing the frame rate and uid to SurfaceFlinger to update the override mapping
     * in the LayerHistory.
     */
    void setGameModeFrameRateOverride(int uid, float frameRate);

    /**
     * Set the override frame rate for a specified uid by GameManagerService.
     * This override is controlled by game default frame rate sysprop:
     * "ro.surface_flinger.game_default_frame_rate_override" holding the override value,
     * "persisit.graphics.game_default_frame_rate.enabled" to determine if it's enabled.
     * Passing the frame rate and uid to SurfaceFlinger to update the override mapping
     * in the scheduler.
     */
    void setOverrideFrameRate(int uid, float frameRate);
    void setGameDefaultFrameRateOverride(int uid, float frameRate);

    oneway void updateSmallAreaDetection(in int[] appIds, in float[] thresholds);

+2 −1
Original line number Diff line number Diff line
@@ -149,7 +149,8 @@ public:
                (const gui::Color&, const gui::Color&, float, float, float), (override));
    MOCK_METHOD(binder::Status, getDisplayDecorationSupport,
                (const sp<IBinder>&, std::optional<gui::DisplayDecorationSupport>*), (override));
    MOCK_METHOD(binder::Status, setOverrideFrameRate, (int32_t, float), (override));
    MOCK_METHOD(binder::Status, setGameModeFrameRateOverride, (int32_t, float), (override));
    MOCK_METHOD(binder::Status, setGameDefaultFrameRateOverride, (int32_t, float), (override));
    MOCK_METHOD(binder::Status, enableRefreshRateOverlay, (bool), (override));
    MOCK_METHOD(binder::Status, setDebugFlash, (int), (override));
    MOCK_METHOD(binder::Status, scheduleComposite, (), (override));
+7 −1
Original line number Diff line number Diff line
@@ -201,7 +201,13 @@ public:

    // Sets the frame rate of a particular app (uid). This is currently called
    // by GameManager.
    static status_t setOverrideFrameRate(uid_t uid, float frameRate);
    static status_t setGameModeFrameRateOverride(uid_t uid, float frameRate);

    // Sets the frame rate of a particular app (uid). This is currently called
    // by GameManager and controlled by two sysprops:
    // "ro.surface_flinger.game_default_frame_rate_override" holding the override value,
    // "persisit.graphics.game_default_frame_rate.enabled" to determine if it's enabled.
    static status_t setGameDefaultFrameRateOverride(uid_t uid, float frameRate);

    // Update the small area detection whole appId-threshold mappings by same size appId and
    // threshold vector.
+5 −1
Original line number Diff line number Diff line
@@ -921,7 +921,11 @@ public:
        return binder::Status::ok();
    }

    binder::Status setOverrideFrameRate(int32_t /*uid*/, float /*frameRate*/) override {
    binder::Status setGameModeFrameRateOverride(int32_t /*uid*/, float /*frameRate*/) override {
        return binder::Status::ok();
    }

    binder::Status setGameDefaultFrameRateOverride(int32_t /*uid*/, float /*frameRate*/) override {
        return binder::Status::ok();
    }

Loading