aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rcar-du
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-05-27 09:36:29 -0400
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2015-06-16 07:25:55 -0400
commit263b39fe33d69da74ae61e594c94eddf75203f7d (patch)
tree989d3656c5f94ae8575973a80bdfa390000ace52 /drivers/gpu/drm/rcar-du
parent39a3d5706527615db2b7d121b64445e79ca1cc1f (diff)
drm: rcar-du: Use the drm atomic state duplication helpers for planes
Ensure that the duplicate and destroy plane state operations will always be in sync with the DRM core implementation of the plane state by using the __drm_atomic_helper_plane_duplicate_state() and __drm_atomic_helper_plane_destroy_state() functions designed especially for this purpose. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du')
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_plane.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
index d90dc428e3fd..c66986414bb4 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
@@ -302,13 +302,15 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane)
302 struct rcar_du_plane_state *state; 302 struct rcar_du_plane_state *state;
303 struct rcar_du_plane_state *copy; 303 struct rcar_du_plane_state *copy;
304 304
305 if (WARN_ON(!plane->state))
306 return NULL;
307
305 state = to_rcar_plane_state(plane->state); 308 state = to_rcar_plane_state(plane->state);
306 copy = kmemdup(state, sizeof(*state), GFP_KERNEL); 309 copy = kmemdup(state, sizeof(*state), GFP_KERNEL);
307 if (copy == NULL) 310 if (copy == NULL)
308 return NULL; 311 return NULL;
309 312
310 if (copy->state.fb) 313 __drm_atomic_helper_plane_duplicate_state(plane, &copy->state);
311 drm_framebuffer_reference(copy->state.fb);
312 314
313 return &copy->state; 315 return &copy->state;
314} 316}
@@ -316,9 +318,7 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane)
316static void rcar_du_plane_atomic_destroy_state(struct drm_plane *plane, 318static void rcar_du_plane_atomic_destroy_state(struct drm_plane *plane,
317 struct drm_plane_state *state) 319 struct drm_plane_state *state)
318{ 320{
319 if (state->fb) 321 __drm_atomic_helper_plane_destroy_state(plane, state);
320 drm_framebuffer_unreference(state->fb);
321
322 kfree(to_rcar_plane_state(state)); 322 kfree(to_rcar_plane_state(state));
323} 323}
324 324