mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
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>
This commit is contained in:
parent
e730c58523
commit
0a571e8657
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user