From b031889746d745940446f10e8443c338dd0171c4 Mon Sep 17 00:00:00 2001 From: jimmyshiu Date: Mon, 29 Aug 2022 06:48:58 +0000 Subject: [PATCH] Enable ADPF CPU hints for SF Allow these devices to send CPU hints to PowerHAL from SF to reduce drops and save power. Bug: b/241152899 Bug: b/195990840 Test: https://android-build.googleplex.com/builds/abtd/run/L70800000956157278 Change-Id: I81df99f4ec01f417d1589e2323de599819993590 (Port from commit 8a419466b86ab07a25fc18d7d6a2a9ee154f6839) --- conf/init.lynx.rc | 8 ++++++++ device-lynx.mk | 4 ++++ powerhint.json | 22 ---------------------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/conf/init.lynx.rc b/conf/init.lynx.rc index c55b27d..a8d0818 100644 --- a/conf/init.lynx.rc +++ b/conf/init.lynx.rc @@ -89,3 +89,11 @@ on property:vendor.device.modules.ready=1 chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ss_base chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ss_diff chown system system /sys/devices/virtual/goog_touch_interface/gti.0/ss_raw + +# Override SF and RE uclamps to 0 on boot after being set elsewhere, for adpf cpu hints +on property:sys.boot_completed=1 + trigger override-sf-uclamp + +on override-sf-uclamp + write /proc/vendor_sched/rt_uclamp_min 0 + write /proc/vendor_sched/sf_uclamp_min 0 diff --git a/device-lynx.mk b/device-lynx.mk index d3f4273..a4f2d00 100644 --- a/device-lynx.mk +++ b/device-lynx.mk @@ -215,3 +215,7 @@ USE_GMSCORE_PREBUILT_Y2022W28 := true # Device features PRODUCT_COPY_FILES += \ frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml + +# Enable adpf cpu hint session for SurfaceFlinger +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ + debug.sf.enable_adpf_cpu_hint=true diff --git a/powerhint.json b/powerhint.json index ee82abe..a9c8223 100644 --- a/powerhint.json +++ b/powerhint.json @@ -169,16 +169,6 @@ ], "ResetOnInit": true }, - { - "Name": "SFUClampBoost", - "Path": "/proc/vendor_sched/sf_uclamp_min", - "Values": [ - "159", - "85", - "39" - ], - "ResetOnInit": true - }, { "Name": "MLUclampBoost", "Path": "/proc/vendor_sched/nnapi_uclamp_min", @@ -497,12 +487,6 @@ } ], "Actions": [ - { - "PowerHint": "INTERACTION", - "Node": "SFUClampBoost", - "Duration": 5000, - "Value": "85" - }, { "PowerHint": "LAUNCH", "Node": "UClampThreshold", @@ -521,12 +505,6 @@ "Duration": 5000, "Value": "1" }, - { - "PowerHint": "LAUNCH", - "Node": "SFUClampBoost", - "Duration": 5000, - "Value": "85" - }, { "PowerHint": "LAUNCH", "Node": "CPUBigClusterMaxFreq",