Commit 2bbb54bb authored by Ahmad Othman's avatar Ahmad Othman Committed by Alex Deucher

drm/amd/display: Add support for HF-VSIF

[Why]
- Currently there is no support for HF-VSIF
- The current support of VSIF is limited to H14b infoframe

[How]
- refactor VSIF
- Added new builder for HF-VSIF
- Added the HF-VSIF packet to DisplayTarget
- Updates DC to apply HF-VSIF updates when updating streams
Acked-by: default avatarAlan Liu <HaoPing.Liu@amd.com>
Signed-off-by: default avatarAhmad Othman <ahmad.othman@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c2fbe663
......@@ -2732,7 +2732,8 @@ static void commit_planes_do_stream_update(struct dc *dc,
if ((stream_update->hdr_static_metadata && !stream->use_dynamic_meta) ||
stream_update->vrr_infopacket ||
stream_update->vsc_infopacket ||
stream_update->vsp_infopacket) {
stream_update->vsp_infopacket ||
stream_update->hfvsif_infopacket) {
resource_build_info_frame(pipe_ctx);
dc->hwss.update_info_frame(pipe_ctx);
......
......@@ -2806,6 +2806,15 @@ static void set_vsc_info_packet(
*info_packet = stream->vsc_infopacket;
}
static void set_hfvs_info_packet(
struct dc_info_packet *info_packet,
struct dc_stream_state *stream)
{
if (!stream->hfvsif_infopacket.valid)
return;
*info_packet = stream->hfvsif_infopacket;
}
void dc_resource_state_destruct(struct dc_state *context)
{
......@@ -2886,6 +2895,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx)
info->spd.valid = false;
info->hdrsmd.valid = false;
info->vsc.valid = false;
info->hfvsif.valid = false;
signal = pipe_ctx->stream->signal;
......@@ -2894,6 +2904,7 @@ void resource_build_info_frame(struct pipe_ctx *pipe_ctx)
set_avi_info_frame(&info->avi, pipe_ctx);
set_vendor_info_packet(&info->vendor, pipe_ctx->stream);
set_hfvs_info_packet(&info->hfvsif, pipe_ctx->stream);
set_spd_info_packet(&info->spd, pipe_ctx->stream);
......
......@@ -180,6 +180,7 @@ struct dc_stream_state {
struct dc_info_packet vrr_infopacket;
struct dc_info_packet vsc_infopacket;
struct dc_info_packet vsp_infopacket;
struct dc_info_packet hfvsif_infopacket;
uint8_t dsc_packed_pps[128];
struct rect src; /* composition area */
struct rect dst; /* stream addressable area */
......@@ -296,6 +297,7 @@ struct dc_stream_update {
struct dc_info_packet *vrr_infopacket;
struct dc_info_packet *vsc_infopacket;
struct dc_info_packet *vsp_infopacket;
struct dc_info_packet *hfvsif_infopacket;
bool *dpms_off;
bool integer_scaling_update;
bool *allow_freesync;
......
......@@ -675,11 +675,13 @@ static void enc1_stream_encoder_update_hdmi_info_packets(
/* for bring up, disable dp double TODO */
REG_UPDATE(HDMI_DB_CONTROL, HDMI_DB_DISABLE, 1);
/*Always add mandatory packets first followed by optional ones*/
enc1_update_hdmi_info_packet(enc1, 0, &info_frame->avi);
enc1_update_hdmi_info_packet(enc1, 1, &info_frame->vendor);
enc1_update_hdmi_info_packet(enc1, 1, &info_frame->hfvsif);
enc1_update_hdmi_info_packet(enc1, 2, &info_frame->gamut);
enc1_update_hdmi_info_packet(enc1, 3, &info_frame->spd);
enc1_update_hdmi_info_packet(enc1, 4, &info_frame->hdrsmd);
enc1_update_hdmi_info_packet(enc1, 3, &info_frame->vendor);
enc1_update_hdmi_info_packet(enc1, 4, &info_frame->spd);
enc1_update_hdmi_info_packet(enc1, 5, &info_frame->hdrsmd);
}
static void enc1_stream_encoder_stop_hdmi_info_packets(
......
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