drm/vmwgfx: 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: Zack Rusin <zack.rusin@broadcom.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260908-drm-no-more-plane-reset-v4-39-a31b3fcfc989@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Maxime Ripard 2026-09-08 16:47:10 +02:00
parent 5bdc23522c
commit 3a4affc50a
No known key found for this signature in database
GPG Key ID: 275FCE19A23DBE76
5 changed files with 14 additions and 17 deletions

View File

@ -279,27 +279,24 @@ vmw_du_plane_duplicate_state(struct drm_plane *plane)
/**
* vmw_du_plane_reset - creates a blank vmw plane state
* vmw_du_plane_create_state - creates a blank vmw plane state
* @plane: drm plane
*
* Resets the atomic state for @plane by freeing the state pointer (which might
* be NULL, e.g. at driver load time) and allocating a new empty state object.
* Allocates a new empty state object.
*/
void vmw_du_plane_reset(struct drm_plane *plane)
struct drm_plane_state *vmw_du_plane_create_state(struct drm_plane *plane)
{
struct vmw_plane_state *vps;
if (plane->state)
vmw_du_plane_destroy_state(plane, plane->state);
vps = kzalloc_obj(*vps);
if (!vps) {
DRM_ERROR("Cannot allocate vmw_plane_state\n");
return;
return ERR_PTR(-ENOMEM);
}
__drm_atomic_helper_plane_reset(plane, &vps->base);
__drm_atomic_helper_plane_state_init(&vps->base, plane);
return &vps->base;
}

View File

@ -411,7 +411,7 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane,
struct drm_atomic_commit *state);
void vmw_du_plane_cleanup_fb(struct drm_plane *plane,
struct drm_plane_state *old_state);
void vmw_du_plane_reset(struct drm_plane *plane);
struct drm_plane_state *vmw_du_plane_create_state(struct drm_plane *plane);
struct drm_plane_state *vmw_du_plane_duplicate_state(struct drm_plane *plane);
void vmw_du_plane_destroy_state(struct drm_plane *plane,
struct drm_plane_state *state);

View File

@ -364,7 +364,7 @@ static const struct drm_plane_funcs vmw_ldu_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = vmw_du_primary_plane_destroy,
.reset = vmw_du_plane_reset,
.atomic_create_state = vmw_du_plane_create_state,
.atomic_duplicate_state = vmw_du_plane_duplicate_state,
.atomic_destroy_state = vmw_du_plane_destroy_state,
};
@ -373,7 +373,7 @@ static const struct drm_plane_funcs vmw_ldu_cursor_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = vmw_cursor_plane_destroy,
.reset = vmw_du_plane_reset,
.atomic_create_state = vmw_du_plane_create_state,
.atomic_duplicate_state = vmw_du_plane_duplicate_state,
.atomic_destroy_state = vmw_du_plane_destroy_state,
};

View File

@ -756,7 +756,7 @@ static const struct drm_plane_funcs vmw_sou_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = vmw_du_primary_plane_destroy,
.reset = vmw_du_plane_reset,
.atomic_create_state = vmw_du_plane_create_state,
.atomic_duplicate_state = vmw_du_plane_duplicate_state,
.atomic_destroy_state = vmw_du_plane_destroy_state,
};
@ -765,7 +765,7 @@ static const struct drm_plane_funcs vmw_sou_cursor_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = vmw_cursor_plane_destroy,
.reset = vmw_du_plane_reset,
.atomic_create_state = vmw_du_plane_create_state,
.atomic_duplicate_state = vmw_du_plane_duplicate_state,
.atomic_destroy_state = vmw_du_plane_destroy_state,
};

View File

@ -1474,7 +1474,7 @@ static const struct drm_plane_funcs vmw_stdu_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = vmw_du_primary_plane_destroy,
.reset = vmw_du_plane_reset,
.atomic_create_state = vmw_du_plane_create_state,
.atomic_duplicate_state = vmw_du_plane_duplicate_state,
.atomic_destroy_state = vmw_du_plane_destroy_state,
};
@ -1483,7 +1483,7 @@ static const struct drm_plane_funcs vmw_stdu_cursor_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
.destroy = vmw_cursor_plane_destroy,
.reset = vmw_du_plane_reset,
.atomic_create_state = vmw_du_plane_create_state,
.atomic_duplicate_state = vmw_du_plane_duplicate_state,
.atomic_destroy_state = vmw_du_plane_destroy_state,
};