power: Remove unused camera_hint_ref_count
* These were part of the commit that added mutex locks for camera hints. We have now removed the locks so this is no longer necessary Change-Id: I38b91ce4e8fc811b8d9a04e6ec20521adde1b264
This commit is contained in:
22
power-660.c
22
power-660.c
@@ -56,7 +56,6 @@ static int display_hint_sent;
|
||||
static int video_encode_hint_sent;
|
||||
static int cam_preview_hint_sent;
|
||||
|
||||
static int camera_hint_ref_count;
|
||||
static void process_video_encode_hint(void *metadata);
|
||||
//static void process_cam_preview_hint(void *metadata);
|
||||
|
||||
@@ -260,25 +259,18 @@ 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]);
|
||||
}
|
||||
camera_hint_ref_count++;
|
||||
if (camera_hint_ref_count == 1) {
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
}
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
}
|
||||
} else if (video_encode_metadata.state == 0) {
|
||||
if ((strncmp(governor, INTERACTIVE_GOVERNOR,
|
||||
strlen(INTERACTIVE_GOVERNOR)) == 0) &&
|
||||
(strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) {
|
||||
camera_hint_ref_count--;
|
||||
if (!camera_hint_ref_count) {
|
||||
undo_hint_action(video_encode_metadata.hint_id);
|
||||
video_encode_hint_sent = 0;
|
||||
}
|
||||
return ;
|
||||
undo_hint_action(video_encode_metadata.hint_id);
|
||||
video_encode_hint_sent = 0;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
40
power-8937.c
40
power-8937.c
@@ -54,7 +54,6 @@
|
||||
static int saved_interactive_mode = -1;
|
||||
static int display_hint_sent;
|
||||
static int video_encode_hint_sent;
|
||||
static int camera_hint_ref_count;
|
||||
static void process_video_encode_hint(void *metadata);
|
||||
|
||||
static bool is_target_SDM439() /* Returns value=1 if target is Hathi else value 0 */
|
||||
@@ -207,13 +206,10 @@ 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]);
|
||||
camera_hint_ref_count++;
|
||||
if (camera_hint_ref_count == 1) {
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -222,13 +218,10 @@ 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]);
|
||||
camera_hint_ref_count++;
|
||||
if (camera_hint_ref_count == 1) {
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -251,12 +244,9 @@ 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]);
|
||||
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;
|
||||
}
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values,num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
} else if (video_encode_metadata.state == 0) {
|
||||
if (((strncmp(governor, INTERACTIVE_GOVERNOR,
|
||||
@@ -265,12 +255,8 @@ static void process_video_encode_hint(void *metadata)
|
||||
((strncmp(governor, SCHEDUTIL_GOVERNOR,
|
||||
strlen(SCHEDUTIL_GOVERNOR)) == 0) &&
|
||||
(strlen(governor) == strlen(SCHEDUTIL_GOVERNOR)))) {
|
||||
camera_hint_ref_count--;
|
||||
if (!camera_hint_ref_count) {
|
||||
undo_hint_action(video_encode_metadata.hint_id);
|
||||
video_encode_hint_sent = 0;
|
||||
}
|
||||
return ;
|
||||
undo_hint_action(video_encode_metadata.hint_id);
|
||||
video_encode_hint_sent = 0;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
44
power-8953.c
44
power-8953.c
@@ -56,7 +56,6 @@ static int display_hint_sent;
|
||||
static int video_encode_hint_sent;
|
||||
static int cam_preview_hint_sent;
|
||||
|
||||
static int camera_hint_ref_count;
|
||||
static void process_video_encode_hint(void *metadata);
|
||||
//static void process_cam_preview_hint(void *metadata);
|
||||
|
||||
@@ -210,13 +209,10 @@ 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]);
|
||||
camera_hint_ref_count++;
|
||||
if (camera_hint_ref_count == 1) {
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -225,13 +221,10 @@ 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]);
|
||||
camera_hint_ref_count++;
|
||||
if (camera_hint_ref_count == 1) {
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -246,14 +239,11 @@ 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]);
|
||||
camera_hint_ref_count++;
|
||||
if (camera_hint_ref_count == 1) {
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
}
|
||||
if (!video_encode_hint_sent) {
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, num_resources);
|
||||
video_encode_hint_sent = 1;
|
||||
}
|
||||
}
|
||||
} else if (video_encode_metadata.state == 0) {
|
||||
if (((strncmp(governor, INTERACTIVE_GOVERNOR,
|
||||
@@ -262,12 +252,8 @@ static void process_video_encode_hint(void *metadata)
|
||||
((strncmp(governor, SCHEDUTIL_GOVERNOR,
|
||||
strlen(SCHEDUTIL_GOVERNOR)) == 0) &&
|
||||
(strlen(governor) == strlen(SCHEDUTIL_GOVERNOR)))) {
|
||||
camera_hint_ref_count--;
|
||||
if (!camera_hint_ref_count) {
|
||||
undo_hint_action(video_encode_metadata.hint_id);
|
||||
video_encode_hint_sent = 0;
|
||||
}
|
||||
return ;
|
||||
undo_hint_action(video_encode_metadata.hint_id);
|
||||
video_encode_hint_sent = 0;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
13
power-8996.c
13
power-8996.c
@@ -48,7 +48,6 @@
|
||||
#include "power-common.h"
|
||||
|
||||
static int display_hint_sent;
|
||||
static int camera_hint_ref_count;
|
||||
|
||||
static int process_video_encode_hint(void *metadata)
|
||||
{
|
||||
@@ -100,21 +99,15 @@ 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};
|
||||
|
||||
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]));
|
||||
}
|
||||
perform_hint_action(video_encode_metadata.hint_id,
|
||||
resource_values, sizeof(resource_values)/sizeof(resource_values[0]));
|
||||
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))) {
|
||||
camera_hint_ref_count--;
|
||||
if (!camera_hint_ref_count) {
|
||||
undo_hint_action(video_encode_metadata.hint_id);
|
||||
}
|
||||
undo_hint_action(video_encode_metadata.hint_id);
|
||||
|
||||
ALOGI("Video Encode hint stop");
|
||||
return HINT_HANDLED;
|
||||
|
||||
Reference in New Issue
Block a user