From 2dd1a62ca49c88a01654b4af424949d32fb4ea73 Mon Sep 17 00:00:00 2001 From: Matt Buckley Date: Wed, 3 Aug 2022 21:40:12 +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: manual Change-Id: Idb7dad41852c71bff9b3c63d2d75849128288080 --- conf/init.pantah.rc | 8 ++++++++ device-cheetah.mk | 4 ++++ device-panther.mk | 4 ++++ powerhint-cheetah-a0.json | 28 ---------------------------- powerhint-cheetah.json | 28 ---------------------------- powerhint-panther-a0.json | 22 ---------------------- powerhint-panther.json | 22 ---------------------- 7 files changed, 16 insertions(+), 100 deletions(-) diff --git a/conf/init.pantah.rc b/conf/init.pantah.rc index 7c64e7e..b1ad297 100644 --- a/conf/init.pantah.rc +++ b/conf/init.pantah.rc @@ -130,3 +130,11 @@ on property:vendor.device.modules.ready=1 chown system system /proc/focaltech_touch/selftest/Scap_Rawdata chown system system /proc/focaltech_touch/selftest/Short chown system system /proc/focaltech_touch/selftest/Strength + +# 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-cheetah.mk b/device-cheetah.mk index e4d80fb..a7c3d9c 100644 --- a/device-cheetah.mk +++ b/device-cheetah.mk @@ -333,3 +333,7 @@ PRODUCT_VENDOR_PROPERTIES += \ # 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/device-panther.mk b/device-panther.mk index 1a3bb65..a2f4b53 100644 --- a/device-panther.mk +++ b/device-panther.mk @@ -319,3 +319,7 @@ PRODUCT_VENDOR_PROPERTIES += \ # 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-cheetah-a0.json b/powerhint-cheetah-a0.json index 79588d9..ec24509 100644 --- a/powerhint-cheetah-a0.json +++ b/powerhint-cheetah-a0.json @@ -162,16 +162,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", @@ -530,18 +520,6 @@ } ], "Actions": [ - { - "PowerHint": "INTERACTION", - "Node": "SFUClampBoost", - "Duration": 5000, - "Value": "85" - }, - { - "PowerHint": "LAUNCH_120FPS", - "Node": "SFUClampBoost", - "Duration": 1000, - "Value": "159" - }, { "PowerHint": "LAUNCH", "Node": "FGPreferIdle", @@ -553,12 +531,6 @@ "Type": "DoHint", "Value": "LAUNCH_120FPS" }, - { - "PowerHint": "LAUNCH", - "Node": "SFUClampBoost", - "Duration": 5000, - "Value": "85" - }, { "PowerHint": "LAUNCH", "Node": "CPUBigClusterMaxFreq", diff --git a/powerhint-cheetah.json b/powerhint-cheetah.json index a42dc48..772b4e8 100644 --- a/powerhint-cheetah.json +++ b/powerhint-cheetah.json @@ -188,16 +188,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", @@ -536,12 +526,6 @@ } ], "Actions": [ - { - "PowerHint": "INTERACTION", - "Node": "SFUClampBoost", - "Duration": 5000, - "Value": "85" - }, { "PowerHint": "LAUNCH", "Node": "UClampThreshold", @@ -560,12 +544,6 @@ "Duration": 1000, "Value": "10" }, - { - "PowerHint": "LAUNCH_120FPS", - "Node": "SFUClampBoost", - "Duration": 1000, - "Value": "159" - }, { "PowerHint": "LAUNCH", "Node": "FGPreferIdle", @@ -582,12 +560,6 @@ "Type": "DoHint", "Value": "LAUNCH_GPU" }, - { - "PowerHint": "LAUNCH", - "Node": "SFUClampBoost", - "Duration": 5000, - "Value": "85" - }, { "PowerHint": "LAUNCH", "Node": "CPUBigClusterMaxFreq", diff --git a/powerhint-panther-a0.json b/powerhint-panther-a0.json index 98883cb..f26e9be 100644 --- a/powerhint-panther-a0.json +++ b/powerhint-panther-a0.json @@ -151,16 +151,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", @@ -519,24 +509,12 @@ } ], "Actions": [ - { - "PowerHint": "INTERACTION", - "Node": "SFUClampBoost", - "Duration": 5000, - "Value": "85" - }, { "PowerHint": "LAUNCH", "Node": "FGPreferIdle", "Duration": 5000, "Value": "1" }, - { - "PowerHint": "LAUNCH", - "Node": "SFUClampBoost", - "Duration": 5000, - "Value": "85" - }, { "PowerHint": "LAUNCH", "Node": "CPUBigClusterMaxFreq", diff --git a/powerhint-panther.json b/powerhint-panther.json index 800376c..e037835 100644 --- a/powerhint-panther.json +++ b/powerhint-panther.json @@ -168,16 +168,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", @@ -516,12 +506,6 @@ } ], "Actions": [ - { - "PowerHint": "INTERACTION", - "Node": "SFUClampBoost", - "Duration": 5000, - "Value": "85" - }, { "PowerHint": "LAUNCH", "Node": "UClampThreshold", @@ -540,12 +524,6 @@ "Duration": 5000, "Value": "1" }, - { - "PowerHint": "LAUNCH", - "Node": "SFUClampBoost", - "Duration": 5000, - "Value": "85" - }, { "PowerHint": "LAUNCH", "Node": "CPUBigClusterMaxFreq",