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

Commit 884bf013 authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: use SurfaceFlingerProperties for frame_rate_override_global

This flag is accessed from DisplayManager in addition to SF,
so add it to SurfaceFlingerProperties instead of hardcoded flag.

Test: atest DisplayModeDirectorTests
Bug: 241447632
Change-Id: I1951bc5e17ec0f6304ecb91aa83555b8cce5e73a
parent ace3d054
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2830,7 +2830,7 @@ sp<DisplayDevice> SurfaceFlinger::setupNewDisplayDeviceInternal(
                return Config::FrameRateOverride::AppOverrideNativeRefreshRates;
            }

            if (!base::GetBoolProperty("debug.sf.frame_rate_override_global"s, false)) {
            if (!sysprop::frame_rate_override_global(false)) {
                return Config::FrameRateOverride::AppOverride;
            }

+4 −0
Original line number Diff line number Diff line
@@ -371,6 +371,10 @@ bool frame_rate_override_for_native_rates(bool defaultValue) {
    return SurfaceFlingerProperties::frame_rate_override_for_native_rates().value_or(defaultValue);
}

bool frame_rate_override_global(bool defaultValue) {
    return SurfaceFlingerProperties::frame_rate_override_global().value_or(defaultValue);
}

bool enable_layer_caching(bool defaultValue) {
    return SurfaceFlingerProperties::enable_layer_caching().value_or(defaultValue);
}
+2 −0
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@ bool enable_frame_rate_override(bool defaultValue);

bool frame_rate_override_for_native_rates(bool defaultValue);

bool frame_rate_override_global(bool defaultValue);

bool enable_layer_caching(bool defaultValue);

bool enable_sdr_dimming(bool defaultValue);
+12 −2
Original line number Diff line number Diff line
@@ -447,8 +447,8 @@ prop {

# Limits the frame rate override feature (enable_frame_rate_override) to override the refresh rate
# to native display refresh rates only. Before introducing this flag, native display refresh rates
# was the default behvaiour. With this flag we can control which behaviour we want explicitly.
# This flag is intoruduced as a fail-safe machanism and planned to be defaulted to false.
# was the default behaviour. With this flag we can control which behaviour we want explicitly.
# This flag is introduced as a fail-safe mechanism and planned to be defaulted to false.
prop {
    api_name: "frame_rate_override_for_native_rates"
    type: Boolean
@@ -457,6 +457,16 @@ prop {
    prop_name: "ro.surface_flinger.frame_rate_override_for_native_rates"
}

# Enables the frame rate override feature (enable_frame_rate_override) to
# override the frame rate globally instead of only for individual apps.
prop {
    api_name: "frame_rate_override_global"
    type: Boolean
    scope: Public
    access: Readonly
    prop_name: "ro.surface_flinger.frame_rate_override_global"
}

# Enables Layer Caching
prop {
    api_name: "enable_layer_caching"
+4 −0
Original line number Diff line number Diff line
@@ -64,6 +64,10 @@ props {
    api_name: "frame_rate_override_for_native_rates"
    prop_name: "ro.surface_flinger.frame_rate_override_for_native_rates"
  }
  prop {
    api_name: "frame_rate_override_global"
    prop_name: "ro.surface_flinger.frame_rate_override_global"
  }
  prop {
    api_name: "has_HDR_display"
    prop_name: "ro.surface_flinger.has_HDR_display"