drm/amd/display: default values for luminance range if they are 0
authorSwapnil Patel <Swapnil.Patel@amd.com>
Sat, 25 Feb 2023 01:16:09 +0000 (20:16 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 14 Mar 2023 19:34:43 +0000 (15:34 -0400)
[why]
Currently if invalid luminescence range is reported in edid,
then the driver doesn't have default range to fallback to.

[How]
Add default range if, the range is 0.

Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Swapnil Patel <Swapnil.Patel@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 92783cb974399ad5f3cf320b95e989cb96de24e0..1629a750dc5519179cde1f576db8a155c9eacda5 100644 (file)
@@ -3007,8 +3007,14 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
                caps->aux_support = true;
 
        luminance_range = &conn_base->display_info.luminance_range;
-       caps->aux_min_input_signal = luminance_range->min_luminance;
-       caps->aux_max_input_signal = luminance_range->max_luminance;
+
+       if (luminance_range->max_luminance) {
+               caps->aux_min_input_signal = luminance_range->min_luminance;
+               caps->aux_max_input_signal = luminance_range->max_luminance;
+       } else {
+               caps->aux_min_input_signal = 0;
+               caps->aux_max_input_signal = 512;
+       }
 }
 
 void amdgpu_dm_update_connector_after_detect(