From: Chaitanya Dhere Date: Thu, 4 Apr 2024 18:34:04 +0000 (-0400) Subject: drm/amd/display: Fix incorrect pointer assignment X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0a571e8657c40047e6602466abfcb6514a391041;p=linux.git drm/amd/display: Fix incorrect pointer assignment [Why] Pointer initialization and assignment for dml2_options is not done correctly. While this works for some compilers, others give an error. [How] Modify dc_state_create code to correctly initialize the dml2_opt pointer and pass it to dml2_create. Also update the code with correct derefrence operations. Reviewed-by: Aurabindo Pillai Acked-by: Rodrigo Siqueira Signed-off-by: Chaitanya Dhere Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_state.c b/drivers/gpu/drm/amd/display/dc/core/dc_state.c index bf889bdd3925b..76bb05f4d6bf3 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_state.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_state.c @@ -191,7 +191,7 @@ static void init_state(struct dc *dc, struct dc_state *state) struct dc_state *dc_state_create(struct dc *dc, struct dc_state_create_params *params) { #ifdef CONFIG_DRM_AMD_DC_FP - struct dml2_configuration_options dml2_opt = dc->dml2_options; + struct dml2_configuration_options *dml2_opt = &dc->dml2_options; #endif struct dc_state *state = kvzalloc(sizeof(struct dc_state), GFP_KERNEL); @@ -205,11 +205,11 @@ struct dc_state *dc_state_create(struct dc *dc, struct dc_state_create_params *p #ifdef CONFIG_DRM_AMD_DC_FP if (dc->debug.using_dml2) { - dml2_opt.use_clock_dc_limits = false; - dml2_create(dc, &dml2_opt, &state->bw_ctx.dml2); + dml2_opt->use_clock_dc_limits = false; + dml2_create(dc, dml2_opt, &state->bw_ctx.dml2); - dml2_opt.use_clock_dc_limits = true; - dml2_create(dc, &dml2_opt, &state->bw_ctx.dml2_dc_power_source); + dml2_opt->use_clock_dc_limits = true; + dml2_create(dc, dml2_opt, &state->bw_ctx.dml2_dc_power_source); } #endif