Skip to content

Commit

Permalink
drm/amd/display: Check hdr support before setting.
Browse files Browse the repository at this point in the history
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.

Change-Id: Ic01b8b888ab6402d6c53c37a9ab9cccd64787b0d
Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
  • Loading branch information
Yongqiang Sun authored and Alex Deucher committed Jan 9, 2017
1 parent 1e816ac commit 1fad733
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/display/dc/core/dc_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -1742,6 +1742,9 @@ static void set_hdr_static_info_packet(

hdr_metadata = surface->public.hdr_static_ctx;

if (!hdr_metadata.is_hdr)
return;

if (dc_is_hdmi_signal(signal)) {
info_packet->valid = true;

Expand Down
27 changes: 16 additions & 11 deletions drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,18 +555,23 @@ static void dce110_stream_encoder_update_dp_info_packets(
struct dce110_stream_encoder *enc110 = DCE110STRENC_FROM_STRENC(enc);
uint32_t value = REG_READ(DP_SEC_CNTL);

dce110_update_generic_info_packet(
if (info_frame->vsc.valid)
dce110_update_generic_info_packet(
enc110,
0, /* packetIndex */
&info_frame->vsc);

if (info_frame->spd.valid)
dce110_update_generic_info_packet(
enc110,
0, /* packetIndex */
&info_frame->vsc);
dce110_update_generic_info_packet(
enc110,
2, /* packetIndex */
&info_frame->spd);
dce110_update_generic_info_packet(
enc110,
3, /* packetIndex */
&info_frame->hdrsmd);
2, /* packetIndex */
&info_frame->spd);

if (info_frame->hdrsmd.valid)
dce110_update_generic_info_packet(
enc110,
3, /* packetIndex */
&info_frame->hdrsmd);

/* enable/disable transmission of packet(s).
* If enabled, packet transmission begins on the next frame
Expand Down

0 comments on commit 1fad733

Please sign in to comment.