techpack: display: Adapt dimlayer exposure alpha model for sm7250

Signed-off-by: Carlos Ayrton Lopez Arroyo <15030201@itcelaya.edu.mx>
This commit is contained in:
EcrosoftXiao 2022-02-05 13:41:11 +05:30 committed by spakkkk
parent c827832977
commit ea4666c703
2 changed files with 21 additions and 21 deletions

View File

@ -33,7 +33,7 @@ static int interpolate(int x, int xa, int xb, int ya, int yb)
return ya + factor + plus + sub; return ya + factor + plus + sub;
} }
static int brightness_to_alpha(uint8_t brightness) static int brightness_to_alpha(uint16_t brightness)
{ {
int level = ARRAY_SIZE(brightness_alpha_lut); int level = ARRAY_SIZE(brightness_alpha_lut);
int index, alpha; int index, alpha;
@ -57,7 +57,7 @@ static int brightness_to_alpha(uint8_t brightness)
return alpha; return alpha;
} }
static void set_dim_layer_exposure(uint8_t brightness, struct dsi_display *display) static void set_dim_layer_exposure(uint16_t brightness, struct dsi_display *display)
{ {
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_crtc_state *state; struct drm_crtc_state *state;
@ -85,7 +85,7 @@ static void set_dim_layer_exposure(uint8_t brightness, struct dsi_display *displ
uint32_t expo_map_dim_level(uint32_t level, struct dsi_display *display) uint32_t expo_map_dim_level(uint32_t level, struct dsi_display *display)
{ {
uint32_t override_level, brightness; uint32_t override_level, brightness;
uint8_t dim_brightness; uint16_t dim_brightness;
if (level < DIM_THRES_LEVEL) { if (level < DIM_THRES_LEVEL) {
override_level = DIM_THRES_LEVEL; override_level = DIM_THRES_LEVEL;

View File

@ -27,26 +27,26 @@ enum {
LUT_MAX, LUT_MAX,
}; };
static const uint8_t brightness_alpha_lut[][LUT_MAX] = { static const uint16_t brightness_alpha_lut[][LUT_MAX] = {
/* {brightness, alpha} */ /* {brightness, alpha} */
{0, 0xFF}, {0, 0xFF},
{2, 0xE0}, {2, 0xD7},
{3, 0xD5}, {20, 0xB9},
{4, 0xD3}, {35, 0xAA},
{5, 0xD0}, {50, 0x9B},
{6, 0xCE}, {65, 0x8C},
{7, 0xCB}, {80, 0x7D},
{8, 0xC8}, {90, 0x78},
{9, 0xC4}, {100, 0x73},
{10, 0xBA}, {120, 0x6C},
{12, 0xB0}, {140, 0x64},
{15, 0xA0}, {160, 0x5A},
{20, 0x8B}, {180, 0x50},
{30, 0x72}, {200, 0x46},
{32, 0x5A}, {240, 0x32},
{45, 0x38}, {270, 0x28},
{60, 0x0E}, {360, 0x1E},
{78, 0x00} {440, 0x00}
}; };
uint32_t expo_map_dim_level(uint32_t level, struct dsi_display *display); uint32_t expo_map_dim_level(uint32_t level, struct dsi_display *display);