Limit camera daemon cpuset to little cores when app launch

When exiting camera app, camera daemon is still busy in background,
which may affect the launch animation of launcher. So, limit the cpuset
of camera daemon to little cores for 1 second when there is app launch
hint to improve it. This only happens when camera is running. Also
bypass this behavior when video recording is active.

Bug: 240889279
Test: camera daemon cpuset changed as expected
Change-Id: I1893980f0fc3de265a71a3a028f356c7010eaba5
This commit is contained in:
Rick Yiu 2022-11-11 03:06:48 +00:00 committed by Wen-sheng Yiu
parent 81330ea598
commit 535ec9d6c1
2 changed files with 216 additions and 4 deletions

View file

@ -177,7 +177,7 @@
"ResetOnInit": true "ResetOnInit": true
}, },
{ {
"Name": "ReduceRreferIdle", "Name": "ReducePreferIdle",
"Path": "/proc/vendor_sched/reduce_prefer_idle", "Path": "/proc/vendor_sched/reduce_prefer_idle",
"Values": [ "Values": [
"0", "0",
@ -207,6 +207,7 @@
"Name": "CDCpuset", "Name": "CDCpuset",
"Path": "/dev/cpuset/camera-daemon/cpus", "Path": "/dev/cpuset/camera-daemon/cpus",
"Values": [ "Values": [
"0-3",
"4-7", "4-7",
"0-7" "0-7"
], ],
@ -216,6 +217,7 @@
"Name": "CDHighCpusetCpus", "Name": "CDHighCpusetCpus",
"Path": "/dev/cpuset/camera-daemon-high-group/cpus", "Path": "/dev/cpuset/camera-daemon-high-group/cpus",
"Values": [ "Values": [
"0-3",
"6-7", "6-7",
"0-7" "0-7"
], ],
@ -225,6 +227,7 @@
"Name": "CDMidCpusetCpus", "Name": "CDMidCpusetCpus",
"Path": "/dev/cpuset/camera-daemon-mid-group/cpus", "Path": "/dev/cpuset/camera-daemon-mid-group/cpus",
"Values": [ "Values": [
"0-3",
"4-5", "4-5",
"0-7" "0-7"
], ],
@ -234,6 +237,7 @@
"Name": "CDMidHighCpusetCpus", "Name": "CDMidHighCpusetCpus",
"Path": "/dev/cpuset/camera-daemon-mid-high-group/cpus", "Path": "/dev/cpuset/camera-daemon-mid-high-group/cpus",
"Values": [ "Values": [
"0-3",
"4-7", "4-7",
"0-7" "0-7"
], ],
@ -304,6 +308,16 @@
], ],
"Type": "Property" "Type": "Property"
}, },
{
"Name": "PowerHALCameraRunning",
"Path": "vendor.powerhal.camerarunning",
"Values": [
"1",
"0"
],
"Type": "Property",
"ResetOnInit": true
},
{ {
"Name": "INTCAMFreq", "Name": "INTCAMFreq",
"Path": "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/min_freq", "Path": "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/min_freq",
@ -487,6 +501,30 @@
} }
], ],
"Actions": [ "Actions": [
{
"PowerHint": "CDCPUSET_RESTRICTED",
"Node": "CDCpuset",
"Duration": 1000,
"Value": "0-3"
},
{
"PowerHint": "CDHIGHCPUSETCPUS_RESTRICTED",
"Node": "CDHighCpusetCpus",
"Duration": 1000,
"Value": "0-3"
},
{
"PowerHint": "CDMIDCPUSETCPUS_RESTRICTED",
"Node": "CDMidCpusetCpus",
"Duration": 1000,
"Value": "0-3"
},
{
"PowerHint": "CDMIDHIGHCPUSETCPUS_RESTRICTED",
"Node": "CDMidHighCpusetCpus",
"Duration": 1000,
"Value": "0-3"
},
{ {
"PowerHint": "LAUNCH", "PowerHint": "LAUNCH",
"Node": "UClampThreshold", "Node": "UClampThreshold",
@ -495,7 +533,7 @@
}, },
{ {
"PowerHint": "LAUNCH", "PowerHint": "LAUNCH",
"Node": "ReduceRreferIdle", "Node": "ReducePreferIdle",
"Duration": 5000, "Duration": 5000,
"Value": "0" "Value": "0"
}, },
@ -558,6 +596,30 @@
"Type": "DoHint", "Type": "DoHint",
"Value": "LAUNCH_EXTEND" "Value": "LAUNCH_EXTEND"
}, },
{
"PowerHint": "LAUNCH",
"Type": "DoHint",
"EnableProperty": "vendor.powerhal.camerarunning",
"Value": "CDCPUSET_RESTRICTED"
},
{
"PowerHint": "LAUNCH",
"Type": "DoHint",
"EnableProperty": "vendor.powerhal.camerarunning",
"Value": "CDHIGHCPUSETCPUS_RESTRICTED"
},
{
"PowerHint": "LAUNCH",
"Type": "DoHint",
"EnableProperty": "vendor.powerhal.camerarunning",
"Value": "CDMIDCPUSETCPUS_RESTRICTED"
},
{
"PowerHint": "LAUNCH",
"Type": "DoHint",
"EnableProperty": "vendor.powerhal.camerarunning",
"Value": "CDMIDHIGHCPUSETCPUS_RESTRICTED"
},
{ {
"PowerHint": "LAUNCH_EXTEND", "PowerHint": "LAUNCH_EXTEND",
"Node": "CPUBigClusterMaxFreq", "Node": "CPUBigClusterMaxFreq",
@ -834,6 +896,12 @@
"Duration": 3000, "Duration": 3000,
"Value": "9999999" "Value": "9999999"
}, },
{
"PowerHint": "CAMERA_STREAMING_EXTREME",
"Node": "PowerHALCameraRunning",
"Duration": 0,
"Value": "1"
},
{ {
"PowerHint": "CAMERA_STREAMING_EXTREME", "PowerHint": "CAMERA_STREAMING_EXTREME",
"Node": "CPULittleClusterMaxFreq", "Node": "CPULittleClusterMaxFreq",
@ -912,6 +980,12 @@
"Duration": 0, "Duration": 0,
"Value": "0" "Value": "0"
}, },
{
"PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "PowerHALCameraRunning",
"Duration": 0,
"Value": "1"
},
{ {
"PowerHint": "CAMERA_STREAMING_HIGH", "PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "CPUUtilThreshold", "Node": "CPUUtilThreshold",
@ -996,6 +1070,12 @@
"Duration": 0, "Duration": 0,
"Value": "0" "Value": "0"
}, },
{
"PowerHint": "CAMERA_STREAMING_STANDARD",
"Node": "PowerHALCameraRunning",
"Duration": 0,
"Value": "1"
},
{ {
"PowerHint": "CAMERA_STREAMING_STANDARD", "PowerHint": "CAMERA_STREAMING_STANDARD",
"Node": "CDPreferHighCap", "Node": "CDPreferHighCap",
@ -1068,6 +1148,12 @@
"Duration": 0, "Duration": 0,
"Value": "0" "Value": "0"
}, },
{
"PowerHint": "CAMERA_STREAMING_LOW",
"Node": "PowerHALCameraRunning",
"Duration": 0,
"Value": "1"
},
{ {
"PowerHint": "CAMERA_STREAMING_LOW", "PowerHint": "CAMERA_STREAMING_LOW",
"Node": "CDPreferHighCap", "Node": "CDPreferHighCap",
@ -1146,6 +1232,26 @@
"Duration": 0, "Duration": 0,
"Value": "0" "Value": "0"
}, },
{
"PowerHint": "CAMERA_VIDEO_RECORDING",
"Type": "MaskHint",
"Value": "CDCPUSET_RESTRICTED"
},
{
"PowerHint": "CAMERA_VIDEO_RECORDING",
"Type": "MaskHint",
"Value": "CDHIGHCPUSETCPUS_RESTRICTED"
},
{
"PowerHint": "CAMERA_VIDEO_RECORDING",
"Type": "MaskHint",
"Value": "CDMIDCPUSETCPUS_RESTRICTED"
},
{
"PowerHint": "CAMERA_VIDEO_RECORDING",
"Type": "MaskHint",
"Value": "CDMIDHIGHCPUSETCPUS_RESTRICTED"
},
{ {
"PowerHint": "CAMERA_FIXED_FPS", "PowerHint": "CAMERA_FIXED_FPS",
"Node": "MemFreq", "Node": "MemFreq",

View file

@ -176,7 +176,7 @@
"ResetOnInit": true "ResetOnInit": true
}, },
{ {
"Name": "ReduceRreferIdle", "Name": "ReducePreferIdle",
"Path": "/proc/vendor_sched/reduce_prefer_idle", "Path": "/proc/vendor_sched/reduce_prefer_idle",
"Values": [ "Values": [
"0", "0",
@ -206,6 +206,7 @@
"Name": "CDCpuset", "Name": "CDCpuset",
"Path": "/dev/cpuset/camera-daemon/cpus", "Path": "/dev/cpuset/camera-daemon/cpus",
"Values": [ "Values": [
"0-3",
"4-7", "4-7",
"0-7" "0-7"
], ],
@ -215,6 +216,7 @@
"Name": "CDHighCpusetCpus", "Name": "CDHighCpusetCpus",
"Path": "/dev/cpuset/camera-daemon-high-group/cpus", "Path": "/dev/cpuset/camera-daemon-high-group/cpus",
"Values": [ "Values": [
"0-3",
"6-7", "6-7",
"0-7" "0-7"
], ],
@ -224,6 +226,7 @@
"Name": "CDMidCpusetCpus", "Name": "CDMidCpusetCpus",
"Path": "/dev/cpuset/camera-daemon-mid-group/cpus", "Path": "/dev/cpuset/camera-daemon-mid-group/cpus",
"Values": [ "Values": [
"0-3",
"4-5", "4-5",
"0-7" "0-7"
], ],
@ -233,6 +236,7 @@
"Name": "CDMidHighCpusetCpus", "Name": "CDMidHighCpusetCpus",
"Path": "/dev/cpuset/camera-daemon-mid-high-group/cpus", "Path": "/dev/cpuset/camera-daemon-mid-high-group/cpus",
"Values": [ "Values": [
"0-3",
"4-7", "4-7",
"0-7" "0-7"
], ],
@ -303,6 +307,16 @@
], ],
"Type": "Property" "Type": "Property"
}, },
{
"Name": "PowerHALCameraRunning",
"Path": "vendor.powerhal.camerarunning",
"Values": [
"1",
"0"
],
"Type": "Property",
"ResetOnInit": true
},
{ {
"Name": "INTCAMFreq", "Name": "INTCAMFreq",
"Path": "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/min_freq", "Path": "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/min_freq",
@ -486,6 +500,30 @@
} }
], ],
"Actions": [ "Actions": [
{
"PowerHint": "CDCPUSET_RESTRICTED",
"Node": "CDCpuset",
"Duration": 1000,
"Value": "0-3"
},
{
"PowerHint": "CDHIGHCPUSETCPUS_RESTRICTED",
"Node": "CDHighCpusetCpus",
"Duration": 1000,
"Value": "0-3"
},
{
"PowerHint": "CDMIDCPUSETCPUS_RESTRICTED",
"Node": "CDMidCpusetCpus",
"Duration": 1000,
"Value": "0-3"
},
{
"PowerHint": "CDMIDHIGHCPUSETCPUS_RESTRICTED",
"Node": "CDMidHighCpusetCpus",
"Duration": 1000,
"Value": "0-3"
},
{ {
"PowerHint": "LAUNCH", "PowerHint": "LAUNCH",
"Node": "UClampThreshold", "Node": "UClampThreshold",
@ -494,7 +532,7 @@
}, },
{ {
"PowerHint": "LAUNCH", "PowerHint": "LAUNCH",
"Node": "ReduceRreferIdle", "Node": "ReducePreferIdle",
"Duration": 5000, "Duration": 5000,
"Value": "0" "Value": "0"
}, },
@ -557,6 +595,30 @@
"Type": "DoHint", "Type": "DoHint",
"Value": "LAUNCH_EXTEND" "Value": "LAUNCH_EXTEND"
}, },
{
"PowerHint": "LAUNCH",
"Type": "DoHint",
"EnableProperty": "vendor.powerhal.camerarunning",
"Value": "CDCPUSET_RESTRICTED"
},
{
"PowerHint": "LAUNCH",
"Type": "DoHint",
"EnableProperty": "vendor.powerhal.camerarunning",
"Value": "CDHIGHCPUSETCPUS_RESTRICTED"
},
{
"PowerHint": "LAUNCH",
"Type": "DoHint",
"EnableProperty": "vendor.powerhal.camerarunning",
"Value": "CDMIDCPUSETCPUS_RESTRICTED"
},
{
"PowerHint": "LAUNCH",
"Type": "DoHint",
"EnableProperty": "vendor.powerhal.camerarunning",
"Value": "CDMIDHIGHCPUSETCPUS_RESTRICTED"
},
{ {
"PowerHint": "LAUNCH_EXTEND", "PowerHint": "LAUNCH_EXTEND",
"Node": "CPUBigClusterMaxFreq", "Node": "CPUBigClusterMaxFreq",
@ -833,6 +895,12 @@
"Duration": 3000, "Duration": 3000,
"Value": "9999999" "Value": "9999999"
}, },
{
"PowerHint": "CAMERA_STREAMING_EXTREME",
"Node": "PowerHALCameraRunning",
"Duration": 0,
"Value": "1"
},
{ {
"PowerHint": "CAMERA_STREAMING_EXTREME", "PowerHint": "CAMERA_STREAMING_EXTREME",
"Node": "CPULittleClusterMaxFreq", "Node": "CPULittleClusterMaxFreq",
@ -911,6 +979,12 @@
"Duration": 0, "Duration": 0,
"Value": "0" "Value": "0"
}, },
{
"PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "PowerHALCameraRunning",
"Duration": 0,
"Value": "1"
},
{ {
"PowerHint": "CAMERA_STREAMING_HIGH", "PowerHint": "CAMERA_STREAMING_HIGH",
"Node": "CPUUtilThreshold", "Node": "CPUUtilThreshold",
@ -995,6 +1069,12 @@
"Duration": 0, "Duration": 0,
"Value": "0" "Value": "0"
}, },
{
"PowerHint": "CAMERA_STREAMING_STANDARD",
"Node": "PowerHALCameraRunning",
"Duration": 0,
"Value": "1"
},
{ {
"PowerHint": "CAMERA_STREAMING_STANDARD", "PowerHint": "CAMERA_STREAMING_STANDARD",
"Node": "CDPreferHighCap", "Node": "CDPreferHighCap",
@ -1067,6 +1147,12 @@
"Duration": 0, "Duration": 0,
"Value": "0" "Value": "0"
}, },
{
"PowerHint": "CAMERA_STREAMING_LOW",
"Node": "PowerHALCameraRunning",
"Duration": 0,
"Value": "1"
},
{ {
"PowerHint": "CAMERA_STREAMING_LOW", "PowerHint": "CAMERA_STREAMING_LOW",
"Node": "CDPreferHighCap", "Node": "CDPreferHighCap",
@ -1145,6 +1231,26 @@
"Duration": 0, "Duration": 0,
"Value": "0" "Value": "0"
}, },
{
"PowerHint": "CAMERA_VIDEO_RECORDING",
"Type": "MaskHint",
"Value": "CDCPUSET_RESTRICTED"
},
{
"PowerHint": "CAMERA_VIDEO_RECORDING",
"Type": "MaskHint",
"Value": "CDHIGHCPUSETCPUS_RESTRICTED"
},
{
"PowerHint": "CAMERA_VIDEO_RECORDING",
"Type": "MaskHint",
"Value": "CDMIDCPUSETCPUS_RESTRICTED"
},
{
"PowerHint": "CAMERA_VIDEO_RECORDING",
"Type": "MaskHint",
"Value": "CDMIDHIGHCPUSETCPUS_RESTRICTED"
},
{ {
"PowerHint": "FIXED_PERFORMANCE", "PowerHint": "FIXED_PERFORMANCE",
"Node": "CPUBigClusterMaxFreq", "Node": "CPUBigClusterMaxFreq",