diff options
author | Michael Bestas <mkbestas@lineageos.org> | 2019-10-15 19:24:58 +0300 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-10-23 01:12:57 +0300 |
commit | 662bc2c978dafd4a804e68fa94712565fa121472 (patch) | |
tree | b2a9183d67b381e590385d36701461753539c71c | |
parent | e0b5c193454bb9a823e479ea8f9f08b9538e2e22 (diff) | |
download | vendor_qcom_opensource_power-662bc2c978dafd4a804e68fa94712565fa121472.tar.gz vendor_qcom_opensource_power-662bc2c978dafd4a804e68fa94712565fa121472.tar.bz2 vendor_qcom_opensource_power-662bc2c978dafd4a804e68fa94712565fa121472.zip |
power: Use declared enums where possible
Change-Id: I079490f8ff61bf278dd69eb89b9dae5ce42e6052
-rw-r--r-- | power-660.c | 22 | ||||
-rw-r--r-- | power-8226.c | 2 | ||||
-rw-r--r-- | power-845.c | 2 | ||||
-rw-r--r-- | power-8610.c | 2 | ||||
-rw-r--r-- | power-8916.c | 2 | ||||
-rw-r--r-- | power-8937.c | 24 | ||||
-rw-r--r-- | power-8953.c | 36 | ||||
-rw-r--r-- | power-8992.c | 2 | ||||
-rw-r--r-- | power-8994.c | 2 | ||||
-rw-r--r-- | power-8996.c | 12 | ||||
-rw-r--r-- | power-msmnile.c | 3 |
11 files changed, 63 insertions, 46 deletions
diff --git a/power-660.c b/power-660.c index e246f3b..e1b74de 100644 --- a/power-660.c +++ b/power-660.c @@ -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)); } diff --git a/power-8226.c b/power-8226.c index f797574..b654923 100644 --- a/power-8226.c +++ b/power-8226.c @@ -133,7 +133,7 @@ int power_hint_override(power_hint_t hint, void* data) { ret_val = process_video_decode_hint(data); break; case POWER_HINT_INTERACTION: - int resources[] = {0x702, 0x20B, 0x30B}; + int resources[] = {CPUS_ONLINE_MIN_2, 0x20B, 0x30B}; int duration = 3000; interaction(duration, ARRAY_SIZE(resources), resources); diff --git a/power-845.c b/power-845.c index d952111..2758bcf 100644 --- a/power-845.c +++ b/power-845.c @@ -193,7 +193,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; diff --git a/power-8610.c b/power-8610.c index f797574..b654923 100644 --- a/power-8610.c +++ b/power-8610.c @@ -133,7 +133,7 @@ int power_hint_override(power_hint_t hint, void* data) { ret_val = process_video_decode_hint(data); break; case POWER_HINT_INTERACTION: - int resources[] = {0x702, 0x20B, 0x30B}; + int resources[] = {CPUS_ONLINE_MIN_2, 0x20B, 0x30B}; int duration = 3000; interaction(duration, ARRAY_SIZE(resources), resources); diff --git a/power-8916.c b/power-8916.c index 5625620..25011bc 100644 --- a/power-8916.c +++ b/power-8916.c @@ -76,7 +76,7 @@ int power_hint_override(power_hint_t hint, void* UNUSED(data)) { case POWER_HINT_VSYNC: break; case POWER_HINT_INTERACTION: { - int resources[] = {0x702, 0x20F, 0x30F}; + int resources[] = {CPUS_ONLINE_MIN_2, 0x20F, 0x30F}; int duration = 3000; interaction(duration, ARRAY_SIZE(resources), resources); diff --git a/power-8937.c b/power-8937.c index 9963eb4..e3554f2 100644 --- a/power-8937.c +++ b/power-8937.c @@ -100,11 +100,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)); @@ -113,10 +122,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)); diff --git a/power-8953.c b/power-8953.c index 2fe14a9..7c97b77 100644 --- a/power-8953.c +++ b/power-8953.c @@ -100,11 +100,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)); @@ -113,10 +122,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)); @@ -127,9 +133,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)); @@ -176,11 +182,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)); } diff --git a/power-8992.c b/power-8992.c index 5a8181b..b102017 100644 --- a/power-8992.c +++ b/power-8992.c @@ -154,7 +154,7 @@ int set_interactive_override(int on) { if (!on) { /* Display off */ if (is_interactive_governor(governor)) { - int resource_values[] = {0x777}; /* 4+0 core config in display off */ + int resource_values[] = {CPUS_ONLINE_MPD_OVERRIDE}; /* 4+0 core config in display off */ perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, ARRAY_SIZE(resource_values)); } diff --git a/power-8994.c b/power-8994.c index 0682b17..f51b782 100644 --- a/power-8994.c +++ b/power-8994.c @@ -154,7 +154,7 @@ int set_interactive_override(int on) { if (!on) { /* Display off */ if (is_interactive_governor(governor)) { - int resource_values[] = {0x777}; /* 4+0 core config in display off */ + int resource_values[] = {CPUS_ONLINE_MPD_OVERRIDE}; /* 4+0 core config in display off */ perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, ARRAY_SIZE(resource_values)); } diff --git a/power-8996.c b/power-8996.c index 937ce64..faee7a7 100644 --- a/power-8996.c +++ b/power-8996.c @@ -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)); diff --git a/power-msmnile.c b/power-msmnile.c index d6fcb80..75d37b2 100644 --- a/power-msmnile.c +++ b/power-msmnile.c @@ -42,6 +42,7 @@ #include <hardware/power.h> #include <log/log.h> +#include "performance.h" #include "power-common.h" #include "utils.h" @@ -85,7 +86,7 @@ int power_hint_override(power_hint_t hint, void* UNUSED(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; |