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

Commit 48da0709 authored by Ady Abraham's avatar Ady Abraham
Browse files

SurfaceFlinger: rename use_smart_90_for_video flag

Rename use_smart_90_for_video -> use_content_detection_for_refresh_rate
to better describe what it controls.

Test: Play video and observe the refresh rate
Change-Id: I5ae03073bd670d0b3bc7f2861cbf3ec0d28efbe7
parent 11bb5de5
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -108,7 +108,8 @@ Scheduler::Scheduler(impl::EventControlThread::SetVSyncEnabledFunction function,
        mUseContentDetectionV2(useContentDetectionV2) {
        mUseContentDetectionV2(useContentDetectionV2) {
    using namespace sysprop;
    using namespace sysprop;


    if (property_get_bool("debug.sf.use_smart_90_for_video", 0) || use_smart_90_for_video(false)) {
    if (property_get_bool("debug.sf.use_content_detection_for_refresh_rate", 0) ||
        use_content_detection_for_refresh_rate(false)) {
        if (mUseContentDetectionV2) {
        if (mUseContentDetectionV2) {
            mLayerHistory = std::make_unique<scheduler::impl::LayerHistoryV2>();
            mLayerHistory = std::make_unique<scheduler::impl::LayerHistoryV2>();
        } else {
        } else {
+12 −2
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@
#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
#include <android/hardware/configstore/1.1/types.h>
#include <android/hardware/configstore/1.1/types.h>
#include <configstore/Utils.h>
#include <configstore/Utils.h>
#include <utils/Log.h>


#include <cstdlib>
#include <cstdlib>
#include <tuple>
#include <tuple>
@@ -258,8 +259,17 @@ int32_t set_display_power_timer_ms(int32_t defaultValue) {
    return defaultValue;
    return defaultValue;
}
}


bool use_smart_90_for_video(bool defaultValue) {
bool use_content_detection_for_refresh_rate(bool defaultValue) {
    auto temp = SurfaceFlingerProperties::use_smart_90_for_video();
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    auto smart_90_deprecated = SurfaceFlingerProperties::use_smart_90_for_video();
#pragma clang diagnostic pop
    if (smart_90_deprecated.has_value()) {
        ALOGW("Using deprecated use_smart_90_for_video sysprop. Value: %d", *smart_90_deprecated);
        return *smart_90_deprecated;
    }

    auto temp = SurfaceFlingerProperties::use_content_detection_for_refresh_rate();
    if (temp.has_value()) {
    if (temp.has_value()) {
        return *temp;
        return *temp;
    }
    }
+1 −1
Original line number Original line Diff line number Diff line
@@ -81,7 +81,7 @@ int32_t set_touch_timer_ms(int32_t defaultValue);


int32_t set_display_power_timer_ms(int32_t defaultValue);
int32_t set_display_power_timer_ms(int32_t defaultValue);


bool use_smart_90_for_video(bool defaultValue);
bool use_content_detection_for_refresh_rate(bool defaultValue);


bool enable_protected_contents(bool defaultValue);
bool enable_protected_contents(bool defaultValue);


+12 −0
Original line number Original line Diff line number Diff line
@@ -344,14 +344,26 @@ prop {
    prop_name: "ro.surface_flinger.set_display_power_timer_ms"
    prop_name: "ro.surface_flinger.set_display_power_timer_ms"
}
}


# useContentDetectionForRefreshRate indicates whether Scheduler should detect content FPS, and try
# to adjust the screen refresh rate based on that.
prop {
    api_name: "use_content_detection_for_refresh_rate"
    type: Boolean
    scope: Public
    access: Readonly
    prop_name: "ro.surface_flinger.use_content_detection_for_refresh_rate"
}

# useSmart90ForVideo indicates whether Scheduler should detect content FPS, and try to adjust the
# useSmart90ForVideo indicates whether Scheduler should detect content FPS, and try to adjust the
# screen refresh rate based on that.
# screen refresh rate based on that.
# Replaced by useContentDetectionForRefreshRate
prop {
prop {
    api_name: "use_smart_90_for_video"
    api_name: "use_smart_90_for_video"
    type: Boolean
    type: Boolean
    scope: Public
    scope: Public
    access: Readonly
    access: Readonly
    prop_name: "ro.surface_flinger.use_smart_90_for_video"
    prop_name: "ro.surface_flinger.use_smart_90_for_video"
    deprecated: true
}
}


prop {
prop {
+5 −0
Original line number Original line Diff line number Diff line
@@ -111,6 +111,10 @@ props {
    api_name: "use_color_management"
    api_name: "use_color_management"
    prop_name: "ro.surface_flinger.use_color_management"
    prop_name: "ro.surface_flinger.use_color_management"
  }
  }
  prop {
    api_name: "use_content_detection_for_refresh_rate"
    prop_name: "ro.surface_flinger.use_content_detection_for_refresh_rate"
  }
  prop {
  prop {
    api_name: "use_context_priority"
    api_name: "use_context_priority"
    prop_name: "ro.surface_flinger.use_context_priority"
    prop_name: "ro.surface_flinger.use_context_priority"
@@ -118,6 +122,7 @@ props {
  prop {
  prop {
    api_name: "use_smart_90_for_video"
    api_name: "use_smart_90_for_video"
    prop_name: "ro.surface_flinger.use_smart_90_for_video"
    prop_name: "ro.surface_flinger.use_smart_90_for_video"
    deprecated: true
  }
  }
  prop {
  prop {
    api_name: "use_vr_flinger"
    api_name: "use_vr_flinger"