diff options
Diffstat (limited to 'power-8953.c')
-rw-r--r-- | power-8953.c | 42 |
1 files changed, 14 insertions, 28 deletions
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; |