summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
index c7ec09e557c19..afebd4fe43955 100644
--- a/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c
@@ -297,21 +297,18 @@ void ipu_plane_disable_deferred(struct drm_plane *plane)
}
}
-static void ipu_plane_state_reset(struct drm_plane *plane)
+static struct drm_plane_state *ipu_plane_state_create_state(struct drm_plane *plane)
{
struct ipu_plane_state *ipu_state;
- if (plane->state) {
- ipu_state = to_ipu_plane_state(plane->state);
- __drm_atomic_helper_plane_destroy_state(plane->state);
- kfree(ipu_state);
- plane->state = NULL;
- }
-
ipu_state = kzalloc_obj(*ipu_state);
- if (ipu_state)
- __drm_atomic_helper_plane_reset(plane, &ipu_state->base);
+ if (!ipu_state)
+ return ERR_PTR(-ENOMEM);
+
+ __drm_atomic_helper_plane_state_init(&ipu_state->base, plane);
+
+ return &ipu_state->base;
}
static struct drm_plane_state *
@@ -358,7 +355,7 @@ static bool ipu_plane_format_mod_supported(struct drm_plane *plane,
static const struct drm_plane_funcs ipu_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
- .reset = ipu_plane_state_reset,
+ .atomic_create_state = ipu_plane_state_create_state,
.atomic_duplicate_state = ipu_plane_duplicate_state,
.atomic_destroy_state = ipu_plane_destroy_state,
.format_mod_supported = ipu_plane_format_mod_supported,