summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Ripard <mripard@kernel.org>2026-09-08 16:46:53 +0200
committerMaxime Ripard <mripard@kernel.org>2026-09-15 11:46:55 +0200
commit97d3d856d82156bdbbd934b8def9711322ada8fa (patch)
tree83dcb8d9d89aefccad2e6ae9d669fe76238a4a7b
parent5a4954daca6e7feb229616260d0e03ec246500ae (diff)
downloadlinux-next-97d3d856d82156bdbbd934b8def9711322ada8fa.tar.gz
linux-next-97d3d856d82156bdbbd934b8def9711322ada8fa.zip
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>
-rw-r--r--drivers/gpu/drm/verisilicon/vs_cursor_plane.c2
-rw-r--r--drivers/gpu/drm/verisilicon/vs_plane.c14
-rw-r--r--drivers/gpu/drm/verisilicon/vs_plane.h2
-rw-r--r--drivers/gpu/drm/verisilicon/vs_primary_plane.c2
4 files changed, 8 insertions, 12 deletions
diff --git a/drivers/gpu/drm/verisilicon/vs_cursor_plane.c b/drivers/gpu/drm/verisilicon/vs_cursor_plane.c
index 05e7a04e614c..6a7fd9e179bb 100644
--- a/drivers/gpu/drm/verisilicon/vs_cursor_plane.c
+++ b/drivers/gpu/drm/verisilicon/vs_cursor_plane.c
@@ -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,
};
diff --git a/drivers/gpu/drm/verisilicon/vs_plane.c b/drivers/gpu/drm/verisilicon/vs_plane.c
index f189c0bba5b7..03a848ee0875 100644
--- a/drivers/gpu/drm/verisilicon/vs_plane.c
+++ b/drivers/gpu/drm/verisilicon/vs_plane.c
@@ -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;
}
diff --git a/drivers/gpu/drm/verisilicon/vs_plane.h b/drivers/gpu/drm/verisilicon/vs_plane.h
index e4f82f1fc6e9..b4ce14098aa3 100644
--- a/drivers/gpu/drm/verisilicon/vs_plane.h
+++ b/drivers/gpu/drm/verisilicon/vs_plane.h
@@ -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);
diff --git a/drivers/gpu/drm/verisilicon/vs_primary_plane.c b/drivers/gpu/drm/verisilicon/vs_primary_plane.c
index 2750016a7f2c..20a820f1ef30 100644
--- a/drivers/gpu/drm/verisilicon/vs_primary_plane.c
+++ b/drivers/gpu/drm/verisilicon/vs_primary_plane.c
@@ -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,
};