From bd4a7d3d3587b51509e36b356d19f12f8766f59f Mon Sep 17 00:00:00 2001 From: TeYuan Wang Date: Wed, 13 Sep 2023 13:57:12 -0700 Subject: [PATCH] Optimize the thermal policy for camera mode Bug: 297789578 Test: Check CPU throttling when running camera by emul_temp Change-Id: Id97e55d3c219d15fd9d0d70f5b98e476e0385cde --- perf/powerhint-husky.json | 21 +++++++++++++++- perf/powerhint-shiba.json | 21 +++++++++++++++- thermal/thermal_info_config_husky.json | 34 +++++++++++++++++++++++--- thermal/thermal_info_config_shiba.json | 34 +++++++++++++++++++++++--- 4 files changed, 100 insertions(+), 10 deletions(-) diff --git a/perf/powerhint-husky.json b/perf/powerhint-husky.json index dc514f4..b35ee75 100644 --- a/perf/powerhint-husky.json +++ b/perf/powerhint-husky.json @@ -710,7 +710,8 @@ "Path": "vendor.thermal.VIRTUAL-SKIN-CPU-MID.profile", "Values": [ "", - "game" + "game", + "camera" ], "DefaultIndex": 0, "ResetOnInit": true, @@ -1539,6 +1540,12 @@ "Duration": 0, "Value": "0-8" }, + { + "PowerHint": "CAMERA_STREAMING_EXTREME", + "Node": "VIRTUAL-SKIN-CPU-MID", + "Duration": 0, + "Value": "camera" + }, { "PowerHint": "CAMERA_STREAMING_EXTREME", "Node": "VIRTUAL-SKIN-CPU-HIGH", @@ -1689,6 +1696,12 @@ "Duration": 0, "Value": "4-8" }, + { + "PowerHint": "CAMERA_STREAMING_HIGH", + "Node": "VIRTUAL-SKIN-CPU-MID", + "Duration": 0, + "Value": "camera" + }, { "PowerHint": "CAMERA_STREAMING_HIGH", "Node": "VIRTUAL-SKIN-CPU-HIGH", @@ -1815,6 +1828,12 @@ "Duration": 0, "Value": "0-8" }, + { + "PowerHint": "CAMERA_STREAMING_STANDARD", + "Node": "VIRTUAL-SKIN-CPU-MID", + "Duration": 0, + "Value": "camera" + }, { "PowerHint": "CAMERA_STREAMING_STANDARD", "Node": "VIRTUAL-SKIN-CPU-HIGH", diff --git a/perf/powerhint-shiba.json b/perf/powerhint-shiba.json index 6638a8f..c8fbd4d 100644 --- a/perf/powerhint-shiba.json +++ b/perf/powerhint-shiba.json @@ -700,7 +700,8 @@ "Path": "vendor.thermal.VIRTUAL-SKIN-CPU-MID.profile", "Values": [ "", - "game" + "game", + "camera" ], "DefaultIndex": 0, "ResetOnInit": true, @@ -1427,6 +1428,12 @@ "Duration": 0, "Value": "0-8" }, + { + "PowerHint": "CAMERA_STREAMING_EXTREME", + "Node": "VIRTUAL-SKIN-CPU-MID", + "Duration": 0, + "Value": "camera" + }, { "PowerHint": "CAMERA_STREAMING_EXTREME", "Node": "VIRTUAL-SKIN-CPU-HIGH", @@ -1577,6 +1584,12 @@ "Duration": 0, "Value": "4-8" }, + { + "PowerHint": "CAMERA_STREAMING_HIGH", + "Node": "VIRTUAL-SKIN-CPU-MID", + "Duration": 0, + "Value": "camera" + }, { "PowerHint": "CAMERA_STREAMING_HIGH", "Node": "VIRTUAL-SKIN-CPU-HIGH", @@ -1703,6 +1716,12 @@ "Duration": 0, "Value": "0-8" }, + { + "PowerHint": "CAMERA_STREAMING_STANDARD", + "Node": "VIRTUAL-SKIN-CPU-MID", + "Duration": 0, + "Value": "camera" + }, { "PowerHint": "CAMERA_STREAMING_STANDARD", "Node": "VIRTUAL-SKIN-CPU-HIGH", diff --git a/thermal/thermal_info_config_husky.json b/thermal/thermal_info_config_husky.json index f69738f..9993265 100644 --- a/thermal/thermal_info_config_husky.json +++ b/thermal/thermal_info_config_husky.json @@ -473,6 +473,26 @@ "Disabled":true } ] + }, + { + "Mode": "camera", + "BindedCdevInfo": [ + { + "CdevRequest": "thermal-cpufreq-0", + "MaxReleaseStep": 1, + "Disabled":true + }, + { + "CdevRequest": "thermal-cpufreq-1", + "MaxReleaseStep": 1, + "Disabled":true + }, + { + "CdevRequest": "thermal-cpufreq-2", + "MaxReleaseStep": 1, + "Disabled":true + } + ] } ] }, @@ -518,7 +538,7 @@ }, { "CdevRequest": "thermal-cpufreq-2", - "CdevWeightForPID": [0.252, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225], + "CdevWeightForPID": [0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225], "MaxReleaseStep": 1, "MaxThrottleStep": 2, "CdevCeiling": [0, 13, 13, 13, 13, 13, 13] @@ -550,18 +570,24 @@ "BindedCdevInfo": [ { "CdevRequest": "thermal-cpufreq-0", + "CdevWeightForPID": [0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156], "MaxReleaseStep": 1, - "Disabled":true + "MaxThrottleStep": 1, + "CdevCeiling": [0, 6, 6, 6, 6, 6, 6] }, { "CdevRequest": "thermal-cpufreq-1", + "CdevWeightForPID": [0.428, 0.428, 0.428, 0.428, 0.428, 0.428, 0.428], "MaxReleaseStep": 1, - "Disabled":true + "MaxThrottleStep": 2, + "CdevCeiling": [0, 9, 9, 9, 9, 9, 9] }, { "CdevRequest": "thermal-cpufreq-2", + "CdevWeightForPID": [0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225], "MaxReleaseStep": 1, - "Disabled":true + "MaxThrottleStep": 2, + "CdevCeiling": [0, 12, 12, 12, 12, 12, 12] } ] } diff --git a/thermal/thermal_info_config_shiba.json b/thermal/thermal_info_config_shiba.json index 9c71dbe..718b563 100644 --- a/thermal/thermal_info_config_shiba.json +++ b/thermal/thermal_info_config_shiba.json @@ -441,6 +441,26 @@ "Disabled":true } ] + }, + { + "Mode": "camera", + "BindedCdevInfo": [ + { + "CdevRequest": "thermal-cpufreq-0", + "MaxReleaseStep": 1, + "Disabled":true + }, + { + "CdevRequest": "thermal-cpufreq-1", + "MaxReleaseStep": 1, + "Disabled":true + }, + { + "CdevRequest": "thermal-cpufreq-2", + "MaxReleaseStep": 1, + "Disabled":true + } + ] } ] }, @@ -486,7 +506,7 @@ }, { "CdevRequest": "thermal-cpufreq-2", - "CdevWeightForPID": [0.252, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225], + "CdevWeightForPID": [0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225], "MaxReleaseStep": 1, "MaxThrottleStep": 2, "CdevCeiling": [0, 13, 13, 13, 13, 13, 13] @@ -518,18 +538,24 @@ "BindedCdevInfo": [ { "CdevRequest": "thermal-cpufreq-0", + "CdevWeightForPID": [0.156, 0.156, 0.156, 0.156, 0.156, 0.156, 0.156], "MaxReleaseStep": 1, - "Disabled":true + "MaxThrottleStep": 1, + "CdevCeiling": [0, 6, 6, 6, 6, 6, 6] }, { "CdevRequest": "thermal-cpufreq-1", + "CdevWeightForPID": [0.428, 0.428, 0.428, 0.428, 0.428, 0.428, 0.428], "MaxReleaseStep": 1, - "Disabled":true + "MaxThrottleStep": 2, + "CdevCeiling": [0, 9, 9, 9, 9, 9, 9] }, { "CdevRequest": "thermal-cpufreq-2", + "CdevWeightForPID": [0.225, 0.225, 0.225, 0.225, 0.225, 0.225, 0.225], "MaxReleaseStep": 1, - "Disabled":true + "MaxThrottleStep": 2, + "CdevCeiling": [0, 12, 12, 12, 12, 12, 12] } ] }