Skip to content

Commit

Permalink
fpc1020_tee: Set fingerprintd priority to max when screen is off
Browse files Browse the repository at this point in the history
Give fingerprintd the highest priority (MIN_NICE) when the screen is off to
speed up fingerprint processing, and then reset its priority back to normal
when the screen is on.

There are now 2 fingerprint related processes:
 - [email protected] -> comm:[email protected]
 - com.qualcomm.qti.biometrics.fingerprint.service -> comm:erprint.service

For the match to work properly, use strstr() with "erprint".

Change-Id: Ice4a384f99ae4201b2e5e942b0c8cc16c1190f52
Co-authored-by: Fiqri Ardyansyah <[email protected]>
Signed-off-by: Panchajanya1999 <[email protected]>
Signed-off-by: Carlos Ayrton Lopez Arroyo <[email protected]>
  • Loading branch information
2 people authored and Official-Ayrton990 committed Dec 5, 2021
1 parent ea04ac9 commit 848bebe
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/input/fingerprint/fpc_tee/fpc1020_tee.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,18 @@ static int fpc1020_request_named_gpio(struct fpc1020_data *fpc1020,
return 0;
}

static void set_fingerprintd_nice(int nice)
{
struct task_struct *p;

read_lock(&tasklist_lock);
for_each_process(p) {
if (strstr(p->comm, "erprint"))
set_user_nice(p, nice);
}
read_unlock(&tasklist_lock);
}

static int fpc_fb_notif_callback(struct notifier_block *nb,
unsigned long val, void *data)
{
Expand All @@ -871,9 +883,11 @@ static int fpc_fb_notif_callback(struct notifier_block *nb,
blank = *(int *)(evdata->data);
switch (blank) {
case MI_DRM_BLANK_POWERDOWN:
set_fingerprintd_nice(MIN_NICE);
fpc1020->fb_black = true;
break;
case MI_DRM_BLANK_UNBLANK:
set_fingerprintd_nice(0);
fpc1020->fb_black = false;
break;
default:
Expand Down

0 comments on commit 848bebe

Please sign in to comment.