Commit 0a571e86 authored by Chaitanya Dhere's avatar Chaitanya Dhere Committed by Alex Deucher

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: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Acked-by: default avatarRodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: default avatarChaitanya Dhere <chaitanya.dhere@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e730c585
...@@ -191,7 +191,7 @@ static void init_state(struct dc *dc, struct dc_state *state) ...@@ -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) struct dc_state *dc_state_create(struct dc *dc, struct dc_state_create_params *params)
{ {
#ifdef CONFIG_DRM_AMD_DC_FP #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 #endif
struct dc_state *state = kvzalloc(sizeof(struct dc_state), struct dc_state *state = kvzalloc(sizeof(struct dc_state),
GFP_KERNEL); GFP_KERNEL);
...@@ -205,11 +205,11 @@ struct dc_state *dc_state_create(struct dc *dc, struct dc_state_create_params *p ...@@ -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 #ifdef CONFIG_DRM_AMD_DC_FP
if (dc->debug.using_dml2) { if (dc->debug.using_dml2) {
dml2_opt.use_clock_dc_limits = false; dml2_opt->use_clock_dc_limits = false;
dml2_create(dc, &dml2_opt, &state->bw_ctx.dml2); dml2_create(dc, dml2_opt, &state->bw_ctx.dml2);
dml2_opt.use_clock_dc_limits = true; dml2_opt->use_clock_dc_limits = true;
dml2_create(dc, &dml2_opt, &state->bw_ctx.dml2_dc_power_source); dml2_create(dc, dml2_opt, &state->bw_ctx.dml2_dc_power_source);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment