diff options
| author | Chaitanya Dhere <chaitanya.dhere@amd.com> | 2024-04-04 14:34:04 -0400 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2024-04-16 21:24:38 -0400 | 
| commit | 0a571e8657c40047e6602466abfcb6514a391041 (patch) | |
| tree | 3eab3bfa551aa9f9b3f8e9576b86bcc5fc0dd294 /drivers/gpu/drm/amd | |
| parent | e730c585237eb11f61d3e6555bf47e41c72d0626 (diff) | |
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 <aurabindo.pillai@amd.com>
Acked-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Chaitanya Dhere <chaitanya.dhere@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
| -rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_state.c | 10 | 
1 files changed, 5 insertions, 5 deletions
| 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 bf889bdd3925..76bb05f4d6bf 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 | 
