wahoo: power: Reorder cpu max node value priority

Add CPUBigClusterMaxFreq to Launch and Camera hints with higher priority
than Video Encode's hint value. In this case, Video Encode hint doesn't
need to be canceled during those hints.

Bug: 71869406
Test: Build
Change-Id: I53d17d32a8ff77257ba44cef7b8be2911b20b85f
This commit is contained in:
Wei Wang
2018-01-11 22:10:18 -08:00
parent 763e14d06a
commit fadd4b28e0
2 changed files with 40 additions and 41 deletions

View File

@@ -197,17 +197,11 @@ Return<void> Power::powerHint(PowerHint_1_0 hint, int32_t data) {
if (data) {
// Hint until canceled
ATRACE_INT("launch_lock", 1);
if (mEncoderModeOn) {
mHintManager->EndHint("VIDEO_ENCODE");
}
mHintManager->DoHint("LAUNCH");
ALOGD("LAUNCH ON");
} else {
ATRACE_INT("launch_lock", 0);
mHintManager->EndHint("LAUNCH");
if (mEncoderModeOn) {
mHintManager->DoHint("VIDEO_ENCODE");
}
ALOGD("LAUNCH OFF");
}
}
@@ -384,10 +378,6 @@ Return<void> Power::powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) {
ATRACE_BEGIN("camera_launch");
if (data > 0) {
ATRACE_INT("camera_launch_lock", 1);
// If Encoder hint is on, cancel it first and do camera hint
if (mEncoderModeOn) {
mHintManager->EndHint("VIDEO_ENCODE");
}
mHintManager->DoHint("CAMERA_LAUNCH", std::chrono::milliseconds(data));
ALOGD("CAMERA LAUNCH ON: %d MS", data);
// boosts 2.5s for launching
@@ -395,10 +385,6 @@ Return<void> Power::powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) {
} else if (data == 0) {
ATRACE_INT("camera_launch_lock", 0);
mHintManager->EndHint("CAMERA_LAUNCH");
// If Encoder hint is on, recover it
if (mEncoderModeOn) {
mHintManager->DoHint("VIDEO_ENCODE");
}
ALOGD("CAMERA LAUNCH OFF");
} else {
ALOGE("CAMERA LAUNCH INVALID DATA: %d", data);
@@ -409,17 +395,11 @@ Return<void> Power::powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) {
ATRACE_BEGIN("camera_streaming");
if (data > 0) {
ATRACE_INT("camera_streaming_lock", 1);
if (mEncoderModeOn) {
mHintManager->EndHint("VIDEO_ENCODE");
}
mHintManager->DoHint("CAMERA_STREAMING", std::chrono::milliseconds(data));
ALOGD("CAMERA STREAMING ON: %d MS", data);
} else if (data == 0) {
ATRACE_INT("camera_streaming_lock", 0);
mHintManager->EndHint("CAMERA_STREAMING");
if (mEncoderModeOn) {
mHintManager->DoHint("VIDEO_ENCODE");
}
ALOGD("CAMERA STREAMING OFF");
} else {
ALOGE("CAMERA STREAMING INVALID DATA: %d", data);
@@ -430,17 +410,11 @@ Return<void> Power::powerHintAsync_1_2(PowerHint_1_2 hint, int32_t data) {
ATRACE_BEGIN("camera_shot");
if (data > 0) {
ATRACE_INT("camera_shot_lock", 1);
if (mEncoderModeOn) {
mHintManager->EndHint("VIDEO_ENCODE");
}
mHintManager->DoHint("CAMERA_SHOT", std::chrono::milliseconds(data));
ALOGD("CAMERA SHOT ON: %d MS", data);
} else if (data == 0) {
ATRACE_INT("camera_shot_lock", 0);
mHintManager->EndHint("CAMERA_SHOT");
if (mEncoderModeOn) {
mHintManager->DoHint("VIDEO_ENCODE");
}
ALOGD("CAMERA SHOT OFF");
} else {
ALOGE("CAMERA SHOT INVALID DATA: %d", data);

View File

@@ -4,11 +4,12 @@
"Name": "CPULittleClusterMaxFreq",
"Path": "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq",
"Values": [
"1900800",
"1555200",
"1478400",
"1248000",
"1900800"
"1248000"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
@@ -28,13 +29,13 @@
"Name": "CPUBigClusterMaxFreq",
"Path": "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq",
"Values": [
"1132800",
"1267200",
"1344000",
"1574400",
"2457600",
"1958400",
"2457600"
"1574400",
"1344000",
"1267200"
],
"DefaultIndex": 0,
"ResetOnInit": true
},
{
@@ -139,19 +140,19 @@
{
"PowerHint": "VIDEO_ENCODE",
"Node": "CPUBigClusterMaxFreq",
"ValueIndex": 4,
"ValueIndex": 1,
"Duration": 0
},
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "CPUBigClusterMaxFreq",
"ValueIndex": 1,
"ValueIndex": 4,
"Duration": 0
},
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "CPULittleClusterMaxFreq",
"ValueIndex": 1,
"ValueIndex": 3,
"Duration": 0
},
{
@@ -163,7 +164,7 @@
{
"PowerHint": "VR_MODE",
"Node": "CPUBigClusterMaxFreq",
"ValueIndex": 3,
"ValueIndex": 2,
"Duration": 0
},
{
@@ -175,7 +176,7 @@
{
"PowerHint": "VR_MODE",
"Node": "CPULittleClusterMaxFreq",
"ValueIndex": 0,
"ValueIndex": 1,
"Duration": 0
},
{
@@ -205,7 +206,7 @@
{
"PowerHint": "VR_SUSTAINED_PERFORMANCE",
"Node": "CPUBigClusterMaxFreq",
"ValueIndex": 2,
"ValueIndex": 3,
"Duration": 0
},
{
@@ -217,7 +218,7 @@
{
"PowerHint": "VR_SUSTAINED_PERFORMANCE",
"Node": "CPULittleClusterMaxFreq",
"ValueIndex": 1,
"ValueIndex": 2,
"Duration": 0
},
{
@@ -234,7 +235,7 @@
},
{
"PowerHint": "VR_SUSTAINED_PERFORMANCE",
"Node": "GPUMaxFreq",
"Node": "GPUMinFreq",
"ValueIndex": 1,
"Duration": 0
},
@@ -286,6 +287,12 @@
"ValueIndex": 1,
"Duration": 0
},
{
"PowerHint": "LAUNCH",
"Node": "CPUBigClusterMaxFreq",
"ValueIndex": 0,
"Duration": 0
},
{
"PowerHint": "LAUNCH",
"Node": "CPUBigClusterMinFreq",
@@ -328,6 +335,12 @@
"ValueIndex": 0,
"Duration": 5000
},
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "CPUBigClusterMaxFreq",
"ValueIndex": 0,
"Duration": 0
},
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "CPUBigClusterMinFreq",
@@ -346,6 +359,12 @@
"ValueIndex": 0,
"Duration": 1000
},
{
"PowerHint": "CAMERA_STREAMING",
"Node": "CPUBigClusterMaxFreq",
"ValueIndex": 0,
"Duration": 0
},
{
"PowerHint": "CAMERA_STREAMING",
"Node": "CPUBigClusterMinFreq",
@@ -364,6 +383,12 @@
"ValueIndex": 0,
"Duration": 1000
},
{
"PowerHint": "CAMERA_SHOT",
"Node": "CPUBigClusterMaxFreq",
"ValueIndex": 0,
"Duration": 0
},
{
"PowerHint": "CAMERA_SHOT",
"Node": "CPUBigClusterMinFreq",