summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuong Hoang <chuongh@google.com>2022-07-25 16:43:12 +0000
committerChuong Hoang <chuongh@google.com>2022-07-26 18:39:30 +0000
commitee5b54fc6e338029c7211ae133df56c4a81fa707 (patch)
tree39ea886d1b8d1faefd13ebfefd8b48ea74a71501
parente2773583109a9565ea059912f29ad15cc2cf061c (diff)
downloadexynos-ee5b54fc6e338029c7211ae133df56c4a81fa707.tar.gz
Brightness: Ignore brightness set during doze.
Bug: 233237051 Bug: 233836355 Test: Device boots normally. Brightness set during doze is ignored. Signed-off-by: Chuong Hoang <chuongh@google.com> Change-Id: I36d42fc0bef1032bc536057e4f7eb48f9ed11290
-rw-r--r--drivers/video/fbdev/exynos/dpu30/panels/panel-boe-wf012fbm.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/video/fbdev/exynos/dpu30/panels/panel-boe-wf012fbm.c b/drivers/video/fbdev/exynos/dpu30/panels/panel-boe-wf012fbm.c
index b848477b7252..7e53d225802d 100644
--- a/drivers/video/fbdev/exynos/dpu30/panels/panel-boe-wf012fbm.c
+++ b/drivers/video/fbdev/exynos/dpu30/panels/panel-boe-wf012fbm.c
@@ -375,11 +375,25 @@ static int wf012fbm_set_light(struct exynos_panel_device *panel, u32 br_val)
{
u8 data;
struct dsim_device *dsim = get_dsim_drvdata(0);
- mutex_lock(&panel->ops_lock);
- /* WRDISBV(8bit): 1st DBV[7:0] */
- data = br_val & 0xFF;
- dsim_write_data_seq(dsim, false, 0x51, data);
- mutex_unlock(&panel->ops_lock);
+ /*
+ * Only set brightness if it's not currently in doze mode as AP
+ * assumes DBVs are in 650 nits range while in fact it could be
+ * in 150 nits range if the device already entered doze.
+ *
+ * In order to prevent wrong brightness set due to this 650/150
+ * nits scaling, the MCU will be solely responsible for controlling
+ * display brightness during doze (150 nits range). Thus, this
+ * function would do nothing if the device is currently in doze.
+ */
+ if (dsim->state != DSIM_STATE_DOZE) {
+ mutex_lock(&panel->ops_lock);
+ /* WRDISBV(8bit): 1st DBV[7:0] */
+ data = br_val & 0xFF;
+ dsim_write_data_seq(dsim, false, 0x51, data);
+ mutex_unlock(&panel->ops_lock);
+ } else {
+ DPU_INFO_PANEL("%s: skip doze br=%d\n", __func__, br_val);
+ }
return 0;
}