Skip to content

Commit

Permalink
drm: rcar-du: Use the drm atomic state duplication helpers for planes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Laurent Pinchart authored and Laurent Pinchart committed Jun 16, 2015
1 parent 39a3d57 commit 263b39f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/gpu/drm/rcar-du/rcar_du_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,23 +302,23 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane)
struct rcar_du_plane_state *state;
struct rcar_du_plane_state *copy;

if (WARN_ON(!plane->state))
return NULL;

state = to_rcar_plane_state(plane->state);
copy = kmemdup(state, sizeof(*state), GFP_KERNEL);
if (copy == NULL)
return NULL;

if (copy->state.fb)
drm_framebuffer_reference(copy->state.fb);
__drm_atomic_helper_plane_duplicate_state(plane, &copy->state);

return &copy->state;
}

static void rcar_du_plane_atomic_destroy_state(struct drm_plane *plane,
struct drm_plane_state *state)
{
if (state->fb)
drm_framebuffer_unreference(state->fb);

__drm_atomic_helper_plane_destroy_state(plane, state);
kfree(to_rcar_plane_state(state));
}

Expand Down

0 comments on commit 263b39f

Please sign in to comment.