Skip to content

Commit 9074b67

Browse files
lumagrobclark
authored andcommitted
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: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20210525131316.3117809-2-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent a144400 commit 9074b67

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ static void mdp5_plane_reset(struct drm_plane *plane)
176176
{
177177
struct mdp5_plane_state *mdp5_state;
178178

179-
if (plane->state && plane->state->fb)
180-
drm_framebuffer_put(plane->state->fb);
179+
if (plane->state)
180+
__drm_atomic_helper_plane_destroy_state(plane->state);
181181

182182
kfree(to_mdp5_plane_state(plane->state));
183183
mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL);
@@ -191,9 +191,7 @@ static void mdp5_plane_reset(struct drm_plane *plane)
191191
else
192192
mdp5_state->zpos = STAGE0 + drm_plane_index(plane);
193193

194-
mdp5_state->base.plane = plane;
195-
196-
plane->state = &mdp5_state->base;
194+
__drm_atomic_helper_plane_reset(plane, &mdp5_state->base);
197195
}
198196

199197
static struct drm_plane_state *

0 commit comments

Comments
 (0)