power: Use declared enums where possible

Change-Id: I079490f8ff61bf278dd69eb89b9dae5ce42e6052
This commit is contained in:
Michael Bestas
2019-10-15 19:24:58 +03:00
parent 8b857ce64a
commit 3b9e68c9a7
6 changed files with 58 additions and 41 deletions

View File

@@ -100,8 +100,10 @@ static int process_video_encode_hint(void* metadata) {
2. BusDCVS V2 params
- Sample_ms of 10ms
*/
int resource_values[] = {0x41414000, 0x459, 0x41410000, 0x5F, 0x41400000, 0x4,
0x41420000, 0x5F, 0x40C2C000, 0X5, 0x41820000, 0xA};
int resource_values[] = {
HISPEED_FREQ_BIG, 0x459, GO_HISPEED_LOAD_BIG, 0x5F,
ABOVE_HISPEED_DELAY_BIG, 0x4, TARGET_LOADS_BIG, 0x5F,
SCHED_SPILL_NR_RUN, 0X5, CPUBW_HWMON_SAMPLE_MS, 0xA};
if (!video_encode_hint_sent) {
perform_hint_action(video_encode_metadata.hint_id, resource_values,
ARRAY_SIZE(resource_values));
@@ -117,8 +119,9 @@ static int process_video_encode_hint(void* metadata) {
2. BusDCVS V2 params
- Sample_ms of 10ms
*/
int resource_values[] = {0x41414100, 0x386, 0x41410100, 0x5F,
0x41400100, 0x4, 0x41820000, 0xA};
int resource_values[] = {
HISPEED_FREQ_LITTLE, 0x386, GO_HISPEED_LOAD_LITTLE, 0x5F,
ABOVE_HISPEED_DELAY_LITTLE, 0x4, CPUBW_HWMON_SAMPLE_MS, 0xA};
if (!video_encode_hint_sent) {
perform_hint_action(video_encode_metadata.hint_id, resource_values,
ARRAY_SIZE(resource_values));
@@ -169,8 +172,9 @@ int set_interactive_override(int on) {
2. BusDCVS V2 params
- Sample_ms of 10ms
*/
int resource_values[] = {0x41414000, 0x459, 0x41410000, 0x5F,
0x41400000, 0x4, 0x41820000, 0xA};
int resource_values[] = {
HISPEED_FREQ_BIG, 0x459, GO_HISPEED_LOAD_BIG, 0x5F,
ABOVE_HISPEED_DELAY_BIG, 0x4, CPUBW_HWMON_SAMPLE_MS, 0xA};
perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values,
ARRAY_SIZE(resource_values));
} else {
@@ -183,8 +187,10 @@ int set_interactive_override(int on) {
- Sample_ms of 10ms
3. Sched group upmigrate - 500
*/
int resource_values[] = {0x41414100, 0x386, 0x41410100, 0x5F, 0x41400100,
0x4, 0x41820000, 0xA, 0x40C54000, 0x1F4};
int resource_values[] = {
HISPEED_FREQ_LITTLE, 0x386, GO_HISPEED_LOAD_LITTLE, 0x5F,
ABOVE_HISPEED_DELAY_LITTLE, 0x4, CPUBW_HWMON_SAMPLE_MS, 0xA,
SCHED_GROUP_UP_MIGRATE, 0x1F4};
perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values,
ARRAY_SIZE(resource_values));
}

View File

@@ -190,7 +190,7 @@ int power_hint_override(power_hint_t hint, void* data) {
ret_val = process_perf_hint(data, VR_MODE);
break;
case POWER_HINT_INTERACTION: {
int resources[] = {0x40800100, 0x514};
int resources[] = {MIN_FREQ_LITTLE_CORE_0, 0x514};
int duration = 100;
interaction(duration, ARRAY_SIZE(resources), resources);
ret_val = HINT_HANDLED;

View File

@@ -97,11 +97,20 @@ static int process_video_encode_hint(void* metadata) {
* SLB for Core3 = -6
* hispeed load = 95
* hispeed freq = 998Mhz */
int resource_values[] = {
0x41820000, 0xa, 0x40c68100, 0xfffffffa, 0x40c68110,
0xfffffffa, 0x40c68120, 0xfffffffa, 0x40c68130, 0xfffffffa,
0x41440100, 0x5f, 0x4143c100, 0x3e6,
};
int resource_values[] = {CPUBW_HWMON_SAMPLE_MS,
0xa,
0x40c68100,
0xfffffffa,
0x40c68110,
0xfffffffa,
0x40c68120,
0xfffffffa,
0x40c68130,
0xfffffffa,
0x41440100,
0x5f,
0x4143c100,
0x3e6};
if (!video_encode_hint_sent) {
perform_hint_action(video_encode_metadata.hint_id, resource_values,
ARRAY_SIZE(resource_values));
@@ -110,10 +119,7 @@ static int process_video_encode_hint(void* metadata) {
}
} else {
/* sample_ms = 10mS */
int resource_values[] = {
0x41820000,
0xa,
};
int resource_values[] = {CPUBW_HWMON_SAMPLE_MS, 0xa};
if (!video_encode_hint_sent) {
perform_hint_action(video_encode_metadata.hint_id, resource_values,
ARRAY_SIZE(resource_values));

View File

@@ -97,11 +97,20 @@ static int process_video_encode_hint(void* metadata) {
* SLB for Core3 = -6
* hispeed load = 95
* hispeed freq = 1036 */
int resource_values[] = {
0x41820000, 0xa, 0x40c68100, 0xfffffffa, 0x40c68110,
0xfffffffa, 0x40c68120, 0xfffffffa, 0x40c68130, 0xfffffffa,
0x41440100, 0x5f, 0x4143c100, 0x40c,
};
int resource_values[] = {CPUBW_HWMON_SAMPLE_MS,
0xa,
0x40c68100,
0xfffffffa,
0x40c68110,
0xfffffffa,
0x40c68120,
0xfffffffa,
0x40c68130,
0xfffffffa,
0x41440100,
0x5f,
0x4143c100,
0x40c};
if (!video_encode_hint_sent) {
perform_hint_action(video_encode_metadata.hint_id, resource_values,
ARRAY_SIZE(resource_values));
@@ -110,10 +119,7 @@ static int process_video_encode_hint(void* metadata) {
}
} else {
/* sample_ms = 10mS */
int resource_values[] = {
0x41820000,
0xa,
};
int resource_values[] = {CPUBW_HWMON_SAMPLE_MS, 0xa};
if (!video_encode_hint_sent) {
perform_hint_action(video_encode_metadata.hint_id, resource_values,
ARRAY_SIZE(resource_values));
@@ -124,9 +130,9 @@ static int process_video_encode_hint(void* metadata) {
} else if (is_interactive_governor(governor)) {
/* Sched_load and migration_notification disable
* timer rate - 40mS*/
int resource_values[] = {
0x41430000, 0x1, 0x41434000, 0x1, 0x41424000, 0x28,
};
int resource_values[] = {INT_OP_CLUSTER0_USE_SCHED_LOAD, 0x1,
INT_OP_CLUSTER0_USE_MIGRATION_NOTIF, 0x1,
INT_OP_CLUSTER0_TIMER_RATE, BIG_LITTLE_TR_MS_40};
if (!video_encode_hint_sent) {
perform_hint_action(video_encode_metadata.hint_id, resource_values,
ARRAY_SIZE(resource_values));
@@ -167,11 +173,7 @@ int set_interactive_override(int on) {
if (!on) {
/* Display off */
if (is_interactive_governor(governor)) {
/* timer rate - 40mS*/
int resource_values[] = {
0x41424000,
0x28,
};
int resource_values[] = {INT_OP_CLUSTER0_TIMER_RATE, BIG_LITTLE_TR_MS_40};
perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values,
ARRAY_SIZE(resource_values));
}

View File

@@ -180,12 +180,14 @@ static int process_video_encode_hint(void* metadata) {
* 3. hysteresis optimization
* -bus dcvs hysteresis tuning
* -sample_ms of 10 ms
* -sLVT hispeed freq to 806MHz
*/
int resource_values[] = {0x41400000, 0x4, 0x41410000, 0x5F, 0x41414000, 0x326,
0x41420000, 0x5A, 0x41400100, 0x4, 0x41410100, 0x5F,
0x41414100, 0x22C, 0x41420100, 0x5A, 0x41810000, 0x9C4,
0x41814000, 0x32, 0x4180C000, 0x0, 0x41820000, 0xA};
int resource_values[] = {
ABOVE_HISPEED_DELAY_BIG, 0x4, GO_HISPEED_LOAD_BIG, 0x5F,
HISPEED_FREQ_BIG, 0x326, TARGET_LOADS_BIG, 0x5A,
ABOVE_HISPEED_DELAY_LITTLE, 0x4, GO_HISPEED_LOAD_LITTLE, 0x5F,
HISPEED_FREQ_LITTLE, 0x22C, TARGET_LOADS_LITTLE, 0x5A,
LOW_POWER_CEIL_MBPS, 0x9C4, LOW_POWER_IO_PERCENT, 0x32,
CPUBW_HWMON_HYST_OPT, 0x0, CPUBW_HWMON_SAMPLE_MS, 0xA};
if (!video_encode_hint_sent) {
perform_hint_action(video_encode_metadata.hint_id, resource_values,
ARRAY_SIZE(resource_values));

View File

@@ -42,6 +42,7 @@
#include <hardware/power.h>
#include <log/log.h>
#include "performance.h"
#include "power-common.h"
#include "utils.h"
@@ -49,7 +50,7 @@ int power_hint_override(power_hint_t hint, void* data) {
int ret_val = HINT_NONE;
switch (hint) {
case POWER_HINT_INTERACTION: {
int resources[] = {0x40800100, 0x514};
int resources[] = {MIN_FREQ_LITTLE_CORE_0, 0x514};
int duration = 100;
interaction(duration, ARRAY_SIZE(resources), resources);
ret_val = HINT_HANDLED;