drm/armada: remove unnecessary armada_plane structure
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 30 Jul 2018 10:53:06 +0000 (11:53 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Mon, 30 Jul 2018 10:53:06 +0000 (11:53 +0100)
We no longer require a private armada_plane structure, so eliminate
it, and use the drm_plane structure directly.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
drivers/gpu/drm/armada/armada_crtc.c
drivers/gpu/drm/armada/armada_crtc.h
drivers/gpu/drm/armada/armada_plane.c
drivers/gpu/drm/armada/armada_plane.h

index bb1e13b4516b77b7e179ba18ae88c10ddcee86ad..da9360688b5546664deb1f41de3e75e12137fa85 100644 (file)
@@ -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_crtc *dcrtc;
-       struct armada_plane *primary;
+       struct drm_plane *primary;
        void __iomem *base;
        int ret;
 
@@ -793,7 +793,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev,
                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);
        if (ret)
                goto err_crtc_init;
@@ -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);
 
 err_crtc_init:
-       primary->base.funcs->destroy(&primary->base);
+       primary->funcs->destroy(primary);
 err_crtc:
        kfree(dcrtc);
 
index b95ea13d0705de771b5cba5da40fa67c27d5fca0..7ebd337b60af3d40b9b0fb920cc23126e2a7e330 100644 (file)
@@ -32,15 +32,8 @@ struct armada_regs {
        armada_reg_queue_mod(_r, _i, 0, 0, ~0)
 
 struct armada_crtc;
-struct armada_plane;
 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 drm_crtc         crtc;
        const struct armada_variant *variant;
index bed2dca83a3754de30e8a680cf26d9e1a324a3cc..9f36423dd394b11abfe5f42f9a0bc57316ca0353 100644 (file)
@@ -271,25 +271,14 @@ static const struct drm_plane_funcs armada_primary_plane_funcs = {
        .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,
-       struct armada_plane *primary)
+       struct drm_plane *primary)
 {
        int ret;
 
-       ret = armada_drm_plane_init(primary);
-       if (ret)
-               return ret;
-
-       drm_plane_helper_add(&primary->base,
-                            &armada_primary_plane_helper_funcs);
+       drm_plane_helper_add(primary, &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_formats,
                                       ARRAY_SIZE(armada_primary_formats),
index 1bd8430992e090339d1788163a0446afe4f3b584..ff4281ba7fad4a8a431f4dabc872aab3235e50b3 100644 (file)
@@ -9,8 +9,7 @@ void armada_drm_plane_cleanup_fb(struct drm_plane *plane,
        struct drm_plane_state *old_state);
 int armada_drm_plane_atomic_check(struct drm_plane *plane,
        struct drm_plane_state *state);
-int armada_drm_plane_init(struct armada_plane *plane);
 int armada_drm_primary_plane_init(struct drm_device *drm,
-       struct armada_plane *primary);
+       struct drm_plane *primary);
 
 #endif