diff options
-rw-r--r-- | power-660.c | 6 | ||||
-rw-r--r-- | power-710.c | 1 | ||||
-rw-r--r-- | power-845.c | 9 | ||||
-rw-r--r-- | power-8952.c | 10 | ||||
-rw-r--r-- | power-8953.c | 10 | ||||
-rw-r--r-- | power-8996.c | 5 | ||||
-rw-r--r-- | power-8998.c | 11 |
7 files changed, 0 insertions, 52 deletions
diff --git a/power-660.c b/power-660.c index 29e8ec3..f6cacf7 100644 --- a/power-660.c +++ b/power-660.c @@ -36,7 +36,6 @@ #include <fcntl.h> #include <dlfcn.h> #include <stdlib.h> -#include <pthread.h> #include <unistd.h> #define LOG_TAG "QTI PowerHAL" @@ -57,7 +56,6 @@ static int display_hint_sent; static int video_encode_hint_sent; static int cam_preview_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 void process_cam_preview_hint(void *metadata); @@ -262,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) { @@ -271,19 +268,16 @@ static void process_video_encode_hint(void *metadata) video_encode_hint_sent = 1; } } - pthread_mutex_unlock(&camera_hint_mutex); } } else if (video_encode_metadata.state == 0) { if ((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) && (strlen(governor) == strlen(INTERACTIVE_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 ; } } diff --git a/power-710.c b/power-710.c index 2d33214..e51a06c 100644 --- a/power-710.c +++ b/power-710.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" diff --git a/power-845.c b/power-845.c index 029bd18..98fec8b 100644 --- a/power-845.c +++ b/power-845.c @@ -37,7 +37,6 @@ #include <fcntl.h> #include <dlfcn.h> #include <stdlib.h> -#include <pthread.h> #include <unistd.h> #define LOG_TAG "QTI PowerHAL" @@ -74,7 +73,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) { @@ -115,20 +113,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; } @@ -139,13 +133,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; } @@ -153,7 +145,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; } 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 ; } } diff --git a/power-8953.c b/power-8953.c index cfdb77e..5e98089 100644 --- a/power-8953.c +++ b/power-8953.c @@ -36,7 +36,6 @@ #include <fcntl.h> #include <dlfcn.h> #include <stdlib.h> -#include <pthread.h> #include <unistd.h> #define LOG_TAG "QTI PowerHAL" @@ -57,7 +56,6 @@ static int display_hint_sent; static int video_encode_hint_sent; static int cam_preview_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 void process_cam_preview_hint(void *metadata); @@ -251,7 +249,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) { @@ -260,7 +257,6 @@ static void process_video_encode_hint(void *metadata) video_encode_hint_sent = 1; } } - pthread_mutex_unlock(&camera_hint_mutex); } else { /* sample_ms = 10mS */ @@ -268,7 +264,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) { @@ -277,7 +272,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, @@ -291,7 +285,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) { @@ -300,7 +293,6 @@ static void process_video_encode_hint(void *metadata) video_encode_hint_sent = 1; } } - pthread_mutex_unlock(&camera_hint_mutex); } } else if (video_encode_metadata.state == 0) { if (((strncmp(governor, INTERACTIVE_GOVERNOR, @@ -309,13 +301,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 ; } } diff --git a/power-8996.c b/power-8996.c index f8d4fe6..94bb1cd 100644 --- a/power-8996.c +++ b/power-8996.c @@ -47,7 +47,6 @@ #include "performance.h" #include "power-common.h" -pthread_mutex_t camera_hint_mutex = PTHREAD_MUTEX_INITIALIZER; static int display_hint_sent; static int camera_hint_ref_count; @@ -101,25 +100,21 @@ static int process_video_encode_hint(void *metadata) 0x41420000, 0x5A, 0x41400100, 0x4, 0x41410100, 0x5F, 0x41414100, 0x22C, 0x41420100, 0x5A, 0x41810000, 0x9C4, 0x41814000, 0x32, 0x4180C000, 0x0, 0x41820000, 0xA}; - pthread_mutex_lock(&camera_hint_mutex); camera_hint_ref_count++; if (camera_hint_ref_count == 1) { perform_hint_action(video_encode_metadata.hint_id, resource_values, sizeof(resource_values)/sizeof(resource_values[0])); } - pthread_mutex_unlock(&camera_hint_mutex); ALOGI("Video Encode hint start"); return HINT_HANDLED; } } else if (video_encode_metadata.state == 0) { if ((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) && (strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) { - pthread_mutex_lock(&camera_hint_mutex); camera_hint_ref_count--; if (!camera_hint_ref_count) { undo_hint_action(video_encode_metadata.hint_id); } - pthread_mutex_unlock(&camera_hint_mutex); ALOGI("Video Encode hint stop"); return HINT_HANDLED; 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; |