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

Commit 05364926 authored by Ady Abraham's avatar Ady Abraham Committed by Android (Google) Code Review
Browse files

Merge "SurfaceFlinger: add a sysprop to control frame rate override"

parents 6089b7e4 4899ff82
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <utils/Trace.h>
#include <chrono>
#include <cmath>
#include "../SurfaceFlingerProperties.h"

#undef LOG_TAG
#define LOG_TAG "RefreshRateConfigs"
@@ -555,6 +556,7 @@ RefreshRateConfigs::RefreshRateConfigs(
    mMaxSupportedRefreshRate = sortedConfigs.back();

    mSupportsFrameRateOverride = false;
    if (android::sysprop::enable_frame_rate_override(true)) {
        for (const auto& config1 : sortedConfigs) {
            for (const auto& config2 : sortedConfigs) {
                if (getFrameRateDivider(config1->getFps(), config2->getFps()) >= 2) {
@@ -563,6 +565,8 @@ RefreshRateConfigs::RefreshRateConfigs(
                }
            }
        }
    }

    constructAvailableRefreshRates();
}

+4 −0
Original line number Diff line number Diff line
@@ -376,5 +376,9 @@ bool update_device_product_info_on_hotplug_reconnect(bool defaultValue) {
            defaultValue);
}

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

} // namespace sysprop
} // namespace android
+2 −0
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@ android::ui::DisplayPrimaries getDisplayNativePrimaries();

bool update_device_product_info_on_hotplug_reconnect(bool defaultValue);

bool enable_frame_rate_override(bool defaultValue);

} // namespace sysprop
} // namespace android
#endif // SURFACEFLINGERPROPERTIES_H_
+9 −0
Original line number Diff line number Diff line
@@ -445,3 +445,12 @@ prop {
    access: Readonly
    prop_name: "ro.surface_flinger.update_device_product_info_on_hotplug_reconnect"
}

# Enables the frame rate override feature
prop {
    api_name: "enable_frame_rate_override"
    type: Boolean
    scope: Public
    access: Readonly
    prop_name: "ro.surface_flinger.enable_frame_rate_override"
}
+4 −0
Original line number Diff line number Diff line
@@ -40,6 +40,10 @@ props {
    type: Integer
    prop_name: "ro.surface_flinger.display_update_imminent_timeout_ms"
  }
  prop {
    api_name: "enable_frame_rate_override"
    prop_name: "ro.surface_flinger.enable_frame_rate_override"
  }
  prop {
    api_name: "enable_protected_contents"
    prop_name: "ro.surface_flinger.protected_contents"