Skip to content

Commit fdf7d4f

Browse files
Dillon Varonealexdeucher
authored andcommitted
drm/amd/display: Report Proper Quantization Range in AVI Infoframe
[Why?] When a monitor does not set both QS and QY bits, DC does not set Q0, Q1, QY0 and QY1 bits in AVI infoframe. Setting RGB bits should be separate from setting YCC bits. [How?] Separate logic for setting RGB and YCC quantization range bits in the AVI infoframe. Signed-off-by: Dillon Varone <[email protected]> Reviewed-by: Chris Park <[email protected]> Acked-by: Aurabindo Pillai <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent dad6bd7 commit fdf7d4f

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,26 +2506,31 @@ static void set_avi_info_frame(
25062506
hdmi_info.bits.ITC = itc_value;
25072507
}
25082508

2509+
if (stream->qs_bit == 1) {
2510+
if (color_space == COLOR_SPACE_SRGB ||
2511+
color_space == COLOR_SPACE_2020_RGB_FULLRANGE)
2512+
hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_FULL_RANGE;
2513+
else if (color_space == COLOR_SPACE_SRGB_LIMITED ||
2514+
color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE)
2515+
hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_LIMITED_RANGE;
2516+
else
2517+
hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_DEFAULT_RANGE;
2518+
} else
2519+
hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_DEFAULT_RANGE;
2520+
25092521
/* TODO : We should handle YCC quantization */
25102522
/* but we do not have matrix calculation */
2511-
if (stream->qs_bit == 1 &&
2512-
stream->qy_bit == 1) {
2523+
if (stream->qy_bit == 1) {
25132524
if (color_space == COLOR_SPACE_SRGB ||
2514-
color_space == COLOR_SPACE_2020_RGB_FULLRANGE) {
2515-
hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_FULL_RANGE;
2525+
color_space == COLOR_SPACE_2020_RGB_FULLRANGE)
25162526
hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
2517-
} else if (color_space == COLOR_SPACE_SRGB_LIMITED ||
2518-
color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE) {
2519-
hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_LIMITED_RANGE;
2527+
else if (color_space == COLOR_SPACE_SRGB_LIMITED ||
2528+
color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE)
25202529
hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
2521-
} else {
2522-
hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_DEFAULT_RANGE;
2530+
else
25232531
hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
2524-
}
2525-
} else {
2526-
hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_DEFAULT_RANGE;
2527-
hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
2528-
}
2532+
} else
2533+
hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
25292534

25302535
///VIC
25312536
format = stream->timing.timing_3d_format;

0 commit comments

Comments
 (0)