power: Remove mutex to hints

* No longer needed.

Change-Id: I09fc90b4e5399b3f3b8a409edf3f57361da90100
This commit is contained in:
dianlujitao
2018-01-18 22:05:14 +08:00
committed by Michael Bestas
parent cd6e36030a
commit 1c368078d1
7 changed files with 0 additions and 52 deletions

View File

@@ -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);
@@ -212,7 +210,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) {
@@ -221,7 +218,6 @@ static void process_video_encode_hint(void *metadata)
video_encode_hint_sent = 1;
}
}
pthread_mutex_unlock(&camera_hint_mutex);
}
else {
/* sample_ms = 10mS */
@@ -229,7 +225,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) {
@@ -238,7 +233,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,
@@ -252,7 +246,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) {
@@ -261,7 +254,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,
@@ -270,13 +262,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 ;
}
}