drm/amd/display: set minimum abm backlight level
[Why] A lot of the time, the backlight characteristic curve maps min backlight to a non-zero value. But there are cases where we want the curve to intersect at 0. In this scenario even if OS never asks to set 0% backlight, the ABM reduction can result in backlight being lowered close to 0. This particularly can cause problems in some LED drivers, and in general just looks like backlight is completely off. [How] Add default cap to disallow backlight from dropping below 1% even after ABM reduction is applied. Signed-off-by: Anthony Koo <Anthony.Koo@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
799c5b9cb9
commit
2ad0cdf9e2
@ -942,6 +942,11 @@ static int dm_late_init(void *handle)
|
||||
params.backlight_lut_array_size = 16;
|
||||
params.backlight_lut_array = linear_lut;
|
||||
|
||||
/* Min backlight level after ABM reduction, Don't allow below 1%
|
||||
* 0xFFFF x 0.01 = 0x28F
|
||||
*/
|
||||
params.min_abm_backlight = 0x28F;
|
||||
|
||||
/* todo will enable for navi10 */
|
||||
if (adev->asic_type <= CHIP_RAVEN) {
|
||||
ret = dmcu_load_iram(dmcu, params);
|
||||
|
@ -115,7 +115,7 @@ static const struct abm_parameters * const abm_settings[] = {
|
||||
/* NOTE: iRAM is 256B in size */
|
||||
struct iram_table_v_2 {
|
||||
/* flags */
|
||||
uint16_t flags; /* 0x00 U16 */
|
||||
uint16_t min_abm_backlight; /* 0x00 U16 */
|
||||
|
||||
/* parameters for ABM2.0 algorithm */
|
||||
uint8_t min_reduction[NUM_AMBI_LEVEL][NUM_AGGR_LEVEL]; /* 0x02 U0.8 */
|
||||
@ -170,7 +170,8 @@ struct iram_table_v_2_2 {
|
||||
uint8_t iir_curve[NUM_AMBI_LEVEL]; /* 0x5e U0.8 */
|
||||
uint8_t min_knee[NUM_AGGR_LEVEL]; /* 0x63 U0.8 */
|
||||
uint8_t max_knee[NUM_AGGR_LEVEL]; /* 0x67 U0.8 */
|
||||
uint8_t pad[21]; /* 0x6b U0.8 */
|
||||
uint16_t min_abm_backlight; /* 0x6b U16 */
|
||||
uint8_t pad[19]; /* 0x6d U0.8 */
|
||||
|
||||
/* parameters for crgb conversion */
|
||||
uint16_t crgb_thresh[NUM_POWER_FN_SEGS]; /* 0x80 U3.13 */
|
||||
@ -271,7 +272,8 @@ void fill_iram_v_2(struct iram_table_v_2 *ram_table, struct dmcu_iram_parameters
|
||||
{
|
||||
unsigned int set = params.set;
|
||||
|
||||
ram_table->flags = 0x0;
|
||||
ram_table->min_abm_backlight =
|
||||
cpu_to_be16(params.min_abm_backlight);
|
||||
ram_table->deviation_gain = 0xb3;
|
||||
|
||||
ram_table->blRampReduction =
|
||||
@ -445,6 +447,9 @@ void fill_iram_v_2_2(struct iram_table_v_2_2 *ram_table, struct dmcu_iram_parame
|
||||
|
||||
ram_table->flags = 0x0;
|
||||
|
||||
ram_table->min_abm_backlight =
|
||||
cpu_to_be16(params.min_abm_backlight);
|
||||
|
||||
ram_table->deviation_gain[0] = 0xb3;
|
||||
ram_table->deviation_gain[1] = 0xa8;
|
||||
ram_table->deviation_gain[2] = 0x98;
|
||||
@ -588,6 +593,10 @@ void fill_iram_v_2_3(struct iram_table_v_2_2 *ram_table, struct dmcu_iram_parame
|
||||
unsigned int set = params.set;
|
||||
|
||||
ram_table->flags = 0x0;
|
||||
|
||||
ram_table->min_abm_backlight =
|
||||
cpu_to_be16(params.min_abm_backlight);
|
||||
|
||||
for (i = 0; i < NUM_AGGR_LEVEL; i++) {
|
||||
ram_table->hybrid_factor[i] = abm_settings[set][i].brightness_gain;
|
||||
ram_table->contrast_factor[i] = abm_settings[set][i].contrast_factor;
|
||||
|
@ -38,6 +38,7 @@ struct dmcu_iram_parameters {
|
||||
unsigned int backlight_lut_array_size;
|
||||
unsigned int backlight_ramping_reduction;
|
||||
unsigned int backlight_ramping_start;
|
||||
unsigned int min_abm_backlight;
|
||||
unsigned int set;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user