From 46df85c08afd9a130d852c145d08e086fa1ffb8d Mon Sep 17 00:00:00 2001 From: Nick C Date: Wed, 4 Aug 2021 17:10:46 +0200 Subject: [PATCH] sm6250-common: Changes for Pixel thermal HAL Change-Id: Id5e4ec3e15f047a6ffd84af34dd9943fa70f7554 Signed-off-by: Alexander Winkowski --- atoll.mk | 3 + configs/thermal_info_config.json | 242 +++++++++++++++++++++++++++++++ proprietary-files.txt | 9 +- rootdir/etc/init.target.rc | 11 +- 4 files changed, 254 insertions(+), 11 deletions(-) create mode 100644 configs/thermal_info_config.json diff --git a/atoll.mk b/atoll.mk index c3d5d5d..32689d7 100644 --- a/atoll.mk +++ b/atoll.mk @@ -355,5 +355,8 @@ PRODUCT_BOOT_JARS += \ PRODUCT_PACKAGES += \ android.hardware.thermal@2.0-service.pixel +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/thermal_info_config.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config.json + # Inherit proprietary targets $(call inherit-product, vendor/xiaomi/sm6250-common/sm6250-common-vendor.mk) diff --git a/configs/thermal_info_config.json b/configs/thermal_info_config.json new file mode 100644 index 0000000..4b176e8 --- /dev/null +++ b/configs/thermal_info_config.json @@ -0,0 +1,242 @@ +{ + "Sensors":[ + { + "Name":"cpu-0-0-usr", + "Type":"CPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"cpu-0-1-usr", + "Type":"CPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"cpu-0-2-usr", + "Type":"CPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"cpu-0-3-usr", + "Type":"CPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"cpu-0-4-usr", + "Type":"CPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"cpu-0-5-usr", + "Type":"CPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"cpu-1-0-usr", + "Type":"CPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"cpu-1-1-usr", + "Type":"CPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"cpu-1-2-usr", + "Type":"CPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"cpu-1-3-usr", + "Type":"CPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"gpuss-0-usr", + "Type":"GPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"gpuss-1-usr", + "Type":"GPU", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + 95.0, + "NAN", + "NAN", + 125.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"battery", + "Type":"BATTERY", + "HotThreshold":[ + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + "NAN", + 60.0 + ], + "VrThreshold":"NAN", + "Multiplier":0.001 + }, + { + "Name":"quiet-therm-usr", + "Type":"SKIN", + "HotThreshold":[ + "NAN", + 43.0, + 45.0, + 48.0, + 50.0, + 54.0, + 58.0 + ], + "HotHysteresis":[ + 0.0, + 1.9, + 1.9, + 1.9, + 1.9, + 1.9, + 1.9 + ], + "VrThreshold":"NAN", + "Multiplier":0.001, + "Monitor":true + } + ], + "CoolingDevices":[ + { + "Name":"thermal-cpufreq-0", + "Type":"CPU" + }, + { + "Name":"thermal-cpufreq-7", + "Type":"CPU" + }, + { + "Name":"thermal-devfreq-0", + "Type":"GPU" + }, + { + "Name":"battery", + "Type":"BATTERY" + } + ] +} diff --git a/proprietary-files.txt b/proprietary-files.txt index 4fdf0d8..cfb82d7 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -1297,13 +1297,12 @@ vendor/etc/init/vendor.qti.hardware.servicetracker@1.2-service.rc vendor/lib/hw/vendor.qti.hardware.servicetracker@1.2-impl.so vendor/lib64/hw/vendor.qti.hardware.servicetracker@1.2-impl.so -# Thermal -vendor/bin/thermal-engine -vendor/etc/thermal-engine.conf +# Thermal engine - from sunfish - RQ3A.210805.001.A1/7474174 +vendor/bin/thermal-engine|549f8284d4aca92e2b8187ab2a283a90c40e6dca + +# ThermalClient vendor/lib/libthermalclient.so -vendor/lib/libthermalfeature.so vendor/lib64/libthermalclient.so -vendor/lib64/libthermalfeature.so # Time services -vendor/app/TimeService/TimeService.apk diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc index f8a367a..408f6b6 100644 --- a/rootdir/etc/init.target.rc +++ b/rootdir/etc/init.target.rc @@ -92,10 +92,6 @@ on fs mkdir /mnt/vendor/persist/subsys 0770 root system mkdir /mnt/vendor/persist/audio 0755 system system mkdir /mnt/vendor/persist/haptics 0755 system system - chmod 0664 /sys/class/thermal/thermal_message/sconfig - chown system system /sys/class/thermal/thermal_message/sconfig - chmod 0666 /sys/class/thermal/thermal_message/temp_state - chown system system /sys/class/thermal/thermal_message/temp_state on post-fs write /dev/ipa 1 @@ -111,8 +107,6 @@ on post-fs-data mkdir /persist/qti_fp 0700 system system mkdir /data/vendor/nnhal 0700 system system mkdir /data/vendor/mac_addr 0771 system system - mkdir /data/vendor/thermal 0771 root system - mkdir /data/vendor/thermal/config 0771 root system on boot chown system system /sys/class/drm/card0-DSI-1/disp_param @@ -166,6 +160,11 @@ service vendor.per_proxy /vendor/bin/pm-proxy group system disabled +service vendor.thermal-engine /vendor/bin/thermal-engine -c /vendor/etc/thermal-engine-${ro.boot.hwname}.conf + class main + user root + group root + on property:init.svc.vendor.per_mgr=running start vendor.per_proxy