From: Wayne Lin <[email protected]>

[Why & How]
Fix following problems:
- In abm config, forget to initialize config.ambient_thresholds_lux.
- Adjust the coding style problem
- Restrict to call psr_su_set_dsc_slice_height() under edp only

Reviewed-by: Robin Chen <[email protected]>
Signed-off-by: Wayne Lin <[email protected]>
---
 .../amd/display/modules/power/power_helpers.c | 23 ++++++++++---------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c 
b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
index 73a2b37fbbd7..f1b2d8bc315e 100644
--- a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
+++ b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
@@ -719,8 +719,9 @@ bool dmub_init_abm_config(struct resource_pool *res_pool,
                config.backlight_offsets[i] = ram_table.backlight_offsets[i];
        }
 
-       for (i = 0; i < NUM_AMBI_LEVEL; i++)
+       for (i = 0; i < NUM_AMBI_LEVEL; i++) {
                config.iir_curve[i] = ram_table.iir_curve[i];
+       }
 
        for (i = 0; i < NUM_AMBI_LEVEL; i++) {
                for (j = 0; j < NUM_AGGR_LEVEL; j++) {
@@ -743,13 +744,13 @@ bool dmub_init_abm_config(struct resource_pool *res_pool,
                for (i = 0; i < NUM_AGGR_LEVEL; i++) {
                        config.blRampReduction[i] = 
params.backlight_ramping_reduction;
                        config.blRampStart[i] = params.backlight_ramping_start;
-                       }
-               } else {
-                       for (i = 0; i < NUM_AGGR_LEVEL; i++) {
-                               config.blRampReduction[i] = 
abm_settings[set][i].blRampReduction;
-                               config.blRampStart[i] = 
abm_settings[set][i].blRampStart;
-                               }
-                       }
+               }
+       } else {
+               for (i = 0; i < NUM_AGGR_LEVEL; i++) {
+                       config.blRampReduction[i] = 
abm_settings[set][i].blRampReduction;
+                       config.blRampStart[i] = 
abm_settings[set][i].blRampStart;
+               }
+       }
 
        config.min_abm_backlight = ram_table.min_abm_backlight;
 
@@ -944,11 +945,11 @@ bool psr_su_set_dsc_slice_height(struct dc *dc, struct 
dc_link *link,
        uint16_t slice_height;
 
        config->dsc_slice_height = 0;
-       if ((link->connector_signal & SIGNAL_TYPE_EDP) &&
-           (!dc->caps.edp_dsc_support ||
+       if (!(link->connector_signal & SIGNAL_TYPE_EDP) ||
+           !dc->caps.edp_dsc_support ||
            link->panel_config.dsc.disable_dsc_edp ||
            
!link->dpcd_caps.dsc_caps.dsc_basic_caps.fields.dsc_support.DSC_SUPPORT ||
-           !stream->timing.dsc_cfg.num_slices_v))
+           !stream->timing.dsc_cfg.num_slices_v)
                return true;
 
        pic_height = stream->timing.v_addressable +
-- 
2.42.0

Reply via email to