drm/simple-kms: Switch to atomic_create_state

drm_simple_kms_plane_reset() handled three cases: delegating to
reset_plane, using create_plane_state with manual teardown, or
falling back to the default helper. This complexity existed to bridge
the old reset hook with the new create_plane_state hook during the
transition.

Now that all simple-kms drivers implement create_plane_state instead
of reset_plane, replace drm_simple_kms_plane_reset() with
drm_simple_kms_plane_create_state() which only dispatches between
create_plane_state and drm_atomic_helper_plane_create_state(). Wire
it to .atomic_create_state instead of .reset.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260814-drm-no-more-plane-reset-v2-7-82d2963dd134@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Maxime Ripard 2026-08-14 16:56:56 +02:00
parent 7e8bd554c3
commit 7f87928439
No known key found for this signature in database
GPG Key ID: 275FCE19A23DBE76

View File

@ -281,37 +281,16 @@ static const struct drm_plane_helper_funcs drm_simple_kms_plane_helper_funcs = {
.atomic_update = drm_simple_kms_plane_atomic_update,
};
static void drm_simple_kms_plane_destroy_state(struct drm_plane *plane,
struct drm_plane_state *state);
static void drm_simple_kms_plane_reset(struct drm_plane *plane)
static struct drm_plane_state *
drm_simple_kms_plane_create_state(struct drm_plane *plane)
{
struct drm_simple_display_pipe *pipe;
pipe = container_of(plane, struct drm_simple_display_pipe, plane);
if (!pipe->funcs)
return drm_atomic_helper_plane_reset(plane);
if (!pipe->funcs || !pipe->funcs->create_plane_state)
return drm_atomic_helper_plane_create_state(plane);
if (pipe->funcs->create_plane_state) {
struct drm_plane_state *state;
if (plane->state) {
drm_simple_kms_plane_destroy_state(plane, plane->state);
plane->state = NULL;
}
state = pipe->funcs->create_plane_state(pipe);
if (WARN_ON(IS_ERR(state)))
return;
plane->state = state;
return;
}
if (pipe->funcs->reset_plane)
return pipe->funcs->reset_plane(pipe);
return drm_atomic_helper_plane_reset(plane);
return pipe->funcs->create_plane_state(pipe);
}
static struct drm_plane_state *drm_simple_kms_plane_duplicate_state(struct drm_plane *plane)
@ -341,7 +320,7 @@ static const struct drm_plane_funcs drm_simple_kms_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = drm_plane_cleanup,
.reset = drm_simple_kms_plane_reset,
.atomic_create_state = drm_simple_kms_plane_create_state,
.atomic_duplicate_state = drm_simple_kms_plane_duplicate_state,
.atomic_destroy_state = drm_simple_kms_plane_destroy_state,
.format_mod_supported = drm_simple_kms_format_mod_supported,