Commit 82c702cb authored by Russell King's avatar Russell King

drm/armada: remove unnecessary armada_plane structure

We no longer require a private armada_plane structure, so eliminate
it, and use the drm_plane structure directly.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent d701278a
...@@ -723,7 +723,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, ...@@ -723,7 +723,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
{ {
struct armada_private *priv = drm->dev_private; struct armada_private *priv = drm->dev_private;
struct armada_crtc *dcrtc; struct armada_crtc *dcrtc;
struct armada_plane *primary; struct drm_plane *primary;
void __iomem *base; void __iomem *base;
int ret; int ret;
...@@ -793,7 +793,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, ...@@ -793,7 +793,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
goto err_crtc; goto err_crtc;
} }
ret = drm_crtc_init_with_planes(drm, &dcrtc->crtc, &primary->base, NULL, ret = drm_crtc_init_with_planes(drm, &dcrtc->crtc, primary, NULL,
&armada_crtc_funcs, NULL); &armada_crtc_funcs, NULL);
if (ret) if (ret)
goto err_crtc_init; goto err_crtc_init;
...@@ -803,7 +803,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, ...@@ -803,7 +803,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
return armada_overlay_plane_create(drm, 1 << dcrtc->num); return armada_overlay_plane_create(drm, 1 << dcrtc->num);
err_crtc_init: err_crtc_init:
primary->base.funcs->destroy(&primary->base); primary->funcs->destroy(primary);
err_crtc: err_crtc:
kfree(dcrtc); kfree(dcrtc);
......
...@@ -32,15 +32,8 @@ struct armada_regs { ...@@ -32,15 +32,8 @@ struct armada_regs {
armada_reg_queue_mod(_r, _i, 0, 0, ~0) armada_reg_queue_mod(_r, _i, 0, 0, ~0)
struct armada_crtc; struct armada_crtc;
struct armada_plane;
struct armada_variant; struct armada_variant;
struct armada_plane {
struct drm_plane base;
wait_queue_head_t frame_wait;
};
#define drm_to_armada_plane(p) container_of(p, struct armada_plane, base)
struct armada_crtc { struct armada_crtc {
struct drm_crtc crtc; struct drm_crtc crtc;
const struct armada_variant *variant; const struct armada_variant *variant;
......
...@@ -271,25 +271,14 @@ static const struct drm_plane_funcs armada_primary_plane_funcs = { ...@@ -271,25 +271,14 @@ static const struct drm_plane_funcs armada_primary_plane_funcs = {
.atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
}; };
int armada_drm_plane_init(struct armada_plane *plane)
{
init_waitqueue_head(&plane->frame_wait);
return 0;
}
int armada_drm_primary_plane_init(struct drm_device *drm, int armada_drm_primary_plane_init(struct drm_device *drm,
struct armada_plane *primary) struct drm_plane *primary)
{ {
int ret; int ret;
ret = armada_drm_plane_init(primary); drm_plane_helper_add(primary, &armada_primary_plane_helper_funcs);
if (ret)
return ret;
drm_plane_helper_add(&primary->base,
&armada_primary_plane_helper_funcs);
ret = drm_universal_plane_init(drm, &primary->base, 0, ret = drm_universal_plane_init(drm, primary, 0,
&armada_primary_plane_funcs, &armada_primary_plane_funcs,
armada_primary_formats, armada_primary_formats,
ARRAY_SIZE(armada_primary_formats), ARRAY_SIZE(armada_primary_formats),
......
...@@ -9,8 +9,7 @@ void armada_drm_plane_cleanup_fb(struct drm_plane *plane, ...@@ -9,8 +9,7 @@ void armada_drm_plane_cleanup_fb(struct drm_plane *plane,
struct drm_plane_state *old_state); struct drm_plane_state *old_state);
int armada_drm_plane_atomic_check(struct drm_plane *plane, int armada_drm_plane_atomic_check(struct drm_plane *plane,
struct drm_plane_state *state); struct drm_plane_state *state);
int armada_drm_plane_init(struct armada_plane *plane);
int armada_drm_primary_plane_init(struct drm_device *drm, int armada_drm_primary_plane_init(struct drm_device *drm,
struct armada_plane *primary); struct drm_plane *primary);
#endif #endif
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