summaryrefslogtreecommitdiffstats
path: root/power-8998.c
diff options
context:
space:
mode:
authordianlujitao <dianlujitao@lineageos.org>2018-01-18 22:05:14 +0800
committerMichael Bestas <mkbestas@lineageos.org>2019-10-23 01:12:56 +0300
commit4e16643aba888a1cff432643aa2e22eeb93605b8 (patch)
treeeb43a82af2a9e7cf94c65c9736151e2313cd4b11 /power-8998.c
parent42cc4674d7333a37d463875f90a771d162fd7e7a (diff)
downloadvendor_qcom_opensource_power-4e16643aba888a1cff432643aa2e22eeb93605b8.zip
vendor_qcom_opensource_power-4e16643aba888a1cff432643aa2e22eeb93605b8.tar.gz
vendor_qcom_opensource_power-4e16643aba888a1cff432643aa2e22eeb93605b8.tar.bz2
power: Remove mutex to hints
* No longer needed. Change-Id: I09fc90b4e5399b3f3b8a409edf3f57361da90100
Diffstat (limited to 'power-8998.c')
-rw-r--r--power-8998.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/power-8998.c b/power-8998.c
index e93c36a..913c764 100644
--- a/power-8998.c
+++ b/power-8998.c
@@ -35,7 +35,6 @@
#include <fcntl.h>
#include <dlfcn.h>
#include <stdlib.h>
-#include <pthread.h>
#include <unistd.h>
#define LOG_TAG "QTI PowerHAL"
@@ -69,7 +68,6 @@ perf_mode_t perf_modes[NUM_PERF_MODES] = { { SUSTAINED_MODE, SUSTAINED_PERF_HINT
{ VR_MODE, VR_MODE_HINT },
{ VR_SUSTAINED_MODE, VR_MODE_SUSTAINED_PERF_HINT } };
-static pthread_mutex_t perf_mode_switch_lock = PTHREAD_MUTEX_INITIALIZER;
static int current_mode = NORMAL_MODE;
static inline int get_perfd_hint_id(perf_mode_type_t type) {
@@ -110,20 +108,16 @@ static int switch_mode(perf_mode_type_t mode) {
static int process_perf_hint(void *data, perf_mode_type_t mode) {
- pthread_mutex_lock(&perf_mode_switch_lock);
-
// enable
if (data){
ALOGI("Enable request for mode: 0x%x", mode);
// check if mode is current mode
if ( current_mode & mode ) {
- pthread_mutex_unlock(&perf_mode_switch_lock);
ALOGD("Mode 0x%x already enabled", mode);
return HINT_HANDLED;
}
// enable requested mode
if ( 0 != switch_mode(current_mode | mode)) {
- pthread_mutex_unlock(&perf_mode_switch_lock);
ALOGE("Couldn't enable mode 0x%x", mode);
return HINT_NONE;
}
@@ -134,13 +128,11 @@ static int process_perf_hint(void *data, perf_mode_type_t mode) {
ALOGI("Disable request for mode: 0x%x", mode);
// check if mode is enabled
if ( !(current_mode & mode) ) {
- pthread_mutex_unlock(&perf_mode_switch_lock);
ALOGD("Mode 0x%x already disabled", mode);
return HINT_HANDLED;
}
//disable requested mode
if ( 0 != switch_mode(current_mode & ~mode)) {
- pthread_mutex_unlock(&perf_mode_switch_lock);
ALOGE("Couldn't disable mode 0x%x", mode);
return HINT_NONE;
}
@@ -148,7 +140,6 @@ static int process_perf_hint(void *data, perf_mode_type_t mode) {
ALOGI("Current mode is 0x%x", current_mode);
}
- pthread_mutex_unlock(&perf_mode_switch_lock);
return HINT_HANDLED;
}
@@ -207,11 +198,9 @@ int power_hint_override(power_hint_t hint, void *data)
ret_val = process_perf_hint(data, VR_MODE);
break;
case POWER_HINT_INTERACTION:
- pthread_mutex_lock(&perf_mode_switch_lock);
if (current_mode != NORMAL_MODE) {
ret_val = HINT_HANDLED;
}
- pthread_mutex_unlock(&perf_mode_switch_lock);
break;
default:
break;