Skip to content

Commit

Permalink
drm: Add workaround to support under-display fingerprint
Browse files Browse the repository at this point in the history
Since under-dispaly fingerprint also use DSPP to adjust brightness
in HBM mode for better fingerprint camera photo quality, we need
to adjust exposure after fingerprint unlock.

Signed-off-by: DevriesL <[email protected]>
  • Loading branch information
DevriesL committed Dec 31, 2018
1 parent 1414c7b commit f39f62c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
33 changes: 33 additions & 0 deletions drivers/gpu/drm/msm/dsi-staging/exposure_adjustment.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,36 @@ u32 ea_panel_calc_backlight(u32 bl_lvl)
return bl_lvl;
}
}

#ifdef EA_UDFP_WORKAROUND
static struct delayed_work restore_backlight_work;

static void restore_backlight(struct work_struct *work)
{
pr_info("Resture backlight to %d\n", last_level);
ea_panel_calc_backlight(last_level);
}

void ea_panel_udfp_workaround(void)
{
cancel_delayed_work_sync(&restore_backlight_work);
if (pcc_backlight_enable)
schedule_delayed_work(&restore_backlight_work, msecs_to_jiffies(EA_UDFP_UNLOCK_DELAY));
}

static int __init ea_panel_init(void)
{
INIT_DELAYED_WORK(&restore_backlight_work, restore_backlight);

return 0;
}

static void __exit ea_panel_exit(void)
{
return;
}

module_init(ea_panel_init);
module_exit(ea_panel_exit);

#endif
5 changes: 5 additions & 0 deletions drivers/gpu/drm/msm/dsi-staging/exposure_adjustment.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* @ELVSS_OFF_THRESHOLD: Minimum backlight threshold for disable smart elvss
* @EXPOSURE_ADJUSTMENT_MIN: Minimum available PCC coefficient for OLED panel
*/
#define EA_UDFP_WORKAROUND
#define EA_UDFP_UNLOCK_DELAY 100
#define ELVSS_OFF_THRESHOLD 258
#define EXPOSURE_ADJUSTMENT_MIN 5200

Expand All @@ -37,4 +39,7 @@

void ea_panel_mode_ctrl(struct dsi_panel *panel, bool enable);
u32 ea_panel_calc_backlight(u32 bl_lvl);
#ifdef EA_UDFP_WORKAROUND
void ea_panel_udfp_workaround(void);
#endif
#endif /* EXPOSURE_ADJUSTMENT_H */

0 comments on commit f39f62c

Please sign in to comment.