drm/amd/display: Fix compiler warnings on high compiler warning levels
authorAric Cyr <aric.cyr@amd.com>
Tue, 12 Mar 2024 18:40:06 +0000 (14:40 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Apr 2024 02:05:04 +0000 (22:05 -0400)
[why]
Enabling higher compiler warning levels results in many issues that can
be trivially resolved as well as some potentially critical issues.

[how]
Fix all compiler warnings found with various compilers and higher
warning levels.  Primarily, potentially uninitialized variables and
unreachable code.

Reviewed-by: Leo Li <sunpeng.li@amd.com>
Acked-by: Roman Li <roman.li@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
35 files changed:
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_dio_link_encoder.c
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c
drivers/gpu/drm/amd/display/dc/dml/dcn351/dcn351_fpu.c
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_cts.c
drivers/gpu/drm/amd/display/dc/link/link_dpms.c
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_dpia.c
drivers/gpu/drm/amd/display/dc/resource/dce112/dce112_resource.c
drivers/gpu/drm/amd/display/dc/resource/dce120/dce120_resource.c
drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c
drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c
drivers/gpu/drm/amd/display/dc/resource/dcn316/dcn316_resource.c
drivers/gpu/drm/amd/display/modules/color/color_gamma.c
drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c

index 05f392501c0ae3572250061b31defef7cde51fb5..517c976dbc1950e1b4cd39e2b1332ededa89e8ab 100644 (file)
@@ -1594,8 +1594,6 @@ static bool bios_parser_is_device_id_supported(
                return (le16_to_cpu(bp->object_info_tbl.v1_5->supporteddevices) & mask) != 0;
                break;
        }
-
-       return false;
 }
 
 static uint32_t bios_parser_get_ss_entry_number(
index f65bb4c21b7d39464095fb3d67b71462843f7a14..5ef0879f6ad9c136b0bdfb29023a64e7775e2974 100644 (file)
@@ -642,7 +642,8 @@ static void rn_clk_mgr_helper_populate_bw_params(struct clk_bw_params *bw_params
 
        j = -1;
 
-       ASSERT(PP_SMU_NUM_FCLK_DPM_LEVELS <= MAX_NUM_DPM_LVL);
+       static_assert(PP_SMU_NUM_FCLK_DPM_LEVELS <= MAX_NUM_DPM_LVL,
+               "number of reported FCLK DPM levels exceed maximum");
 
        /* Find lowest DPM, FCLK is filled in reverse order*/
 
index aa9fd1dc550a5e8b2142cfb10db96f4779bdc788..191d8b969d19a6e38eb082252f5a67955659bf9e 100644 (file)
@@ -566,7 +566,8 @@ static void vg_clk_mgr_helper_populate_bw_params(
 
        j = -1;
 
-       ASSERT(VG_NUM_FCLK_DPM_LEVELS <= MAX_NUM_DPM_LVL);
+       static_assert(VG_NUM_FCLK_DPM_LEVELS <= MAX_NUM_DPM_LVL,
+               "number of reported FCLK DPM levels exceeds maximum");
 
        /* Find lowest DPM, FCLK is filled in reverse order*/
 
index ce1386e22576ece836a16d78d39b14d217139e78..12a7752758b8f74339bae09877a23f7a44690954 100644 (file)
@@ -562,7 +562,8 @@ static void dcn31_clk_mgr_helper_populate_bw_params(struct clk_mgr_internal *clk
 
        j = -1;
 
-       ASSERT(NUM_DF_PSTATE_LEVELS <= MAX_NUM_DPM_LVL);
+       static_assert(NUM_DF_PSTATE_LEVELS <= MAX_NUM_DPM_LVL,
+               "number of reported pstate levels exceeds maximum");
 
        /* Find lowest DPM, FCLK is filled in reverse order*/
 
index 12f3e8aa46d8dfae21b5dd1e9f4ef167ee314f2d..e4ed888f840381e49925d22c45d63ddd7ac7ecc7 100644 (file)
@@ -480,7 +480,8 @@ static void dcn316_clk_mgr_helper_populate_bw_params(
 
        j = -1;
 
-       ASSERT(NUM_DF_PSTATE_LEVELS <= MAX_NUM_DPM_LVL);
+       static_assert(NUM_DF_PSTATE_LEVELS <= MAX_NUM_DPM_LVL,
+               "number of reported pstate levels exceeds maximum");
 
        /* Find lowest DPM, FCLK is filled in reverse order*/
 
index 3b1b324c08246f13fe30cfcbed9c4e7a2bc2b14e..df0f23afc8bb18ef72b1965997a1fe7e0584e0cf 100644 (file)
@@ -558,7 +558,7 @@ void hwss_build_fast_sequence(struct dc *dc,
                struct dc_dmub_cmd *dc_dmub_cmd,
                unsigned int dmub_cmd_count,
                struct block_sequence block_sequence[],
-               int *num_steps,
+               unsigned int *num_steps,
                struct pipe_ctx *pipe_ctx,
                struct dc_stream_status *stream_status)
 {
index 34d199b08dd9c9839b67aee0b7989e9a1b51f07a..4c98cd066b8fba7be2557f4544c6bc6955013318 100644 (file)
@@ -1316,7 +1316,7 @@ static void dc_dmub_srv_notify_idle(const struct dc *dc, bool allow_idle)
 static void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
 {
        struct dc_dmub_srv *dc_dmub_srv;
-       uint32_t rcg_exit_count, ips1_exit_count, ips2_exit_count;
+       uint32_t rcg_exit_count = 0, ips1_exit_count = 0, ips2_exit_count = 0;
 
        if (dc->debug.dmcub_emulation)
                return;
index 670d5ab9d9984f73bf662d463ad289b30eecaf3a..2b1673d69ea83f31245d2908cb92db478aa67270 100644 (file)
@@ -1408,7 +1408,7 @@ void dce110_opp_set_csc_default(
 static void program_pwl(struct dce_transform *xfm_dce,
                        const struct pwl_params *params)
 {
-       int retval;
+       uint32_t retval;
        uint8_t max_tries = 10;
        uint8_t counter = 0;
        uint32_t i = 0;
index 377f1ba1a81b70cf05bb7e66763d40ca6ff2fe45..4d0eed7598b2eb98bcde27b45a44d355610f1704 100644 (file)
@@ -1439,7 +1439,6 @@ enum signal_type dcn10_get_dig_mode(
        default:
                return SIGNAL_TYPE_NONE;
        }
-       return SIGNAL_TYPE_NONE;
 }
 
 void dcn10_link_encoder_get_max_link_cap(struct link_encoder *enc,
index c831f6c69a1732ae5ac5bf3364c12afe5aaac6e4..fbcd6f7bc993cd6e766dc2231ef01293ee5ea758 100644 (file)
@@ -382,7 +382,7 @@ void dcn32_set_det_allocations(struct dc *dc, struct dc_state *context,
 {
        int i, pipe_cnt;
        struct resource_context *res_ctx = &context->res_ctx;
-       struct pipe_ctx *pipe;
+       struct pipe_ctx *pipe = 0;
        bool disable_unbounded_requesting = dc->debug.disable_z9_mpc || dc->debug.disable_unbounded_requesting;
 
        for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
index 6e6ae3de08e4cd66391e52e0aeffc6022a4c147d..87eab924ecaf66da1804f427e710c465264e4738 100644 (file)
@@ -80,7 +80,6 @@ enum signal_type dcn35_get_dig_mode(
        default:
                return SIGNAL_TYPE_NONE;
        }
-       return SIGNAL_TYPE_NONE;
 }
 
 void dcn35_link_encoder_setup(
index 9c93a9f1eb0cc2f8fb0581d4478196b74d659ddf..25d46c69464fc95cb13f2de03b321f4b82cc8a11 100644 (file)
@@ -1102,8 +1102,6 @@ static enum dcn_zstate_support_state  decide_zstate_support(struct dc *dc, struc
        } else {
                return DCN_ZSTATE_SUPPORT_DISALLOW;
        }
-
-       return DCN_ZSTATE_SUPPORT_DISALLOW;
 }
 
 static void dcn20_adjust_freesync_v_startup(
index e7f4a2d491ccf42343afa24ba422e8cb84f57126..e0b52db2c210f06621f894086256dd0a5aad58e3 100644 (file)
@@ -3535,7 +3535,6 @@ static double TruncToValidBPP(
                        return DesiredBPP;
                }
        }
-       return BPP_INVALID;
 }
 
 void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib)
index adea459e7d363051f8b33e82abb3d2dc6dd0f68c..33cf824c5da1da6fb0bef982ae44cf4997dc85ed 100644 (file)
@@ -3679,7 +3679,6 @@ static double TruncToValidBPP(
                        return DesiredBPP;
                }
        }
-       return BPP_INVALID;
 }
 
 static noinline void CalculatePrefetchSchedulePerPlane(
index fb21572750e8098a3f794217d9d4ed8478ab4349..21f637ae4add1cf11f1b8f296759a37bdde8058f 100644 (file)
@@ -310,7 +310,7 @@ int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *c
 {
        int i, pipe_cnt;
        struct resource_context *res_ctx = &context->res_ctx;
-       struct pipe_ctx *pipe;
+       struct pipe_ctx *pipe = 0;
        bool upscaled = false;
        const unsigned int max_allowed_vblank_nom = 1023;
 
index 88e56889a68caafd1adcbeb15f4dfa6e3fe22d83..3242957d00c57c107bda2c778e9654104f54ed27 100644 (file)
@@ -3788,7 +3788,6 @@ static double TruncToValidBPP(
                        return DesiredBPP;
                }
        }
-       return BPP_INVALID;
 }
 
 static noinline void CalculatePrefetchSchedulePerPlane(
index 80fccd4999a58a34ce22cbd9a19268bd3585161a..76399c66bc3baaf9dd7548f8eb8b4f0122e759d8 100644 (file)
@@ -1650,6 +1650,8 @@ double dml32_TruncToValidBPP(
                        MaxLinkBPP = 2 * MaxLinkBPP;
        }
 
+       *RequiredSlots = dml_ceil(DesiredBPP / MaxLinkBPP * 64, 1);
+
        if (DesiredBPP == 0) {
                if (DSCEnable) {
                        if (MaxLinkBPP < MinDSCBPP)
@@ -1676,10 +1678,6 @@ double dml32_TruncToValidBPP(
                else
                        return DesiredBPP;
        }
-
-       *RequiredSlots = dml_ceil(DesiredBPP / MaxLinkBPP * 64, 1);
-
-       return BPP_INVALID;
 } // TruncToValidBPP
 
 double dml32_RequiredDTBCLK(
@@ -4291,7 +4289,7 @@ void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
        unsigned int i, j, k;
        unsigned int SurfaceWithMinActiveFCLKChangeMargin = 0;
        unsigned int DRAMClockChangeSupportNumber = 0;
-       unsigned int LastSurfaceWithoutMargin;
+       unsigned int LastSurfaceWithoutMargin = 0;
        unsigned int DRAMClockChangeMethod = 0;
        bool FoundFirstSurfaceWithMinActiveFCLKChangeMargin = false;
        double MinActiveFCLKChangeMargin = 0.;
@@ -5656,9 +5654,9 @@ void dml32_CalculateStutterEfficiency(
        double LastZ8StutterPeriod = 0.0;
        double LastStutterPeriod = 0.0;
        unsigned int TotalNumberOfActiveOTG = 0;
-       double doublePixelClock;
-       unsigned int doubleHTotal;
-       unsigned int doubleVTotal;
+       double doublePixelClock = 0;
+       unsigned int doubleHTotal = 0;
+       unsigned int doubleVTotal = 0;
        bool SameTiming = true;
        double DETBufferingTimeY;
        double SwathWidthYCriticalSurface = 0.0;
index 714c2fe03c5f41defb458ada9b7c19ea3a1c1543..60f251cf973b1b6509347e197a7604e6a4da83fb 100644 (file)
@@ -439,7 +439,7 @@ int dcn35_populate_dml_pipes_from_context_fpu(struct dc *dc,
 {
        int i, pipe_cnt;
        struct resource_context *res_ctx = &context->res_ctx;
-       struct pipe_ctx *pipe;
+       struct pipe_ctx *pipe = 0;
        bool upscaled = false;
        const unsigned int max_allowed_vblank_nom = 1023;
 
index b3ffab77cf889487f7024c22eb4a18542c7bfbea..5abf120ff07502ac769c68ee77781c51bc2311fc 100644 (file)
@@ -474,7 +474,7 @@ int dcn351_populate_dml_pipes_from_context_fpu(struct dc *dc,
 {
        int i, pipe_cnt;
        struct resource_context *res_ctx = &context->res_ctx;
-       struct pipe_ctx *pipe;
+       struct pipe_ctx *pipe = 0;
        bool upscaled = false;
        const unsigned int max_allowed_vblank_nom = 1023;
 
index 9184772d2e38040aae5d2fe6a3c14dbd1b14ed7c..470dca3950c388b5d9d136a3f3263bcc2290c4f5 100644 (file)
@@ -2784,6 +2784,8 @@ static dml_float_t TruncToValidBPP(
                }
        }
 
+       *RequiredSlots = (dml_uint_t)(dml_ceil(DesiredBPP / MaxLinkBPP * 64, 1));
+
        if (DesiredBPP == 0) {
                if (DSCEnable) {
                        if (MaxLinkBPP < MinDSCBPP) {
@@ -2812,10 +2814,6 @@ static dml_float_t TruncToValidBPP(
                        return DesiredBPP;
                }
        }
-
-       *RequiredSlots = (dml_uint_t)(dml_ceil(DesiredBPP / MaxLinkBPP * 64, 1));
-
-       return __DML_DPP_INVALID__;
 } // TruncToValidBPP
 
 static void CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
@@ -3792,9 +3790,9 @@ static void CalculateStutterEfficiency(struct display_mode_lib_scratch_st *scrat
        dml_bool_t FoundCriticalSurface = false;
 
        dml_uint_t TotalNumberOfActiveOTG = 0;
-       dml_float_t SinglePixelClock;
-       dml_uint_t SingleHTotal;
-       dml_uint_t SingleVTotal;
+       dml_float_t SinglePixelClock = 0;
+       dml_uint_t SingleHTotal = 0;
+       dml_uint_t SingleVTotal = 0;
        dml_bool_t SameTiming = true;
 
        dml_float_t LastStutterPeriod = 0.0;
index bedf1cd390df2b12911521e3b52d25b32d65b0e8..81b4e08f8098a66b518fc30c98021fa2c30d0fe5 100644 (file)
@@ -224,7 +224,7 @@ static int find_dml_pipe_idx_by_plane_id(struct dml2_context *ctx, unsigned int
 static bool get_plane_id(struct dml2_context *dml2, const struct dc_state *state, const struct dc_plane_state *plane,
        unsigned int stream_id, unsigned int plane_index, unsigned int *plane_id)
 {
-       int i, j;
+       unsigned int i, j;
        bool is_plane_duplicate = dml2->v20.scratch.plane_duplicate_exists;
 
        if (!plane_id)
index ac41f9c0a2834189ecfba441cdb463ce1d745bfc..a15b21edb0cc7c7b90764c187c563b34bfa2a7ce 100644 (file)
@@ -458,7 +458,7 @@ bool dc_dsc_compute_bandwidth_range(
        bool is_dsc_possible = false;
        struct dsc_enc_caps dsc_enc_caps;
        struct dsc_enc_caps dsc_common_caps;
-       struct dc_dsc_config config;
+       struct dc_dsc_config config = {0};
        struct dc_dsc_config_options options = {0};
 
        options.dsc_min_slice_height_override = dsc_min_slice_height_override;
@@ -868,9 +868,9 @@ static bool setup_dsc_config(
                struct dc_dsc_config *dsc_cfg)
 {
        struct dsc_enc_caps dsc_common_caps;
-       int max_slices_h;
-       int min_slices_h;
-       int num_slices_h;
+       int max_slices_h = 0;
+       int min_slices_h = 0;
+       int num_slices_h = 0;
        int pic_width;
        int slice_width;
        int target_bpp;
index 17b404cb11554e82a1deab3a1e9edde443c49c98..5920d1825a4cae3c9089b48a18110b1be31ec295 100644 (file)
@@ -2188,7 +2188,7 @@ static void dce110_setup_audio_dto(
                struct dc *dc,
                struct dc_state *context)
 {
-       int i;
+       unsigned int i;
 
        /* program audio wall clock. use HDMI as clock source if HDMI
         * audio active. Otherwise, use DP as clock source
index 774605a029e8d45ae80917fd85a60386459aae83..40391dd16944d250759d525c19e9801681588028 100644 (file)
@@ -885,7 +885,7 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable)
 {
        union dmub_rb_cmd cmd;
        uint32_t tmr_delay = 0, tmr_scale = 0;
-       struct dc_cursor_attributes cursor_attr;
+       struct dc_cursor_attributes cursor_attr = {0};
        bool cursor_cache_enable = false;
        struct dc_stream_state *stream = NULL;
        struct dc_plane_state *plane = NULL;
index 2368fad61b41b7df1542b5e60f02042868b9e5cd..659ce11ad44623ead005546be501f32d30057a47 100644 (file)
@@ -480,7 +480,7 @@ void hwss_build_fast_sequence(struct dc *dc,
                struct dc_dmub_cmd *dc_dmub_cmd,
                unsigned int dmub_cmd_count,
                struct block_sequence block_sequence[],
-               int *num_steps,
+               unsigned int *num_steps,
                struct pipe_ctx *pipe_ctx,
                struct dc_stream_status *stream_status);
 
index 22b24749c9d26ecd2e6401b832e8647a60b0a033..8d1a1cc94a8b372ffe2918558cf817c6a9023f55 100644 (file)
@@ -884,7 +884,7 @@ void dp_set_preferred_link_settings(struct dc *dc,
 {
        int i;
        struct pipe_ctx *pipe;
-       struct dc_stream_state *link_stream;
+       struct dc_stream_state *link_stream = 0;
        struct dc_link_settings store_settings = *link_setting;
 
        link->preferred_link_setting = store_settings;
index 9c0e2b9cffc9e98ab4971e7e631a54faf489b935..ce68476e69d5f6bbfb7b4bef65a76a8469fd40ef 100644 (file)
@@ -127,7 +127,7 @@ void link_blank_dp_stream(struct dc_link *link, bool hw_init)
                if (link->ep_type == DISPLAY_ENDPOINT_PHY &&
                        link->link_enc->funcs->get_dig_frontend &&
                        link->link_enc->funcs->is_dig_enabled(link->link_enc)) {
-                       unsigned int fe = link->link_enc->funcs->get_dig_frontend(link->link_enc);
+                       int fe = link->link_enc->funcs->get_dig_frontend(link->link_enc);
 
                        if (fe != ENGINE_ID_UNKNOWN)
                                for (j = 0; j < dc->res_pool->stream_enc_count; j++) {
index 5d36bab0029ca54a03aaef4fc83ff99e59550e5a..edb21d21952a578ac7cdfff2cfd753ffbaa8257b 100644 (file)
@@ -291,7 +291,7 @@ static enum link_training_result dpia_training_cr_non_transparent(
 {
        enum link_training_result result = LINK_TRAINING_CR_FAIL_LANE0;
        uint8_t repeater_cnt = 0; /* Number of hops/repeaters in display path. */
-       enum dc_status status;
+       enum dc_status status = DC_ERROR_UNEXPECTED;
        uint32_t retries_cr = 0; /* Number of consecutive attempts with same VS or PE. */
        uint32_t retry_count = 0;
        uint32_t wait_time_microsec = TRAINING_AUX_RD_INTERVAL; /* From DP spec, CR read interval is always 100us. */
@@ -617,7 +617,7 @@ static enum link_training_result dpia_training_eq_non_transparent(
        enum link_training_result result = LINK_TRAINING_EQ_FAIL_EQ;
        uint8_t repeater_cnt = 0; /* Number of hops/repeaters in display path. */
        uint32_t retries_eq = 0;
-       enum dc_status status;
+       enum dc_status status = DC_ERROR_UNEXPECTED;
        enum dc_dp_training_pattern tr_pattern;
        uint32_t wait_time_microsec = 0;
        enum dc_lane_count lane_count = lt_settings->link_settings.lane_count;
index d1edac46c9a0899a4d8f781e94b8aaab070c7bd8..88afb2a30eef500cdba1481cb0e1f7be732ca7ed 100644 (file)
@@ -864,8 +864,6 @@ static struct clock_source *find_matching_pll(
        default:
                return NULL;
        }
-
-       return NULL;
 }
 
 static enum dc_status build_mapped_resource(
index 20662edd0ae457c43ab70b5bcf055491bfb2f1ff..621825a51f46e1e6a5c788fa24a89b2134c71654 100644 (file)
@@ -1060,7 +1060,7 @@ static bool dce120_resource_construct(
        struct irq_service_init_data irq_init_data;
        static const struct resource_create_funcs *res_funcs;
        bool is_vg20 = ASICREV_IS_VEGA20_P(ctx->asic_id.hw_internal_rev);
-       uint32_t pipe_fuses;
+       uint32_t pipe_fuses = 0;
 
        ctx->dc_bios->regs = &bios_regs;
 
index ecc477ef8e3b78e1705b8546ac17e1d8490982f7..237e00ea3e9403cfb42de2717868ecca40e6a1c9 100644 (file)
@@ -1639,7 +1639,7 @@ noinline bool dcn30_internal_validate_bw(
        int split[MAX_PIPES] = { 0 };
        bool merge[MAX_PIPES] = { false };
        bool newly_split[MAX_PIPES] = { false };
-       int pipe_cnt, i, pipe_idx, vlevel;
+       int pipe_cnt, i, pipe_idx, vlevel = 0;
        struct vba_vars_st *vba = &context->bw_ctx.dml.vba;
 
        ASSERT(pipes);
index ce3699f6260246222c32e1b6c7b2d65fbfa32ca4..ecec3b69bb8800f86585040721bd4d2f913e1209 100644 (file)
@@ -1644,7 +1644,7 @@ int dcn31_populate_dml_pipes_from_context(
 {
        int i, pipe_cnt;
        struct resource_context *res_ctx = &context->res_ctx;
-       struct pipe_ctx *pipe;
+       struct pipe_ctx *pipe = 0;
        bool upscaled = false;
 
        DC_FP_START();
index 83a71f1b933dd34427678456ab379c32ccebc226..e808231e84788d4e823787f508b158c82919b625 100644 (file)
@@ -1613,7 +1613,7 @@ static int dcn316_populate_dml_pipes_from_context(
 {
        int i, pipe_cnt;
        struct resource_context *res_ctx = &context->res_ctx;
-       struct pipe_ctx *pipe;
+       struct pipe_ctx *pipe = 0;
        const int max_usable_det = context->bw_ctx.dml.ip.config_return_buffer_size_in_kbytes - DCN3_16_MIN_COMPBUF_SIZE_KB;
 
        DC_FP_START();
index 8b5c2785767115ac10c469da754b9880fdfc9155..3699e633801d2eae3174e7864b5edd96828ad1d3 100644 (file)
@@ -1059,7 +1059,7 @@ static bool build_freesync_hdr(struct pwl_float_data_ex *rgb_regamma,
        struct fixed31_32 min_display;
        struct fixed31_32 max_content;
        struct fixed31_32 clip = dc_fixpt_one;
-       struct fixed31_32 output;
+       struct fixed31_32 output = dc_fixpt_zero;
        bool use_eetf = false;
        bool is_clipped = false;
        struct fixed31_32 sdr_white_level;
index 733f22bed021987e5e2efa5422bd5f6ff57725ee..c996365e84b0153716ca3e63f3b8be9c4283a6a3 100644 (file)
@@ -151,7 +151,7 @@ out:
 
 static enum mod_hdcp_status poll_l_prime_available(struct mod_hdcp *hdcp)
 {
-       enum mod_hdcp_status status;
+       enum mod_hdcp_status status = MOD_HDCP_STATUS_FAILURE;
        uint8_t size;
        uint16_t max_wait = 20; // units of ms
        uint16_t num_polls = 5;