drm/verisilicon: Convert to atomic_create_state

The plane reset implementation creates a custom state subclass, but
only initializes a pristine state without resetting any hardware. This
is equivalent to what atomic_create_state expects. Convert to it.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260908-drm-no-more-plane-reset-v4-22-a31b3fcfc989@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Maxime Ripard 2026-09-08 16:46:53 +02:00
parent 5a4954daca
commit 97d3d856d8
No known key found for this signature in database
GPG Key ID: 275FCE19A23DBE76
4 changed files with 8 additions and 12 deletions

View File

@ -231,10 +231,10 @@ static const struct drm_plane_helper_funcs vs_cursor_plane_helper_funcs = {
};
static const struct drm_plane_funcs vs_cursor_plane_funcs = {
.atomic_create_state = drm_atomic_helper_plane_create_state,
.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
.disable_plane = drm_atomic_helper_disable_plane,
.reset = drm_atomic_helper_plane_reset,
.update_plane = drm_atomic_helper_update_plane,
};

View File

@ -136,19 +136,15 @@ void vs_plane_destroy_state(struct drm_plane *plane,
}
/* Called during init to allocate the plane's atomic state. */
void vs_plane_reset(struct drm_plane *plane)
struct drm_plane_state *vs_plane_create_state(struct drm_plane *plane)
{
struct vs_plane_state *vs_state;
if (plane->state) {
__drm_atomic_helper_plane_destroy_state(plane->state);
kfree(plane->state);
plane->state = NULL;
}
vs_state = kzalloc_obj(*vs_state);
if (!vs_state)
return;
return ERR_PTR(-ENOMEM);
__drm_atomic_helper_plane_reset(plane, &vs_state->base);
__drm_atomic_helper_plane_state_init(&vs_state->base, plane);
return &vs_state->base;
}

View File

@ -79,7 +79,7 @@ int drm_format_to_vs_format(u32 drm_format, struct vs_format *vs_format);
struct drm_plane_state *vs_plane_duplicate_state(struct drm_plane *plane);
void vs_plane_destroy_state(struct drm_plane *plane,
struct drm_plane_state *state);
void vs_plane_reset(struct drm_plane *plane);
struct drm_plane_state *vs_plane_create_state(struct drm_plane *plane);
struct drm_plane *vs_primary_plane_init(struct drm_device *dev, struct vs_dc *dc);
struct drm_plane *vs_cursor_plane_init(struct drm_device *dev, struct vs_dc *dc);

View File

@ -160,10 +160,10 @@ static const struct drm_plane_helper_funcs vs_primary_plane_helper_funcs = {
};
static const struct drm_plane_funcs vs_primary_plane_funcs = {
.atomic_create_state = vs_plane_create_state,
.atomic_destroy_state = vs_plane_destroy_state,
.atomic_duplicate_state = vs_plane_duplicate_state,
.disable_plane = drm_atomic_helper_disable_plane,
.reset = vs_plane_reset,
.update_plane = drm_atomic_helper_update_plane,
};