diff options
| author | Maxime Ripard <mripard@kernel.org> | 2026-08-14 16:56:50 +0200 |
|---|---|---|
| committer | Maxime Ripard <mripard@kernel.org> | 2026-08-21 16:20:13 +0200 |
| commit | a8a198cefe5cbb5fb5bec00d613233b0431d7ebf (patch) | |
| tree | 72b27fba3aae5ffa6adc3e880e9988930580fdd1 /include | |
| parent | e3eca845ef7d6cd8c407f9b42beb45af94ff096b (diff) | |
| download | linux-next-a8a198cefe5cbb5fb5bec00d613233b0431d7ebf.tar.gz linux-next-a8a198cefe5cbb5fb5bec00d613233b0431d7ebf.zip | |
drm/simple-kms: Add create_plane_state hook
The simple-kms helper provides a reset_plane hook to let drivers
override the default plane reset. However, the reset hook is
overloaded: it is used to create the initial software state at probe
time, but also to reset both the hardware and software state during
suspend/resume. These two roles have different expectations, and
reset is not fallible which makes error handling difficult.
The atomic_create_state pattern was introduced to untangle this by
providing a hook that only allocates and initializes a pristine state
without any side effect.
Add a create_plane_state hook to struct
drm_simple_display_pipe_funcs. When provided,
drm_simple_kms_plane_reset() will use it to allocate a fresh state,
falling back to reset_plane and then to the default
drm_atomic_helper_plane_reset().
This will allow simple-kms drivers to be converted to the
atomic_create_state pattern.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260814-drm-no-more-plane-reset-v2-1-82d2963dd134@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/drm/drm_simple_kms_helper.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/drm/drm_simple_kms_helper.h b/include/drm/drm_simple_kms_helper.h index cb672ce0e856..b58f6d532820 100644 --- a/include/drm/drm_simple_kms_helper.h +++ b/include/drm/drm_simple_kms_helper.h @@ -44,6 +44,7 @@ struct drm_simple_display_pipe_funcs { void (*destroy_crtc_state)(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state); void (*reset_plane)(struct drm_simple_display_pipe *pipe); + struct drm_plane_state * (*create_plane_state)(struct drm_simple_display_pipe *pipe); struct drm_plane_state * (*duplicate_plane_state)(struct drm_simple_display_pipe *pipe); void (*destroy_plane_state)(struct drm_simple_display_pipe *pipe, struct drm_plane_state *plane_state); |
