From c0c5b02c1fb92a59f3a285ad6183e28e4bad107a Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Fri, 25 May 2018 21:33:46 +0300 Subject: 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 --- power-660.c | 19 +++++-------------- power-8952.c | 39 ++++++++++++--------------------------- power-8953.c | 42 ++++++++++++++---------------------------- power-8996.c | 14 +++----------- 4 files changed, 34 insertions(+), 80 deletions(-) diff --git a/power-660.c b/power-660.c index 4d4ca14..7c274af 100644 --- a/power-660.c +++ b/power-660.c @@ -53,7 +53,6 @@ static int video_encode_hint_sent; -static int camera_hint_ref_count; static void process_video_encode_hint(void* metadata); /** @@ -211,23 +210,15 @@ static void process_video_encode_hint(void* metadata) { memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); num_resources = ARRAY_SIZE(res); } - 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 (is_interactive_governor(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; diff --git a/power-8952.c b/power-8952.c index 585eb58..e2610d9 100644 --- a/power-8952.c +++ b/power-8952.c @@ -52,7 +52,6 @@ #define MIN_VAL(X, Y) ((X > Y) ? (Y) : (X)) static int video_encode_hint_sent; -static int camera_hint_ref_count; static void process_video_encode_hint(void* metadata); static int display_fd; #define SYS_DISPLAY_PWR "/sys/kernel/hbtp/display_pwr" @@ -207,13 +206,10 @@ static void process_video_encode_hint(void* metadata) { 0x41440100, 0x5f, 0x4143c100, 0x3e6, }; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - 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, - ARRAY_SIZE(res)); - video_encode_hint_sent = 1; - } + if (!video_encode_hint_sent) { + perform_hint_action(video_encode_metadata.hint_id, resource_values, + ARRAY_SIZE(res)); + video_encode_hint_sent = 1; } } else { /* sample_ms = 10mS */ @@ -222,13 +218,10 @@ static void process_video_encode_hint(void* metadata) { 0xa, }; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - 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, - ARRAY_SIZE(res)); - video_encode_hint_sent = 1; - } + if (!video_encode_hint_sent) { + perform_hint_action(video_encode_metadata.hint_id, resource_values, + ARRAY_SIZE(res)); + video_encode_hint_sent = 1; } } } else if (is_interactive_governor(governor)) { @@ -240,21 +233,13 @@ static void process_video_encode_hint(void* metadata) { INT_OP_CLUSTER0_TIMER_RATE, BIG_LITTLE_TR_MS_40, INT_OP_CLUSTER1_TIMER_RATE, BIG_LITTLE_TR_MS_40}; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - camera_hint_ref_count++; - if (!video_encode_hint_sent) { - perform_hint_action(video_encode_metadata.hint_id, resource_values, - ARRAY_SIZE(res)); - video_encode_hint_sent = 1; - } + perform_hint_action(video_encode_metadata.hint_id, resource_values, ARRAY_SIZE(res)); + video_encode_hint_sent = 1; } } else if (video_encode_metadata.state == 0) { if (is_interactive_governor(governor) || is_schedutil_governor(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; diff --git a/power-8953.c b/power-8953.c index ff1e323..38ee3cb 100644 --- a/power-8953.c +++ b/power-8953.c @@ -53,7 +53,6 @@ static int video_encode_hint_sent; -static int camera_hint_ref_count; static void process_video_encode_hint(void* metadata); static int display_fd; @@ -210,13 +209,10 @@ static void process_video_encode_hint(void* metadata) { 0x41440100, 0x5f, 0x4143c100, 0x40c, }; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - 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, - ARRAY_SIZE(res)); - video_encode_hint_sent = 1; - } + if (!video_encode_hint_sent) { + perform_hint_action(video_encode_metadata.hint_id, resource_values, + ARRAY_SIZE(res)); + video_encode_hint_sent = 1; } } else { /* sample_ms = 10mS */ @@ -225,13 +221,10 @@ static void process_video_encode_hint(void* metadata) { 0xa, }; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - 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, - ARRAY_SIZE(res)); - video_encode_hint_sent = 1; - } + if (!video_encode_hint_sent) { + perform_hint_action(video_encode_metadata.hint_id, resource_values, + ARRAY_SIZE(res)); + video_encode_hint_sent = 1; } } } else if (is_interactive_governor(governor)) { @@ -241,23 +234,16 @@ static void process_video_encode_hint(void* metadata) { 0x41430000, 0x1, 0x41434000, 0x1, 0x41424000, 0x28, }; memcpy(resource_values, res, MIN_VAL(sizeof(resource_values), sizeof(res))); - 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, - ARRAY_SIZE(res)); - video_encode_hint_sent = 1; - } + if (!video_encode_hint_sent) { + perform_hint_action(video_encode_metadata.hint_id, resource_values, + ARRAY_SIZE(res)); + video_encode_hint_sent = 1; } } } else if (video_encode_metadata.state == 0) { if (is_interactive_governor(governor) || is_schedutil_governor(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; diff --git a/power-8996.c b/power-8996.c index 2b72c21..9269149 100644 --- a/power-8996.c +++ b/power-8996.c @@ -47,8 +47,6 @@ #include "power-common.h" #include "utils.h" -static int camera_hint_ref_count; - static int process_video_encode_hint(void* metadata) { char governor[80]; struct video_encode_metadata_t video_encode_metadata; @@ -97,20 +95,14 @@ static int process_video_encode_hint(void* metadata) { 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, - ARRAY_SIZE(resource_values)); - } + perform_hint_action(video_encode_metadata.hint_id, resource_values, + ARRAY_SIZE(resource_values)); ALOGI("Video Encode hint start"); return HINT_HANDLED; } } else if (video_encode_metadata.state == 0) { if (is_interactive_governor(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; -- cgit v1.2.3