Commit 0c5a0bbb authored by Reza Amini's avatar Reza Amini Committed by Alex Deucher

drm/amd/display: Update VSC HDR infoPacket on TF change

[why]
OnSetSourceContentAttribute it does not trigger an update for the VSC
with TF change.

[how]
In this call, create a new VSC infoPacket based on the new config, and
allow DisplayTarget decide if an update and pursuant passive flip is
necessary
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: default avatarKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarReza Amini <Reza.Amini@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 72b90723
...@@ -6494,7 +6494,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector, ...@@ -6494,7 +6494,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
if (stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED) if (stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED)
stream->use_vsc_sdp_for_colorimetry = true; stream->use_vsc_sdp_for_colorimetry = true;
} }
mod_build_vsc_infopacket(stream, &stream->vsc_infopacket); mod_build_vsc_infopacket(stream, &stream->vsc_infopacket, stream->output_color_space);
aconnector->psr_skip_count = AMDGPU_DM_PSR_ENTRY_DELAY; aconnector->psr_skip_count = AMDGPU_DM_PSR_ENTRY_DELAY;
} }
......
...@@ -34,7 +34,8 @@ struct dc_info_packet; ...@@ -34,7 +34,8 @@ struct dc_info_packet;
struct mod_vrr_params; struct mod_vrr_params;
void mod_build_vsc_infopacket(const struct dc_stream_state *stream, void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
struct dc_info_packet *info_packet); struct dc_info_packet *info_packet,
enum dc_color_space cs);
void mod_build_hf_vsif_infopacket(const struct dc_stream_state *stream, void mod_build_hf_vsif_infopacket(const struct dc_stream_state *stream,
struct dc_info_packet *info_packet); struct dc_info_packet *info_packet);
......
...@@ -130,7 +130,8 @@ enum ColorimetryYCCDP { ...@@ -130,7 +130,8 @@ enum ColorimetryYCCDP {
}; };
void mod_build_vsc_infopacket(const struct dc_stream_state *stream, void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
struct dc_info_packet *info_packet) struct dc_info_packet *info_packet,
enum dc_color_space cs)
{ {
unsigned int vsc_packet_revision = vsc_packet_undefined; unsigned int vsc_packet_revision = vsc_packet_undefined;
unsigned int i; unsigned int i;
...@@ -331,13 +332,13 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream, ...@@ -331,13 +332,13 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
/* Set Colorimetry format based on pixel encoding */ /* Set Colorimetry format based on pixel encoding */
switch (stream->timing.pixel_encoding) { switch (stream->timing.pixel_encoding) {
case PIXEL_ENCODING_RGB: case PIXEL_ENCODING_RGB:
if ((stream->output_color_space == COLOR_SPACE_SRGB) || if ((cs == COLOR_SPACE_SRGB) ||
(stream->output_color_space == COLOR_SPACE_SRGB_LIMITED)) (cs == COLOR_SPACE_SRGB_LIMITED))
colorimetryFormat = ColorimetryRGB_DP_sRGB; colorimetryFormat = ColorimetryRGB_DP_sRGB;
else if (stream->output_color_space == COLOR_SPACE_ADOBERGB) else if (cs == COLOR_SPACE_ADOBERGB)
colorimetryFormat = ColorimetryRGB_DP_AdobeRGB; colorimetryFormat = ColorimetryRGB_DP_AdobeRGB;
else if ((stream->output_color_space == COLOR_SPACE_2020_RGB_FULLRANGE) || else if ((cs == COLOR_SPACE_2020_RGB_FULLRANGE) ||
(stream->output_color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE)) (cs == COLOR_SPACE_2020_RGB_LIMITEDRANGE))
colorimetryFormat = ColorimetryRGB_DP_ITU_R_BT2020RGB; colorimetryFormat = ColorimetryRGB_DP_ITU_R_BT2020RGB;
break; break;
...@@ -347,13 +348,13 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream, ...@@ -347,13 +348,13 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
/* Note: xvYCC probably not supported correctly here on DP since colorspace translation /* Note: xvYCC probably not supported correctly here on DP since colorspace translation
* loses distinction between BT601 vs xvYCC601 in translation * loses distinction between BT601 vs xvYCC601 in translation
*/ */
if (stream->output_color_space == COLOR_SPACE_YCBCR601) if (cs == COLOR_SPACE_YCBCR601)
colorimetryFormat = ColorimetryYCC_DP_ITU601; colorimetryFormat = ColorimetryYCC_DP_ITU601;
else if (stream->output_color_space == COLOR_SPACE_YCBCR709) else if (cs == COLOR_SPACE_YCBCR709)
colorimetryFormat = ColorimetryYCC_DP_ITU709; colorimetryFormat = ColorimetryYCC_DP_ITU709;
else if (stream->output_color_space == COLOR_SPACE_ADOBERGB) else if (cs == COLOR_SPACE_ADOBERGB)
colorimetryFormat = ColorimetryYCC_DP_AdobeYCC; colorimetryFormat = ColorimetryYCC_DP_AdobeYCC;
else if (stream->output_color_space == COLOR_SPACE_2020_YCBCR) else if (cs == COLOR_SPACE_2020_YCBCR)
colorimetryFormat = ColorimetryYCC_DP_ITU2020YCbCr; colorimetryFormat = ColorimetryYCC_DP_ITU2020YCbCr;
break; break;
...@@ -391,8 +392,8 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream, ...@@ -391,8 +392,8 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
} }
/* all YCbCr are always limited range */ /* all YCbCr are always limited range */
if ((stream->output_color_space == COLOR_SPACE_SRGB_LIMITED) || if ((cs == COLOR_SPACE_SRGB_LIMITED) ||
(stream->output_color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE) || (cs == COLOR_SPACE_2020_RGB_LIMITEDRANGE) ||
(pixelEncoding != 0x0)) { (pixelEncoding != 0x0)) {
info_packet->sb[17] |= 0x80; /* DB17 bit 7 set to 1 for CEA timing. */ info_packet->sb[17] |= 0x80; /* DB17 bit 7 set to 1 for CEA timing. */
} }
......
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