From 1345de7fe91149d7a20fc30a6f11ce9c674104ca Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 21 Aug 2026 16:39:40 +0200 Subject: [PATCH] drm/solomon: ssd130x: Convert to atomic_create_state The ssd130x 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. Reviewed-by: Thomas Zimmermann Link: https://patch.msgid.link/20260821-drm-no-more-crtc-reset-v1-64-fb793475c05a@kernel.org Signed-off-by: Maxime Ripard --- drivers/gpu/drm/solomon/ssd130x.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index 012b399e7425..feec4933e3e6 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -1467,7 +1467,7 @@ static int ssd133x_crtc_atomic_check(struct drm_crtc *crtc, } /* Called during init to allocate the CRTC's atomic state. */ -static void ssd130x_crtc_reset(struct drm_crtc *crtc) +static struct drm_crtc_state *ssd130x_crtc_create_state(struct drm_crtc *crtc) { struct ssd130x_crtc_state *ssd130x_state; @@ -1475,9 +1475,11 @@ static void ssd130x_crtc_reset(struct drm_crtc *crtc) ssd130x_state = kzalloc_obj(*ssd130x_state); if (!ssd130x_state) - return; + return ERR_PTR(-ENOMEM); - __drm_atomic_helper_crtc_reset(crtc, &ssd130x_state->base); + __drm_atomic_helper_crtc_state_init(&ssd130x_state->base, crtc); + + return &ssd130x_state->base; } static struct drm_crtc_state *ssd130x_crtc_duplicate_state(struct drm_crtc *crtc) @@ -1534,7 +1536,7 @@ static const struct drm_crtc_helper_funcs ssd130x_crtc_helper_funcs[] = { }; static const struct drm_crtc_funcs ssd130x_crtc_funcs = { - .reset = ssd130x_crtc_reset, + .atomic_create_state = ssd130x_crtc_create_state, .destroy = drm_crtc_cleanup, .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip,