diff options
author | dianlujitao <dianlujitao@lineageos.org> | 2018-01-18 22:05:14 +0800 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-10-23 01:12:56 +0300 |
commit | 4e16643aba888a1cff432643aa2e22eeb93605b8 (patch) | |
tree | eb43a82af2a9e7cf94c65c9736151e2313cd4b11 /power-8952.c | |
parent | 42cc4674d7333a37d463875f90a771d162fd7e7a (diff) | |
download | vendor_qcom_opensource_power-4e16643aba888a1cff432643aa2e22eeb93605b8.tar.gz vendor_qcom_opensource_power-4e16643aba888a1cff432643aa2e22eeb93605b8.tar.bz2 vendor_qcom_opensource_power-4e16643aba888a1cff432643aa2e22eeb93605b8.zip |
power: Remove mutex to hints
* No longer needed.
Change-Id: I09fc90b4e5399b3f3b8a409edf3f57361da90100
Diffstat (limited to 'power-8952.c')
-rw-r--r-- | power-8952.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/power-8952.c b/power-8952.c index 188e0fd..ec23dd3 100644 --- a/power-8952.c +++ b/power-8952.c @@ -37,7 +37,6 @@ #include <dlfcn.h> #include <stdlib.h> #include <unistd.h> -#include <pthread.h> #define LOG_TAG "QTI PowerHAL" #include <log/log.h> @@ -55,7 +54,6 @@ static int saved_interactive_mode = -1; static int display_hint_sent; static int video_encode_hint_sent; -pthread_mutex_t camera_hint_mutex = PTHREAD_MUTEX_INITIALIZER; static int camera_hint_ref_count; static void process_video_encode_hint(void *metadata); static int display_fd; @@ -247,7 +245,6 @@ static void process_video_encode_hint(void *metadata) }; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); num_resources = sizeof(res)/sizeof(res[0]); - pthread_mutex_lock(&camera_hint_mutex); camera_hint_ref_count++; if (camera_hint_ref_count == 1) { if (!video_encode_hint_sent) { @@ -256,7 +253,6 @@ static void process_video_encode_hint(void *metadata) video_encode_hint_sent = 1; } } - pthread_mutex_unlock(&camera_hint_mutex); } else { /* sample_ms = 10mS */ @@ -264,7 +260,6 @@ static void process_video_encode_hint(void *metadata) }; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); num_resources = sizeof(res)/sizeof(res[0]); - pthread_mutex_lock(&camera_hint_mutex); camera_hint_ref_count++; if (camera_hint_ref_count == 1) { if (!video_encode_hint_sent) { @@ -273,7 +268,6 @@ static void process_video_encode_hint(void *metadata) video_encode_hint_sent = 1; } } - pthread_mutex_unlock(&camera_hint_mutex); } } else if ((strncmp(governor, INTERACTIVE_GOVERNOR, @@ -295,14 +289,12 @@ static void process_video_encode_hint(void *metadata) }; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); num_resources = sizeof(res)/sizeof(res[0]); - pthread_mutex_lock(&camera_hint_mutex); camera_hint_ref_count++; if (!video_encode_hint_sent) { perform_hint_action(video_encode_metadata.hint_id, resource_values,num_resources); video_encode_hint_sent = 1; } - pthread_mutex_unlock(&camera_hint_mutex); } } else if (video_encode_metadata.state == 0) { if (((strncmp(governor, INTERACTIVE_GOVERNOR, @@ -311,13 +303,11 @@ static void process_video_encode_hint(void *metadata) ((strncmp(governor, SCHEDUTIL_GOVERNOR, strlen(SCHEDUTIL_GOVERNOR)) == 0) && (strlen(governor) == strlen(SCHEDUTIL_GOVERNOR)))) { - pthread_mutex_lock(&camera_hint_mutex); camera_hint_ref_count--; if (!camera_hint_ref_count) { undo_hint_action(video_encode_metadata.hint_id); video_encode_hint_sent = 0; } - pthread_mutex_unlock(&camera_hint_mutex); return ; } } |