drm/amd/display: Keep track of DSC packed PPS
authorIlya Bakoulin <Ilya.Bakoulin@amd.com>
Mon, 14 Mar 2022 21:59:01 +0000 (17:59 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 25 Apr 2022 21:11:54 +0000 (17:11 -0400)
[Why]
Store current packed PPS data in dc_stream_state for future use.

Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Ilya Bakoulin <Ilya.Bakoulin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/dc_stream.h

index 50a12fd08f4a39f0591cb15c49d343c0d6399399..c15c46b81111d11cabe4eb591bd599dc5eccd0c8 100644 (file)
@@ -7578,6 +7578,7 @@ bool dp_set_dsc_pps_sdp(struct pipe_ctx *pipe_ctx, bool enable, bool immediate_u
 
                DC_LOG_DSC(" ");
                dsc->funcs->dsc_get_packed_pps(dsc, &dsc_cfg, &dsc_packed_pps[0]);
+               memcpy(&stream->dsc_packed_pps[0], &dsc_packed_pps[0], sizeof(stream->dsc_packed_pps));
                if (dc_is_dp_signal(stream->signal)) {
                        DC_LOG_DSC("Setting stream encoder DSC PPS SDP for engine %d\n", (int)pipe_ctx->stream_res.stream_enc->id);
                        if (is_dp_128b_132b_signal(pipe_ctx))
@@ -7595,6 +7596,7 @@ bool dp_set_dsc_pps_sdp(struct pipe_ctx *pipe_ctx, bool enable, bool immediate_u
                }
        } else {
                /* disable DSC PPS in stream encoder */
+               memset(&stream->dsc_packed_pps[0], 0, sizeof(stream->dsc_packed_pps));
                if (dc_is_dp_signal(stream->signal)) {
                        if (is_dp_128b_132b_signal(pipe_ctx))
                                pipe_ctx->stream_res.hpo_dp_stream_enc->funcs->dp_set_dsc_pps_info_packet(
index 580420c3eedc4521343dc76f31623dee84ceb6d4..58941f4defb357b2ac64b9d71055094284b0dee0 100644 (file)
@@ -162,7 +162,7 @@ struct dc_stream_state {
        struct dc_info_packet vrr_infopacket;
        struct dc_info_packet vsc_infopacket;
        struct dc_info_packet vsp_infopacket;
-
+       uint8_t dsc_packed_pps[128];
        struct rect src; /* composition area */
        struct rect dst; /* stream addressable area */