Commit 10bff005 authored by Yongqiang Sun's avatar Yongqiang Sun Committed by Alex Deucher

drm/amd/display: Check hdr support before setting.

In case of programing info frame to
some monitors don't support HDR, it will
result in black screen or corruption when
unplug monitor.
By checking hdr flag to avoid unnecessary
setting for monitors don't support HDR.
Signed-off-by: default avatarYongqiang Sun <yongqiang.sun@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e66e4d64
...@@ -1742,6 +1742,9 @@ static void set_hdr_static_info_packet( ...@@ -1742,6 +1742,9 @@ static void set_hdr_static_info_packet(
hdr_metadata = surface->public.hdr_static_ctx; hdr_metadata = surface->public.hdr_static_ctx;
if (!hdr_metadata.is_hdr)
return;
if (dc_is_hdmi_signal(signal)) { if (dc_is_hdmi_signal(signal)) {
info_packet->valid = true; info_packet->valid = true;
......
...@@ -555,14 +555,19 @@ static void dce110_stream_encoder_update_dp_info_packets( ...@@ -555,14 +555,19 @@ static void dce110_stream_encoder_update_dp_info_packets(
struct dce110_stream_encoder *enc110 = DCE110STRENC_FROM_STRENC(enc); struct dce110_stream_encoder *enc110 = DCE110STRENC_FROM_STRENC(enc);
uint32_t value = REG_READ(DP_SEC_CNTL); uint32_t value = REG_READ(DP_SEC_CNTL);
if (info_frame->vsc.valid)
dce110_update_generic_info_packet( dce110_update_generic_info_packet(
enc110, enc110,
0, /* packetIndex */ 0, /* packetIndex */
&info_frame->vsc); &info_frame->vsc);
if (info_frame->spd.valid)
dce110_update_generic_info_packet( dce110_update_generic_info_packet(
enc110, enc110,
2, /* packetIndex */ 2, /* packetIndex */
&info_frame->spd); &info_frame->spd);
if (info_frame->hdrsmd.valid)
dce110_update_generic_info_packet( dce110_update_generic_info_packet(
enc110, enc110,
3, /* packetIndex */ 3, /* packetIndex */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment