From a2fb8cee8e1517be6a897ed39b1065e08e2bd043 Mon Sep 17 00:00:00 2001 From: Simon1511 Date: Sat, 6 May 2023 14:20:45 +0200 Subject: [PATCH] sm7125: drm: msm: Properly dim the screen for HBM This reverts commit 06439aa0b6472c026523d877f1aa994754b46fa3. Change-Id: Ifa7b1a5106cd42a171026d37d813dfae13de87aa --- drivers/gpu/drm/msm/dsi-staging/dsi_panel.c | 51 +++++++++++---------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_panel.c b/drivers/gpu/drm/msm/dsi-staging/dsi_panel.c index 5751041d3541..9f19f72fb33f 100755 --- a/drivers/gpu/drm/msm/dsi-staging/dsi_panel.c +++ b/drivers/gpu/drm/msm/dsi-staging/dsi_panel.c @@ -54,27 +54,30 @@ struct bda { }; struct bda fod_dim_lut[] = { - {0, 0xFF}, - {4, 0xEB}, - {8, 0xEA}, - {12, 0xE9}, - {13, 0xE8}, - {20, 0xE5}, - {24, 0xE3}, - {30, 0xE0}, - {68, 0xD0}, - {133, 0xC0}, - {218, 0xB0}, - {328, 0xA0}, - {486, 0x90}, - {642, 0x80}, - {832, 0x70}, - {1043, 0x60}, - {1267, 0x50}, - {1500, 0x40}, - {1770, 0x30}, - {2000, 0x24}, - {2047, 0x21}, + {0, 0xFF}, + {1, 0xEC}, + {2, 0xE6}, + {3, 0xE0}, + {4, 0xDC}, + {6, 0xD5}, + {10, 0xCA}, + {20, 0xB7}, + {21, 0xB5}, + {30, 0xA8}, + {42, 0x9A}, + {63, 0x85}, + {84, 0x74}, + {105, 0x65}, + {126, 0x58}, + {147, 0x4C}, + {168, 0x40}, + {189, 0x36}, + {210, 0x2C}, + {231, 0x23}, + {252, 0x1A}, + {273, 0x11}, + {294, 0x9}, + {315, 0x1}, }; enum dsi_dsc_ratio_type { @@ -1115,8 +1118,10 @@ u32 dsi_panel_get_fod_dim_alpha(struct dsi_panel *panel) return fod_dim_lut[i - 1].dim_alpha; return interpolate(brightness, - fod_dim_lut[i].brightness, fod_dim_lut[i - 1].brightness, - fod_dim_lut[i].dim_alpha, fod_dim_lut[i - 1].dim_alpha); + fod_dim_lut[i - 1].brightness, + fod_dim_lut[i].brightness, + fod_dim_lut[i - 1].dim_alpha, + fod_dim_lut[i].dim_alpha); } int dsi_panel_set_backlight(struct dsi_panel *panel, u32 bl_lvl)