mirror of
https://github.com/CTCaer/hekate.git
synced 2024-11-05 02:27:39 +00:00
bdk: di: adjust OLED panel brightness curve
The Samsung AMOLED panel least legible backlight is at a high duty (45 / 255). Change the linear curve to a more appropriate one.
This commit is contained in:
parent
6992ece762
commit
808da1bce0
@ -557,6 +557,10 @@ void display_backlight(bool enable)
|
||||
|
||||
void display_dsi_backlight_brightness(u32 brightness)
|
||||
{
|
||||
// Normalize brightness value by 82% and a base of 45 duty.
|
||||
if (brightness)
|
||||
brightness = (brightness * PANEL_OLED_BL_COEFF / 100) + PANEL_OLED_BL_OFFSET;
|
||||
|
||||
u16 bl_ctrl = byte_swap_16((u16)(brightness * 8));
|
||||
display_dsi_vblank_write(MIPI_DCS_SET_BRIGHTNESS, 2, &bl_ctrl);
|
||||
}
|
||||
|
@ -652,6 +652,9 @@
|
||||
#define DCS_CONTROL_DISPLAY_DIMMING_CTRL BIT(3)
|
||||
#define DCS_CONTROL_DISPLAY_BRIGHTNESS_CTRL BIT(5)
|
||||
|
||||
#define PANEL_OLED_BL_COEFF 82 // 82%.
|
||||
#define PANEL_OLED_BL_OFFSET 45 // Least legible backlight duty.
|
||||
|
||||
/* Switch Panels:
|
||||
*
|
||||
* 6.2" panels for Icosa and Iowa skus:
|
||||
|
Loading…
Reference in New Issue
Block a user