Skip to content

Commit

Permalink
power: Avoid reaching req limit of qti perf service.
Browse files Browse the repository at this point in the history
Without cleaning up the power hint handle,
[email protected] is insulted after a while.
ANDR-PERF-MPCTL: Active req limit reached, No optimizations performed
When cleaning up the power hint handle we are able to boost,
as much as we want to do.

Change-Id: I39a69d6b053949578f976fb7ae12f4a9960c50a2
  • Loading branch information
Quallenauge authored and jhenrique09 committed Mar 8, 2021
1 parent 0cf191e commit 0a8cbbc
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
8 changes: 7 additions & 1 deletion power-660.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ static int process_video_encode_hint(void* metadata) {
static void process_interaction_hint(void* data) {
static struct timespec s_previous_boost_timespec;
static int s_previous_duration = 0;
static int interaction_handle = -1;

struct timespec cur_boost_timespec;
long long elapsed_time;
Expand All @@ -173,7 +174,12 @@ static void process_interaction_hint(void* data) {
s_previous_boost_timespec = cur_boost_timespec;
s_previous_duration = duration;

perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
if (CHECK_HANDLE(interaction_handle)) {
release_request(interaction_handle);
}

interaction_handle =
perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
}

static int process_activity_launch_hint(void* data) {
Expand Down
8 changes: 7 additions & 1 deletion power-845.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ static int process_video_encode_hint(void* metadata) {
static void process_interaction_hint(void* data) {
static struct timespec s_previous_boost_timespec;
static int s_previous_duration = 0;
static int interaction_handle = -1;

struct timespec cur_boost_timespec;
long long elapsed_time;
Expand Down Expand Up @@ -217,7 +218,12 @@ static void process_interaction_hint(void* data) {
s_previous_boost_timespec = cur_boost_timespec;
s_previous_duration = duration;

perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
if (CHECK_HANDLE(interaction_handle)) {
release_request(interaction_handle);
}

interaction_handle =
perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
}

static int process_activity_launch_hint(void* data) {
Expand Down
8 changes: 7 additions & 1 deletion power-8937.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ static int process_video_encode_hint(void* metadata) {
static void process_interaction_hint(void* data) {
static struct timespec s_previous_boost_timespec;
static int s_previous_duration = 0;
static int interaction_handle = -1;

struct timespec cur_boost_timespec;
long long elapsed_time;
Expand All @@ -189,7 +190,12 @@ static void process_interaction_hint(void* data) {
s_previous_boost_timespec = cur_boost_timespec;
s_previous_duration = duration;

perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
if (CHECK_HANDLE(interaction_handle)) {
release_request(interaction_handle);
}

interaction_handle =
perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
}

static int process_activity_launch_hint(void* data) {
Expand Down
8 changes: 7 additions & 1 deletion power-8953.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ static int process_video_encode_hint(void* metadata) {
static void process_interaction_hint(void* data) {
static struct timespec s_previous_boost_timespec;
static int s_previous_duration = 0;
static int interaction_handle = -1;

struct timespec cur_boost_timespec;
long long elapsed_time;
Expand All @@ -186,7 +187,12 @@ static void process_interaction_hint(void* data) {
s_previous_boost_timespec = cur_boost_timespec;
s_previous_duration = duration;

perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
if (CHECK_HANDLE(interaction_handle)) {
release_request(interaction_handle);
}

interaction_handle =
perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
}

static int process_activity_launch_hint(void* data) {
Expand Down
8 changes: 7 additions & 1 deletion power-8996.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ static int process_video_encode_hint(void* metadata) {
static void process_interaction_hint(void* data) {
static struct timespec s_previous_boost_timespec;
static int s_previous_duration = 0;
static int interaction_handle = -1;

struct timespec cur_boost_timespec;
long long elapsed_time;
Expand Down Expand Up @@ -242,7 +243,12 @@ static void process_interaction_hint(void* data) {
s_previous_boost_timespec = cur_boost_timespec;
s_previous_duration = duration;

perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
if (CHECK_HANDLE(interaction_handle)) {
release_request(interaction_handle);
}

interaction_handle =
perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
}

static int process_activity_launch_hint(void* data) {
Expand Down
8 changes: 7 additions & 1 deletion power-8998.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ static int process_video_encode_hint(void* metadata) {
static void process_interaction_hint(void* data) {
static struct timespec s_previous_boost_timespec;
static int s_previous_duration = 0;
static int interaction_handle = -1;

struct timespec cur_boost_timespec;
long long elapsed_time;
Expand Down Expand Up @@ -213,7 +214,12 @@ static void process_interaction_hint(void* data) {
s_previous_boost_timespec = cur_boost_timespec;
s_previous_duration = duration;

perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
if (CHECK_HANDLE(interaction_handle)) {
release_request(interaction_handle);
}

interaction_handle =
perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
}

static int process_activity_launch_hint(void* data) {
Expand Down

0 comments on commit 0a8cbbc

Please sign in to comment.