From d5460f6a279b9fc7645b3b08aa45760ea324e56a Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 14 Aug 2026 16:56:52 +0200 Subject: [PATCH] drm/gem-atomic-helper: Convert simple-kms shadow helpers to create_plane_state drm_gem_simple_kms_reset_shadow_plane() implements the reset_plane hook for simple-kms shadow-buffered planes. Since the reset hook conflates initial state creation with hardware and software reset during suspend/resume, convert it to the create_plane_state pattern. Replace it with drm_gem_simple_kms_create_shadow_plane_state(), which implements the create_plane_state hook using drm_gem_create_shadow_plane_state(). Update DRM_GEM_SIMPLE_DISPLAY_PIPE_SHADOW_PLANE_FUNCS accordingly. Reviewed-by: Thomas Zimmermann Link: https://patch.msgid.link/20260814-drm-no-more-plane-reset-v2-3-82d2963dd134@kernel.org Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_gem_atomic_helper.c | 15 ++++++++++----- include/drm/drm_gem_atomic_helper.h | 5 +++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_atomic_helper.c b/drivers/gpu/drm/drm_gem_atomic_helper.c index 7ef67c2d77ce..ae854555fd12 100644 --- a/drivers/gpu/drm/drm_gem_atomic_helper.c +++ b/drivers/gpu/drm/drm_gem_atomic_helper.c @@ -450,17 +450,22 @@ void drm_gem_simple_kms_end_shadow_fb_access(struct drm_simple_display_pipe *pip EXPORT_SYMBOL(drm_gem_simple_kms_end_shadow_fb_access); /** - * drm_gem_simple_kms_reset_shadow_plane - resets a shadow-buffered plane + * drm_gem_simple_kms_create_shadow_plane_state - creates shadow-buffered plane state * @pipe: the simple display pipe * - * This function implements struct drm_simple_display_funcs.reset_plane + * This function implements struct drm_simple_display_pipe_funcs.create_plane_state * for shadow-buffered planes. + * + * Returns: + * A pointer to a new plane state on success, or an ERR_PTR()-encoded + * error code otherwise. */ -void drm_gem_simple_kms_reset_shadow_plane(struct drm_simple_display_pipe *pipe) +struct drm_plane_state * +drm_gem_simple_kms_create_shadow_plane_state(struct drm_simple_display_pipe *pipe) { - drm_gem_reset_shadow_plane(&pipe->plane); + return drm_gem_create_shadow_plane_state(&pipe->plane); } -EXPORT_SYMBOL(drm_gem_simple_kms_reset_shadow_plane); +EXPORT_SYMBOL(drm_gem_simple_kms_create_shadow_plane_state); /** * drm_gem_simple_kms_duplicate_shadow_plane_state - duplicates shadow-buffered plane state diff --git a/include/drm/drm_gem_atomic_helper.h b/include/drm/drm_gem_atomic_helper.h index 43657d8fb1c8..8a3bb27233db 100644 --- a/include/drm/drm_gem_atomic_helper.h +++ b/include/drm/drm_gem_atomic_helper.h @@ -133,7 +133,8 @@ int drm_gem_simple_kms_begin_shadow_fb_access(struct drm_simple_display_pipe *pi struct drm_plane_state *plane_state); void drm_gem_simple_kms_end_shadow_fb_access(struct drm_simple_display_pipe *pipe, struct drm_plane_state *plane_state); -void drm_gem_simple_kms_reset_shadow_plane(struct drm_simple_display_pipe *pipe); +struct drm_plane_state * +drm_gem_simple_kms_create_shadow_plane_state(struct drm_simple_display_pipe *pipe); struct drm_plane_state * drm_gem_simple_kms_duplicate_shadow_plane_state(struct drm_simple_display_pipe *pipe); void drm_gem_simple_kms_destroy_shadow_plane_state(struct drm_simple_display_pipe *pipe, @@ -150,7 +151,7 @@ void drm_gem_simple_kms_destroy_shadow_plane_state(struct drm_simple_display_pip #define DRM_GEM_SIMPLE_DISPLAY_PIPE_SHADOW_PLANE_FUNCS \ .begin_fb_access = drm_gem_simple_kms_begin_shadow_fb_access, \ .end_fb_access = drm_gem_simple_kms_end_shadow_fb_access, \ - .reset_plane = drm_gem_simple_kms_reset_shadow_plane, \ + .create_plane_state = drm_gem_simple_kms_create_shadow_plane_state, \ .duplicate_plane_state = drm_gem_simple_kms_duplicate_shadow_plane_state, \ .destroy_plane_state = drm_gem_simple_kms_destroy_shadow_plane_state