drm/tidss: Convert to atomic_create_state

Our driver uses reset to create the various object states, but only
calls the helper that allocate a new state. They are thus strictly
equivalent to the new atomic_create_state helpers, so let's switch to
these.

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://patch.msgid.link/20260526-drm-mode-config-init-v6-18-852346394200@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Maxime Ripard 2026-05-26 18:46:30 +02:00
parent 0e1c76e7d2
commit 03c13fa139
No known key found for this signature in database
GPG Key ID: 275FCE19A23DBE76
2 changed files with 8 additions and 11 deletions

View File

@ -357,20 +357,17 @@ static void tidss_crtc_destroy_state(struct drm_crtc *crtc,
kfree(tstate);
}
static void tidss_crtc_reset(struct drm_crtc *crtc)
static struct drm_crtc_state *tidss_crtc_create_state(struct drm_crtc *crtc)
{
struct tidss_crtc_state *tstate;
if (crtc->state)
tidss_crtc_destroy_state(crtc, crtc->state);
tstate = kzalloc_obj(*tstate);
if (!tstate) {
crtc->state = NULL;
return;
}
if (!tstate)
return ERR_PTR(-ENOMEM);
__drm_atomic_helper_crtc_reset(crtc, &tstate->base);
__drm_atomic_helper_crtc_state_init(&tstate->base, crtc);
return &tstate->base;
}
static struct drm_crtc_state *tidss_crtc_duplicate_state(struct drm_crtc *crtc)
@ -405,10 +402,10 @@ static void tidss_crtc_destroy(struct drm_crtc *crtc)
}
static const struct drm_crtc_funcs tidss_crtc_funcs = {
.reset = tidss_crtc_reset,
.destroy = tidss_crtc_destroy,
.set_config = drm_atomic_helper_set_config,
.page_flip = drm_atomic_helper_page_flip,
.atomic_create_state = tidss_crtc_create_state,
.atomic_duplicate_state = tidss_crtc_duplicate_state,
.atomic_destroy_state = tidss_crtc_destroy_state,
.enable_vblank = tidss_crtc_enable_vblank,

View File

@ -178,8 +178,8 @@ static const struct drm_plane_helper_funcs tidss_primary_plane_helper_funcs = {
static const struct drm_plane_funcs tidss_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.reset = drm_atomic_helper_plane_reset,
.destroy = drm_plane_destroy,
.atomic_create_state = drm_atomic_helper_plane_create_state,
.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
};