提交 263b39fe 编写于 作者: L Laurent Pinchart 提交者: Laurent Pinchart

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: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
上级 39a3d570
...@@ -302,13 +302,15 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane) ...@@ -302,13 +302,15 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane)
struct rcar_du_plane_state *state; struct rcar_du_plane_state *state;
struct rcar_du_plane_state *copy; struct rcar_du_plane_state *copy;
if (WARN_ON(!plane->state))
return NULL;
state = to_rcar_plane_state(plane->state); state = to_rcar_plane_state(plane->state);
copy = kmemdup(state, sizeof(*state), GFP_KERNEL); copy = kmemdup(state, sizeof(*state), GFP_KERNEL);
if (copy == NULL) if (copy == NULL)
return NULL; return NULL;
if (copy->state.fb) __drm_atomic_helper_plane_duplicate_state(plane, &copy->state);
drm_framebuffer_reference(copy->state.fb);
return &copy->state; return &copy->state;
} }
...@@ -316,9 +318,7 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane) ...@@ -316,9 +318,7 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane)
static void rcar_du_plane_atomic_destroy_state(struct drm_plane *plane, static void rcar_du_plane_atomic_destroy_state(struct drm_plane *plane,
struct drm_plane_state *state) struct drm_plane_state *state)
{ {
if (state->fb) __drm_atomic_helper_plane_destroy_state(plane, state);
drm_framebuffer_unreference(state->fb);
kfree(to_rcar_plane_state(state)); kfree(to_rcar_plane_state(state));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册