sky: Switch to OSS libperfmgr

Entirely re-written powerhint.

Change-Id: Ib4dfdb7fafd0e0bab6591fe516a3d87e42a06ffe
This commit is contained in:
Vaisakh Murali
2024-06-18 22:48:00 +05:30
committed by Lostark13
parent 4224592289
commit 5f86373e76
3 changed files with 693 additions and 31 deletions

685
configs/powerhint.json Normal file
View File

@@ -0,0 +1,685 @@
{
"Nodes": [
{
"Name": "CPULittleClusterMaxFreq",
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq",
"Values": [
"9999999",
"1958400",
"1804800"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
"Name": "CPULittleClusterMinFreq",
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq",
"Values": [
"9999999",
"1632000",
"1478400",
"1286400",
"1094400",
"921600",
"806400",
"672000",
"499200"
],
"ResetOnInit": true
},
{
"Name": "CPUBigClusterMaxFreq",
"Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq",
"Values": [
"9999999",
"2208000",
"2131200"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
"Name": "CPUBigClusterMinFreq",
"Path": "/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq",
"Values": [
"9999999",
"2054400",
"1900800",
"1651200",
"1497600",
"1344000",
"1190400",
"960000",
"691200"
],
"ResetOnInit": true
},
{
"Name": "GPUMaxFreq",
"Path": "/sys/class/kgsl/kgsl-3d0/max_pwrlevel",
"Values": [
"0",
"1",
"3"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
"Name": "GPUMinFreq",
"Path": "/sys/class/kgsl/kgsl-3d0/min_pwrlevel",
"Values": [
"0",
"3",
"6"
],
"ResetOnInit": true
},
{
"Name": "GPUBusMinFreq",
"Path": "/sys/class/devfreq/3d00000.qcom,kgsl-3d0/min_freq",
"Values": [
"955000000",
"850000000",
"765000000",
"605000000",
"500000000",
"340000000",
"0"
],
"ResetOnInit": true
},
{
"Name": "GPUForceRailOn",
"Path": "/sys/class/kgsl/kgsl-3d0/force_rail_on",
"Values": [
"1",
"0"
],
"ResetOnInit": true
},
{
"Name": "GPUForceClkOn",
"Path": "/sys/class/kgsl/kgsl-3d0/force_clk_on",
"Values": [
"1",
"0"
],
"ResetOnInit": true
},
{
"Name": "GPUIdleTimer",
"Path": "/sys/class/kgsl/kgsl-3d0/idle_timer",
"Values": [
"10000",
"50"
],
"ResetOnInit": true
},
{
"Name": "UclampTAMin",
"Path": "/dev/cpuctl/top-app/cpu.uclamp.min",
"Values": [
"26",
"0",
"30",
"35",
"45"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
"Name": "UclampTALatency",
"Path": "/dev/cpuctl/top-app/cpu.uclamp.latency_sensitive",
"Values": [
"1",
"0"
],
"ResetOnInit": true
},
{
"Name": "UclampCDMin",
"Path": "/dev/cpuctl/camera-daemon/cpu.uclamp.min",
"Values": [
"26",
"0",
"30",
"35",
"45"
],
"ResetOnInit": true
},
{
"Name": "UclampCDLatency",
"Path": "/dev/cpuctl/camera-daemon/cpu.uclamp.latency_sensitive",
"Values": [
"1",
"0"
],
"ResetOnInit": true
},
{
"Name": "CPUBWHystTriggerCount",
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/hyst_trigger_count",
"Values": [
"0",
"3"
],
"ResetOnInit": true
},
{
"Name": "CPUBWHistMemory",
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/hist_memory",
"Values": [
"0",
"20"
],
"ResetOnInit": true
},
{
"Name": "CPUBWHystLength",
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/hyst_length",
"Values": [
"0",
"10"
],
"ResetOnInit": true
},
{
"Name": "CPUBWSampleMs",
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/sample_ms",
"Values": [
"10",
"4"
],
"ResetOnInit": true
},
{
"Name": "CPUBWIOPercent",
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/io_percent",
"Values": [
"80",
"34"
],
"ResetOnInit": true
},
{
"Name": "CPUBWMinFreq",
"Path": "/sys/devices/system/cpu/bus_dcvs/DDR/19091000.qcom,bwmon-ddr/min_freq",
"Values": [
"547000",
"768000",
"1017000",
"1353600",
"1555000",
"1708000",
"2092000"
],
"ResetOnInit": true
},
{
"Name": "L3LittleClusterMinFreq",
"Path": "/sys/devices/system/cpu/bus_dcvs/L3/soc:qcom,memlat:ddr:silver/min_freq",
"Values": [
"1804",
"1632",
"499"
],
"ResetOnInit": true
},
{
"Name": "L3BigClusterMinFreq",
"Path": "/sys/devices/system/cpu/bus_dcvs/L3/soc:qcom,memlat:ddr:gold/min_freq",
"Values": [
"2208",
"2054",
"691"
],
"ResetOnInit": true
},
{
"Name": "PMQoSCpuDmaLatency",
"Path": "/dev/cpu_dma_latency",
"Values": [
"44",
"100"
],
"HoldFd": true
},
{
"Name": "EnergyAware",
"Path": "/proc/sys/kernel/sched_energy_aware",
"Values": [
"0",
"1"
],
"ResetOnInit": true
},
{
"Name": "PowerHALMainState",
"Path": "vendor.powerhal.state",
"Values": [
"SUSTAINED_PERFORMANCE",
""
],
"Type": "Property"
},
{
"Name": "PowerHALAudioState",
"Path": "vendor.powerhal.audio",
"Values": [
"AUDIO_STREAMING_LOW_LATENCY",
""
],
"Type": "Property"
},
{
"Name": "PowerHALRenderingState",
"Path": "vendor.powerhal.rendering",
"Values": [
"EXPENSIVE_RENDERING",
""
],
"Type": "Property"
}
],
"Actions": [
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "PowerHALMainState",
"Duration": 0,
"Value": "SUSTAINED_PERFORMANCE"
},
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "CPUBigClusterMaxFreq",
"Duration": 0,
"Value": "2208000"
},
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "CPULittleClusterMaxFreq",
"Duration": 0,
"Value": "1958400"
},
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "GPUMaxFreq",
"Duration": 0,
"Value": "3"
},
{
"PowerHint": "INTERACTION",
"Node": "CPULittleClusterMinFreq",
"Duration": 0,
"Value": "1286400"
},
{
"PowerHint": "INTERACTION",
"Node": "UclampTALatency",
"Duration": 0,
"Value": "1"
},
{
"PowerHint": "LAUNCH",
"Node": "UclampTAMin",
"Duration": 3000,
"Value": "45"
},
{
"PowerHint": "INTERACTION",
"Node": "CPUBWHystTriggerCount",
"Duration": 0,
"Value": "0"
},
{
"PowerHint": "INTERACTION",
"Node": "CPUBWHystLength",
"Duration": 0,
"Value": "0"
},
{
"PowerHint": "INTERACTION",
"Node": "CPUBWHistMemory",
"Duration": 0,
"Value": "0"
},
{
"PowerHint": "INTERACTION",
"Node": "CPUBWMinFreq",
"Duration": 0,
"Value": "1555000"
},
{
"PowerHint": "LAUNCH",
"Node": "EnergyAware",
"Duration": 5000,
"Value": "0"
},
{
"PowerHint": "LAUNCH",
"Node": "CPUBigClusterMaxFreq",
"Duration": 5000,
"Value": "9999999"
},
{
"PowerHint": "LAUNCH",
"Node": "CPUBigClusterMinFreq",
"Duration": 5000,
"Value": "9999999"
},
{
"PowerHint": "LAUNCH",
"Node": "CPULittleClusterMinFreq",
"Duration": 5000,
"Value": "9999999"
},
{
"PowerHint": "LAUNCH",
"Node": "PMQoSCpuDmaLatency",
"Duration": 5000,
"Value": "44"
},
{
"PowerHint": "LAUNCH",
"Node": "CPUBWHystTriggerCount",
"Duration": 5000,
"Value": "0"
},
{
"PowerHint": "LAUNCH",
"Node": "CPUBWHystLength",
"Duration": 5000,
"Value": "0"
},
{
"PowerHint": "LAUNCH",
"Node": "CPUBWHistMemory",
"Duration": 5000,
"Value": "0"
},
{
"PowerHint": "LAUNCH",
"Node": "CPUBWMinFreq",
"Duration": 5000,
"Value": "2092000"
},
{
"PowerHint": "LAUNCH",
"Node": "GPUForceClkOn",
"Duration": 5000,
"Value": "1"
},
{
"PowerHint": "LAUNCH",
"Node": "GPUForceRailOn",
"Duration": 5000,
"Value": "1"
},
{
"PowerHint": "LAUNCH",
"Node": "GPUIdleTimer",
"Duration": 5000,
"Value": "10000"
},
{
"PowerHint": "LAUNCH",
"Node": "L3LittleClusterMinFreq",
"Duration": 5000,
"Value": "1804"
},
{
"PowerHint": "LAUNCH",
"Node": "L3BigClusterMinFreq",
"Duration": 5000,
"Value": "2208"
},
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "EnergyAware",
"Duration": 1000,
"Value": "0"
},
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "UclampCDMin",
"Duration": 1000,
"Value": "30"
},
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "CPUBigClusterMaxFreq",
"Duration": 1000,
"Value": "9999999"
},
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "CPUBigClusterMinFreq",
"Duration": 1000,
"Value": "9999999"
},
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "CPULittleClusterMaxFreq",
"Duration": 1000,
"Value": "9999999"
},
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "CPULittleClusterMinFreq",
"Duration": 1000,
"Value": "9999999"
},
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "PMQoSCpuDmaLatency",
"Duration": 1000,
"Value": "44"
},
{
"PowerHint": "CAMERA_STREAMING_MID",
"Node": "CPUBigClusterMaxFreq",
"Duration": 0,
"Value": "2131200"
},
{
"PowerHint": "CAMERA_STREAMING_MID",
"Node": "CPUBWSampleMs",
"Duration": 0,
"Value": "10"
},
{
"PowerHint": "CAMERA_STREAMING_MID",
"Node": "CPUBWIOPercent",
"Duration": 0,
"Value": "80"
},
{
"PowerHint": "CAMERA_STREAMING_MID",
"Node": "UclampCDMin",
"Duration": 0,
"Value": "30"
},
{
"PowerHint": "CAMERA_STREAMING_MID",
"Node": "UclampCDLatency",
"Duration": 0,
"Value": "1"
},
{
"PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "CPUBigClusterMaxFreq",
"Duration": 0,
"Value": "2131200"
},
{
"PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "UclampCDMin",
"Duration": 0,
"Value": "30"
},
{
"PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "UclampCDLatency",
"Duration": 0,
"Value": "1"
},
{
"PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "CPUBWSampleMs",
"Duration": 0,
"Value": "10"
},
{
"PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "CPUBWIOPercent",
"Duration": 0,
"Value": "80"
},
{
"PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "CPUBWHystTriggerCount",
"Duration": 0,
"Value": "0"
},
{
"PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "CPUBWHystLength",
"Duration": 0,
"Value": "0"
},
{
"PowerHint": "CAMERA_STREAMING_LOW",
"Node": "CPUBigClusterMaxFreq",
"Duration": 0,
"Value": "2131200"
},
{
"PowerHint": "CAMERA_STREAMING_LOW",
"Node": "CPUBWSampleMs",
"Duration": 0,
"Value": "10"
},
{
"PowerHint": "CAMERA_STREAMING_LOW",
"Node": "CPUBWIOPercent",
"Duration": 0,
"Value": "80"
},
{
"PowerHint": "CAMERA_STREAMING_LOW",
"Node": "CPUBWHystTriggerCount",
"Duration": 0,
"Value": "0"
},
{
"PowerHint": "CAMERA_STREAMING_LOW",
"Node": "CPUBWHystLength",
"Duration": 0,
"Value": "0"
},
{
"PowerHint": "CAMERA_STREAMING_SECURE",
"Node": "CPUBigClusterMaxFreq",
"Duration": 0,
"Value": "2131200"
},
{
"PowerHint": "CAMERA_STREAMING_SECURE",
"Node": "CPUBWSampleMs",
"Duration": 0,
"Value": "10"
},
{
"PowerHint": "CAMERA_STREAMING_SECURE",
"Node": "CPUBWIOPercent",
"Duration": 0,
"Value": "80"
},
{
"PowerHint": "CAMERA_SHOT",
"Node": "EnergyAware",
"Duration": 1000,
"Value": "0"
},
{
"PowerHint": "CAMERA_SHOT",
"Node": "CPUBigClusterMaxFreq",
"Duration": 1000,
"Value": "9999999"
},
{
"PowerHint": "CAMERA_SHOT",
"Node": "CPUBigClusterMinFreq",
"Duration": 1000,
"Value": "9999999"
},
{
"PowerHint": "CAMERA_SHOT",
"Node": "CPULittleClusterMaxFreq",
"Duration": 1000,
"Value": "9999999"
},
{
"PowerHint": "CAMERA_SHOT",
"Node": "CPULittleClusterMinFreq",
"Duration": 1000,
"Value": "9999999"
},
{
"PowerHint": "CAMERA_SHOT",
"Node": "PMQoSCpuDmaLatency",
"Duration": 1000,
"Value": "44"
},
{
"PowerHint": "AUDIO_LAUNCH",
"Node": "PMQoSCpuDmaLatency",
"Duration": 2000,
"Value": "44"
},
{
"PowerHint": "AUDIO_STREAMING_LOW_LATENCY",
"Node": "PowerHALAudioState",
"Duration": 0,
"Value": "AUDIO_STREAMING_LOW_LATENCY"
},
{
"PowerHint": "AUDIO_STREAMING_LOW_LATENCY",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "44"
},
{
"PowerHint": "EXPENSIVE_RENDERING",
"Node": "PowerHALRenderingState",
"Duration": 0,
"Value": "EXPENSIVE_RENDERING"
},
{
"PowerHint": "EXPENSIVE_RENDERING",
"Node": "GPUMinFreq",
"Duration": 0,
"Value": "0"
},
{
"PowerHint": "EXPENSIVE_RENDERING",
"Node": "GPUBusMinFreq",
"Duration": 0,
"Value": "765000000"
},
{
"PowerHint": "EXPENSIVE_RENDERING",
"Node": "GPUMaxFreq",
"Duration": 0,
"Value": "1"
},
{
"PowerHint": "ML_ACC",
"Node": "PMQoSCpuDmaLatency",
"Duration": 2000,
"Value": "44"
}
]
}

View File

@@ -382,10 +382,12 @@ PRODUCT_PACKAGES += \
# Power
PRODUCT_PACKAGES += \
android.hardware.power-service-qti
android.hardware.power-service.lineage-libperfmgr \
libperfmgr.vendor \
libqti-perfd-client
PRODUCT_COPY_FILES += \
vendor/qcom/opensource/power/config/parrot/powerhint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.xml
$(LOCAL_PATH)/configs/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json
# Protobuf
PRODUCT_PACKAGES += \
@@ -486,6 +488,10 @@ PRODUCT_SHIPPING_API_LEVEL := 31
# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
$(DEVICE_PATH) \
hardware/bliss/interfaces/power-libperfmgr \
hardware/google/interfaces \
hardware/google/pixel/power-libperfmgr/libperfmgr \
hardware/qcom-caf/common/libqti-perfd-client \
hardware/xiaomi
# Telephony

View File

@@ -1230,35 +1230,6 @@ vendor/lib64/libApeSwDec.so
vendor/lib64/libFlacSwDec.so
vendor/lib64/libdsd2pcm.so
# Perf
vendor/bin/hw/vendor.qti.hardware.perf-hal-service
vendor/etc/init/vendor.qti.hardware.perf-hal-service.rc
vendor/etc/perf/avcsysnodesconfigs.xml
vendor/etc/perf/commonresourceconfigs.xml
vendor/etc/perf/commonsysnodesconfigs.xml
vendor/etc/perf/perfboostsconfig.xml
vendor/etc/perf/perfconfigstore.xml
vendor/etc/perf/targetconfig.xml
vendor/etc/perf/targetresourceconfigs.xml
vendor/etc/perf/targetsysnodesconfigs.xml
vendor/etc/seccomp_policy/qapeservice.policy
vendor/etc/vintf/manifest/vendor.qti.hardware.perf.xml
vendor/lib64/liblearningmodule.so
vendor/lib64/libmeters.so
vendor/lib64/libperfconfig.so
vendor/lib64/libperfgluelayer.so
vendor/lib64/libperfioctl.so
vendor/lib64/libqti-perfd-client.so
vendor/lib64/libqti-perfd.so
vendor/lib64/libqti-util.so
vendor/lib64/libqti-utils.so
vendor/lib64/libskewknob.so
# Perf LM
vendor/lib64/vendor.qti.memory.pasrmanager@1.0.so
vendor/lib64/vendor.qti.memory.pasrmanager@1.1.so
vendor/lib64/vendor.qti.power.pasrmanager@1.0.so
# Peripheral manager
vendor/bin/pm-proxy
vendor/bin/pm-service