From 2ee29c1c1caa37a7f5ee432af364b3fc4c364717 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 21 Aug 2026 16:39:22 +0200 Subject: [PATCH] drm/malidp: Convert to atomic_create_state The malidp crtc implementation provides a custom reset hook. However, this hook only allocates the state, initializes it with __drm_atomic_helper_crtc_reset(), and frees the previous state. It does not perform any hardware reset. Since this is exactly what the atomic_create_state hook is meant to do, minus the old state cleanup which the caller handles, convert the implementation to use atomic_create_state with __drm_atomic_helper_crtc_state_init() instead. Acked-by: Liviu Dudau Reviewed-by: Thomas Zimmermann Link: https://patch.msgid.link/20260821-drm-no-more-crtc-reset-v1-46-fb793475c05a@kernel.org Signed-off-by: Maxime Ripard --- drivers/gpu/drm/arm/malidp_crtc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c index ebe8e1078777..157ff148efe7 100644 --- a/drivers/gpu/drm/arm/malidp_crtc.c +++ b/drivers/gpu/drm/arm/malidp_crtc.c @@ -476,17 +476,17 @@ static void malidp_crtc_destroy_state(struct drm_crtc *crtc, kfree(mali_state); } -static void malidp_crtc_reset(struct drm_crtc *crtc) +static struct drm_crtc_state *malidp_crtc_create_state(struct drm_crtc *crtc) { - struct malidp_crtc_state *state = kzalloc_obj(*state); + struct malidp_crtc_state *state; - if (crtc->state) - malidp_crtc_destroy_state(crtc, crtc->state); + state = kzalloc_obj(*state); + if (!state) + return ERR_PTR(-ENOMEM); - if (state) - __drm_atomic_helper_crtc_reset(crtc, &state->base); - else - __drm_atomic_helper_crtc_reset(crtc, NULL); + __drm_atomic_helper_crtc_state_init(&state->base, crtc); + + return &state->base; } static int malidp_crtc_enable_vblank(struct drm_crtc *crtc) @@ -511,7 +511,7 @@ static void malidp_crtc_disable_vblank(struct drm_crtc *crtc) static const struct drm_crtc_funcs malidp_crtc_funcs = { .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, - .reset = malidp_crtc_reset, + .atomic_create_state = malidp_crtc_create_state, .atomic_duplicate_state = malidp_crtc_duplicate_state, .atomic_destroy_state = malidp_crtc_destroy_state, .enable_vblank = malidp_crtc_enable_vblank,