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

Commit be59c0da authored by Ady Abraham's avatar Ady Abraham
Browse files

SurfaceFlinger: expose idle timer as device config

Add a device config for idle timer to allow setting it from
a device.mk file

Bug: 126270036
Test: flashall the build and observe idle timer value
Change-Id: Ic1af3fd20b497a52e9740d898754c0c9eeb223ef
parent 97d0423a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -67,9 +67,14 @@ Scheduler::Scheduler(impl::EventControlThread::SetVSyncEnabledFunction function)
    mPrimaryDispSync = std::move(primaryDispSync);
    mEventControlThread = std::make_unique<impl::EventControlThread>(function);

    mSetIdleTimerMs = set_idle_timer_ms(0);

    char value[PROPERTY_VALUE_MAX];
    property_get("debug.sf.set_idle_timer_ms", value, "0");
    int int_value = atoi(value);
    if (int_value) {
        mSetIdleTimerMs = atoi(value);
    }

    if (mSetIdleTimerMs > 0) {
        mIdleTimer =
+8 −0
Original line number Diff line number Diff line
@@ -209,6 +209,14 @@ int32_t wcg_composition_pixel_format(PixelFormat defaultValue) {
    return static_cast<int32_t>(defaultValue);
}

int32_t set_idle_timer_ms(int32_t defaultValue) {
    auto temp = SurfaceFlingerProperties::set_idle_timer_ms();
    if (temp.has_value()) {
        return *temp;
    }
    return defaultValue;
}

#define DISPLAY_PRIMARY_SIZE 3

constexpr float kSrgbRedX = 0.4123f;
+2 −0
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ int64_t wcg_composition_dataspace(
int32_t wcg_composition_pixel_format(
        android::hardware::graphics::common::V1_2::PixelFormat defaultValue);

int32_t set_idle_timer_ms(int32_t defaultValue);

android::ui::DisplayPrimaries getDisplayNativePrimaries();
} // namespace sysprop
} // namespace android
+11 −0
Original line number Diff line number Diff line
@@ -286,3 +286,14 @@ prop {
    access: Readonly
    prop_name: "ro.surface_flinger.display_primary_white"
}

# setIdleTimerMs indicates what is considered a timeout in milliseconds for Scheduler. This value is
# used by the Scheduler to trigger inactivity callbacks that will switch the display to a lower
# refresh rate. Setting this property to 0 means there is no timer.
prop {
    api_name: "set_idle_timer_ms"
    type: Integer
    scope: Internal
    access: Readonly
    prop_name: "ro.surface_flinger.set_idle_timer_ms"
}