diff options
author | Ethan Chen <intervigil@gmail.com> | 2018-03-01 21:41:04 -0800 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-10-23 01:12:56 +0300 |
commit | 689414dbd0c18379144f96e3bde393b259d541cd (patch) | |
tree | 8f1b68bdcf50591afd962b8a4aa73f5cd6e7ff2d /power-8952.c | |
parent | bd869d265f52e4d9e8f96fc625c185b9b762a0b5 (diff) | |
download | vendor_qcom_opensource_power-689414dbd0c18379144f96e3bde393b259d541cd.tar.gz vendor_qcom_opensource_power-689414dbd0c18379144f96e3bde393b259d541cd.tar.bz2 vendor_qcom_opensource_power-689414dbd0c18379144f96e3bde393b259d541cd.zip |
power: Use is_interactive_governor/is_schedutil_governor
* Don't copy paste the same governor check code multiple times
Change-Id: I2258553deb02a5ae149b0a96aca5fe5584f0ea14
Diffstat (limited to 'power-8952.c')
-rw-r--r-- | power-8952.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/power-8952.c b/power-8952.c index a3dd3e2..bc4d38b 100644 --- a/power-8952.c +++ b/power-8952.c @@ -118,8 +118,7 @@ int set_interactive_override(int on) { if (!on) { /* Display off. */ - if ((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) && - (strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) { + if (is_interactive_governor(governor)) { int resource_values[] = {INT_OP_CLUSTER0_TIMER_RATE, BIG_LITTLE_TR_MS_50, INT_OP_CLUSTER1_TIMER_RATE, BIG_LITTLE_TR_MS_50, INT_OP_NOTIFY_ON_MIGRATE, 0x00}; @@ -133,8 +132,7 @@ int set_interactive_override(int on) { } else { /* Display on. */ - if ((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) && - (strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) { + if (is_interactive_governor(governor)) { undo_hint_action(DISPLAY_STATE_HINT_ID); display_hint_sent = 0; } @@ -206,8 +204,7 @@ static void process_video_encode_hint(void* metadata) { } if (video_encode_metadata.state == 1) { - if ((strncmp(governor, SCHEDUTIL_GOVERNOR, strlen(SCHEDUTIL_GOVERNOR)) == 0) && - (strlen(governor) == strlen(SCHEDUTIL_GOVERNOR))) { + if (is_schedutil_governor(governor)) { if (is_target_SDM439()) { /* sample_ms = 10mS * SLB for Core0 = -6 @@ -248,8 +245,7 @@ static void process_video_encode_hint(void* metadata) { } } } - } else if ((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) && - (strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) { + } else if (is_interactive_governor(governor)) { /* Sched_load and migration_notif*/ int res[] = {INT_OP_CLUSTER0_USE_SCHED_LOAD, 0x1, INT_OP_CLUSTER1_USE_SCHED_LOAD, 0x1, @@ -266,10 +262,7 @@ static void process_video_encode_hint(void* metadata) { } } } else if (video_encode_metadata.state == 0) { - if (((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) && - (strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) || - ((strncmp(governor, SCHEDUTIL_GOVERNOR, strlen(SCHEDUTIL_GOVERNOR)) == 0) && - (strlen(governor) == strlen(SCHEDUTIL_GOVERNOR)))) { + if (is_interactive_governor(governor) || is_schedutil_governor(governor)) { camera_hint_ref_count--; if (!camera_hint_ref_count) { undo_hint_action(video_encode_metadata.hint_id); |