]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amd/display: Initialize DSC PPS variables to 0
authorDavid Francis <David.Francis@amd.com>
Fri, 16 Aug 2019 17:43:46 +0000 (13:43 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 9 Jan 2020 23:07:47 +0000 (18:07 -0500)
For DSC MST, sometimes monitors would break out
in full-screen static. The issue traced back to the
PPS generation code, where these variables were being used
uninitialized and were picking up garbage.

memset to 0 to avoid this

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: David Francis <David.Francis@amd.com>
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c

index d1df0541e10a9ec3b23c4087fb7a4abf6a13c676..ddb8550457672bc57408cdf4835a2cf98d8aea96 100644 (file)
@@ -525,6 +525,9 @@ bool dp_set_dsc_pps_sdp(struct pipe_ctx *pipe_ctx, bool enable)
                struct dsc_config dsc_cfg;
                uint8_t dsc_packed_pps[128];
 
+               memset(&dsc_cfg, 0, sizeof(dsc_cfg));
+               memset(dsc_packed_pps, 0, 128);
+
                /* Enable DSC hw block */
                dsc_cfg.pic_width = stream->timing.h_addressable + stream->timing.h_border_left + stream->timing.h_border_right;
                dsc_cfg.pic_height = stream->timing.v_addressable + stream->timing.v_border_top + stream->timing.v_border_bottom;
index 0111545dac75d9035044dcd5d39732f9f7e54969..6bdfee20b6a79a17d1c068a0a67a6887c40a94db 100644 (file)
@@ -206,6 +206,9 @@ static bool dsc2_get_packed_pps(struct display_stream_compressor *dsc, const str
        struct dsc_reg_values dsc_reg_vals;
        struct dsc_optc_config dsc_optc_cfg;
 
+       memset(&dsc_reg_vals, 0, sizeof(dsc_reg_vals));
+       memset(&dsc_optc_cfg, 0, sizeof(dsc_optc_cfg));
+
        DC_LOG_DSC("Getting packed DSC PPS for DSC Config:");
        dsc_config_log(dsc, dsc_cfg);
        DC_LOG_DSC("DSC Picture Parameter Set (PPS):");