Commit 9074b67b authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Rob Clark

drm/msm/mdp5: use drm atomic helpers to handle base drm plane state

Use generic helpers code to manage drm_plane_state part of mdp5_plane
state instead of manually coding all the details.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20210525131316.3117809-2-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
parent a1444004
...@@ -176,8 +176,8 @@ static void mdp5_plane_reset(struct drm_plane *plane) ...@@ -176,8 +176,8 @@ static void mdp5_plane_reset(struct drm_plane *plane)
{ {
struct mdp5_plane_state *mdp5_state; struct mdp5_plane_state *mdp5_state;
if (plane->state && plane->state->fb) if (plane->state)
drm_framebuffer_put(plane->state->fb); __drm_atomic_helper_plane_destroy_state(plane->state);
kfree(to_mdp5_plane_state(plane->state)); kfree(to_mdp5_plane_state(plane->state));
mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL); mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL);
...@@ -191,9 +191,7 @@ static void mdp5_plane_reset(struct drm_plane *plane) ...@@ -191,9 +191,7 @@ static void mdp5_plane_reset(struct drm_plane *plane)
else else
mdp5_state->zpos = STAGE0 + drm_plane_index(plane); mdp5_state->zpos = STAGE0 + drm_plane_index(plane);
mdp5_state->base.plane = plane; __drm_atomic_helper_plane_reset(plane, &mdp5_state->base);
plane->state = &mdp5_state->base;
} }
static struct drm_plane_state * static struct drm_plane_state *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment