Skip to content

Commit f851b07

Browse files
Alex Hungalexdeucher
authored andcommitted
drm/amd/display: Fix uninitialized variables in DC
This fixes 29 UNINIT issues reported by Coverity. Reviewed-by: Hersen Wu <[email protected]> Acked-by: Wayne Lin <[email protected]> Signed-off-by: Alex Hung <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent ba3193f commit f851b07

File tree

14 files changed

+19
-19
lines changed

14 files changed

+19
-19
lines changed

drivers/gpu/drm/amd/display/dc/bios/command_table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static enum bp_result transmitter_control_v1_6(
399399
static void init_transmitter_control(struct bios_parser *bp)
400400
{
401401
uint8_t frev;
402-
uint8_t crev;
402+
uint8_t crev = 0;
403403

404404
if (BIOS_CMD_TABLE_REVISION(UNIPHYTransmitterControl,
405405
frev, crev) == false)

drivers/gpu/drm/amd/display/dc/bios/command_table2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static enum bp_result transmitter_control_fallback(
225225
static void init_transmitter_control(struct bios_parser *bp)
226226
{
227227
uint8_t frev;
228-
uint8_t crev;
228+
uint8_t crev = 0;
229229

230230
BIOS_CMD_TABLE_REVISION(dig1transmittercontrol, frev, crev);
231231

drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,7 +2372,7 @@ bool dcn21_validate_bandwidth_fp(struct dc *dc, struct dc_state *context,
23722372

23732373
static struct _vcs_dpi_voltage_scaling_st construct_low_pstate_lvl(struct clk_limit_table *clk_table, unsigned int high_voltage_lvl)
23742374
{
2375-
struct _vcs_dpi_voltage_scaling_st low_pstate_lvl;
2375+
struct _vcs_dpi_voltage_scaling_st low_pstate_lvl = {0};
23762376
int i;
23772377

23782378
low_pstate_lvl.state = 1;
@@ -2477,7 +2477,7 @@ void dcn201_populate_dml_writeback_from_context_fpu(struct dc *dc,
24772477
int pipe_cnt, i, j;
24782478
double max_calc_writeback_dispclk;
24792479
double writeback_dispclk;
2480-
struct writeback_st dout_wb;
2480+
struct writeback_st dout_wb = {0};
24812481

24822482
dc_assert_fp_enabled();
24832483

drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ void dcn30_fpu_populate_dml_writeback_from_context(
260260
int pipe_cnt, i, j;
261261
double max_calc_writeback_dispclk;
262262
double writeback_dispclk;
263-
struct writeback_st dout_wb;
263+
struct writeback_st dout_wb = {0};
264264

265265
dc_assert_fp_enabled();
266266

drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ static bool dcn32_enough_pipes_for_subvp(struct dc *dc, struct dc_state *context
723723
*/
724724
static bool subvp_subvp_schedulable(struct dc *dc, struct dc_state *context)
725725
{
726-
struct pipe_ctx *subvp_pipes[2];
726+
struct pipe_ctx *subvp_pipes[2] = {0};
727727
struct dc_stream_state *phantom = NULL;
728728
uint32_t microschedule_lines = 0;
729729
uint32_t index = 0;

drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,8 +1973,8 @@ void dml32_CalculateVMRowAndSwath(
19731973
unsigned int PTEBufferSizeInRequestsForChroma[DC__NUM_DPP__MAX];
19741974
unsigned int PDEAndMetaPTEBytesFrameY;
19751975
unsigned int PDEAndMetaPTEBytesFrameC;
1976-
unsigned int MetaRowByteY[DC__NUM_DPP__MAX];
1977-
unsigned int MetaRowByteC[DC__NUM_DPP__MAX];
1976+
unsigned int MetaRowByteY[DC__NUM_DPP__MAX] = {0};
1977+
unsigned int MetaRowByteC[DC__NUM_DPP__MAX] = {0};
19781978
unsigned int PixelPTEBytesPerRowY[DC__NUM_DPP__MAX];
19791979
unsigned int PixelPTEBytesPerRowC[DC__NUM_DPP__MAX];
19801980
unsigned int PixelPTEBytesPerRowY_one_row_per_frame[DC__NUM_DPP__MAX];

drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ void dml2_init_soc_states(struct dml2_context *dml2, const struct dc *in_dc,
250250
{
251251
struct dml2_policy_build_synthetic_soc_states_scratch *s = &dml2->v20.scratch.create_scratch.build_synthetic_socbb_scratch;
252252
struct dml2_policy_build_synthetic_soc_states_params *p = &dml2->v20.scratch.build_synthetic_socbb_params;
253-
unsigned int dcfclk_stas_mhz[NUM_DCFCLK_STAS];
254-
unsigned int dcfclk_stas_mhz_new[NUM_DCFCLK_STAS_NEW];
253+
unsigned int dcfclk_stas_mhz[NUM_DCFCLK_STAS] = {0};
254+
unsigned int dcfclk_stas_mhz_new[NUM_DCFCLK_STAS_NEW] = {0};
255255
unsigned int dml_project = dml2->v20.dml_core_ctx.project;
256256

257257
unsigned int i = 0;

drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ void dcn20_init_blank(
403403
struct output_pixel_processor *opp = NULL;
404404
struct output_pixel_processor *bottom_opp = NULL;
405405
uint32_t num_opps, opp_id_src0, opp_id_src1;
406-
uint32_t otg_active_width, otg_active_height;
406+
uint32_t otg_active_width = 0, otg_active_height = 0;
407407

408408
/* program opp dpg blank color */
409409
color_space = COLOR_SPACE_SRGB;

drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
8282

8383
if (enable) {
8484
struct dsc_config dsc_cfg;
85-
struct dsc_optc_config dsc_optc_cfg;
85+
struct dsc_optc_config dsc_optc_cfg = {0};
8686
enum optc_dsc_mode optc_dsc_mode;
8787

8888
/* Enable DSC hw block */

drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
989989

990990
if (enable) {
991991
struct dsc_config dsc_cfg;
992-
struct dsc_optc_config dsc_optc_cfg;
992+
struct dsc_optc_config dsc_optc_cfg = {0};
993993
enum optc_dsc_mode optc_dsc_mode;
994994

995995
/* Enable DSC hw block */
@@ -1542,7 +1542,7 @@ void dcn32_init_blank(
15421542
struct output_pixel_processor *opp = NULL;
15431543
struct output_pixel_processor *bottom_opp = NULL;
15441544
uint32_t num_opps, opp_id_src0, opp_id_src1;
1545-
uint32_t otg_active_width, otg_active_height;
1545+
uint32_t otg_active_width = 0, otg_active_height = 0;
15461546
uint32_t i;
15471547

15481548
/* program opp dpg blank color */

0 commit comments

Comments
 (0)