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;
}
static int brightness_to_alpha(uint8_t brightness)
static int brightness_to_alpha(uint16_t brightness)
{
int level = ARRAY_SIZE(brightness_alpha_lut);
int index, alpha;
@ -57,7 +57,7 @@ static int brightness_to_alpha(uint8_t brightness)
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_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 override_level, brightness;
uint8_t dim_brightness;
uint16_t dim_brightness;
if (level < DIM_THRES_LEVEL) {
override_level = DIM_THRES_LEVEL;

View File

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