diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 60b3f2bb153b..d971ed6eb6eb 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -73,17 +73,17 @@ * allocate a new empty object. We just need enough space to store * a malidp_plane_state instead of a drm_plane_state. */ -static void malidp_plane_reset(struct drm_plane *plane) +static struct drm_plane_state *malidp_plane_create_state(struct drm_plane *plane) { - struct malidp_plane_state *state = to_malidp_plane_state(plane->state); + struct malidp_plane_state *state; - if (state) - __drm_atomic_helper_plane_destroy_state(&state->base); - kfree(state); - plane->state = NULL; state = kzalloc_obj(*state); - if (state) - __drm_atomic_helper_plane_reset(plane, &state->base); + if (!state) + return ERR_PTR(-ENOMEM); + + __drm_atomic_helper_plane_state_init(&state->base, plane); + + return &state->base; } static struct @@ -252,7 +252,7 @@ static bool malidp_format_mod_supported_per_plane(struct drm_plane *plane, static const struct drm_plane_funcs malidp_de_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .reset = malidp_plane_reset, + .atomic_create_state = malidp_plane_create_state, .atomic_duplicate_state = malidp_duplicate_plane_state, .atomic_destroy_state = malidp_destroy_plane_state, .atomic_print_state = malidp_plane_atomic_print_state,