]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/mediatek: Remove mtk_drm_plane
authorDaniel Kurtz <djkurtz@chromium.org>
Thu, 4 Aug 2016 02:59:53 +0000 (10:59 +0800)
committerSean Paul <seanpaul@chromium.org>
Mon, 8 Aug 2016 18:20:00 +0000 (14:20 -0400)
Now that mtk_drm_plane just contains its base struct drm_plane, we can
just remove it and use struct drm_plane everywhere.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1470279597-60453-4-git-send-email-bibby.hsieh@mediatek.com
drivers/gpu/drm/mediatek/mtk_drm_crtc.c
drivers/gpu/drm/mediatek/mtk_drm_plane.c
drivers/gpu/drm/mediatek/mtk_drm_plane.h

index 18211ab21dafbab3e38c3fff8ecb6a106c3b949e..d6fbefa6561996fbe0ed4ca09d5677c7e04d24ce 100644 (file)
@@ -31,7 +31,7 @@
  * struct mtk_drm_crtc - MediaTek specific crtc structure.
  * @base: crtc object.
  * @enabled: records whether crtc_enable succeeded
- * @planes: array of 4 mtk_drm_plane structures, one for each overlay plane
+ * @planes: array of 4 drm_plane structures, one for each overlay plane
  * @pending_planes: whether any plane has pending changes to be applied
  * @config_regs: memory mapped mmsys configuration register space
  * @mutex: handle to one of the ten disp_mutex streams
@@ -45,7 +45,7 @@ struct mtk_drm_crtc {
        bool                            pending_needs_vblank;
        struct drm_pending_vblank_event *event;
 
-       struct mtk_drm_plane            planes[OVL_LAYER_NR];
+       struct drm_plane                planes[OVL_LAYER_NR];
        bool                            pending_planes;
 
        void __iomem                    *config_regs;
@@ -272,7 +272,7 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
 
        /* Initially configure all planes */
        for (i = 0; i < OVL_LAYER_NR; i++) {
-               struct drm_plane *plane = &mtk_crtc->planes[i].base;
+               struct drm_plane *plane = &mtk_crtc->planes[i];
                struct mtk_plane_state *plane_state;
 
                plane_state = to_mtk_plane_state(plane->state);
@@ -351,7 +351,7 @@ static void mtk_drm_crtc_disable(struct drm_crtc *crtc)
 
        /* Set all pending plane state to disabled */
        for (i = 0; i < OVL_LAYER_NR; i++) {
-               struct drm_plane *plane = &mtk_crtc->planes[i].base;
+               struct drm_plane *plane = &mtk_crtc->planes[i];
                struct mtk_plane_state *plane_state;
 
                plane_state = to_mtk_plane_state(plane->state);
@@ -397,7 +397,7 @@ static void mtk_drm_crtc_atomic_flush(struct drm_crtc *crtc,
        if (mtk_crtc->event)
                mtk_crtc->pending_needs_vblank = true;
        for (i = 0; i < OVL_LAYER_NR; i++) {
-               struct drm_plane *plane = &mtk_crtc->planes[i].base;
+               struct drm_plane *plane = &mtk_crtc->planes[i];
                struct mtk_plane_state *plane_state;
 
                plane_state = to_mtk_plane_state(plane->state);
@@ -471,7 +471,7 @@ void mtk_crtc_ddp_irq(struct drm_crtc *crtc, struct mtk_ddp_comp *ovl)
 
        if (mtk_crtc->pending_planes) {
                for (i = 0; i < OVL_LAYER_NR; i++) {
-                       struct drm_plane *plane = &mtk_crtc->planes[i].base;
+                       struct drm_plane *plane = &mtk_crtc->planes[i];
                        struct mtk_plane_state *plane_state;
 
                        plane_state = to_mtk_plane_state(plane->state);
@@ -564,8 +564,8 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,
                        goto unprepare;
        }
 
-       ret = mtk_drm_crtc_init(drm_dev, mtk_crtc, &mtk_crtc->planes[0].base,
-                               &mtk_crtc->planes[1].base, pipe);
+       ret = mtk_drm_crtc_init(drm_dev, mtk_crtc, &mtk_crtc->planes[0],
+                               &mtk_crtc->planes[1], pipe);
        if (ret < 0)
                goto unprepare;
 
index 32a8e556789cdb8bcf0ee3c3028f3632269e0cb9..86b7aedcb2c11f88870f52831c7314d43a77e143 100644 (file)
@@ -30,10 +30,9 @@ static const u32 formats[] = {
        DRM_FORMAT_RGB565,
 };
 
-static void mtk_plane_enable(struct mtk_drm_plane *mtk_plane,
+static void mtk_plane_enable(struct drm_plane *plane,
                             dma_addr_t addr)
 {
-       struct drm_plane *plane = &mtk_plane->base;
        struct mtk_plane_state *state = to_mtk_plane_state(plane->state);
        unsigned int pitch, format;
        bool enable;
@@ -162,14 +161,13 @@ static void mtk_plane_atomic_update(struct drm_plane *plane,
        struct drm_crtc *crtc = state->base.crtc;
        struct drm_gem_object *gem;
        struct mtk_drm_gem_obj *mtk_gem;
-       struct mtk_drm_plane *mtk_plane = to_mtk_plane(plane);
 
        if (!crtc)
                return;
 
        gem = mtk_fb_get_gem_obj(state->base.fb);
        mtk_gem = to_mtk_gem_obj(gem);
-       mtk_plane_enable(mtk_plane, mtk_gem->dma_addr);
+       mtk_plane_enable(plane, mtk_gem->dma_addr);
 }
 
 static void mtk_plane_atomic_disable(struct drm_plane *plane,
@@ -188,12 +186,12 @@ static const struct drm_plane_helper_funcs mtk_plane_helper_funcs = {
        .atomic_disable = mtk_plane_atomic_disable,
 };
 
-int mtk_plane_init(struct drm_device *dev, struct mtk_drm_plane *mtk_plane,
+int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane,
                   unsigned long possible_crtcs, enum drm_plane_type type)
 {
        int err;
 
-       err = drm_universal_plane_init(dev, &mtk_plane->base, possible_crtcs,
+       err = drm_universal_plane_init(dev, plane, possible_crtcs,
                                       &mtk_plane_funcs, formats,
                                       ARRAY_SIZE(formats), type, NULL);
        if (err) {
@@ -201,7 +199,7 @@ int mtk_plane_init(struct drm_device *dev, struct mtk_drm_plane *mtk_plane,
                return err;
        }
 
-       drm_plane_helper_add(&mtk_plane->base, &mtk_plane_helper_funcs);
+       drm_plane_helper_add(plane, &mtk_plane_helper_funcs);
 
        return 0;
 }
index 74dbedad005d8a50375b565f1a897fa84273a4fb..6a20b49e0f2fec768f4e40381809488655d4bd06 100644 (file)
 #include <drm/drm_crtc.h>
 #include <linux/types.h>
 
-struct mtk_drm_plane {
-       struct drm_plane                base;
-};
-
 struct mtk_plane_pending_state {
        bool                            config;
        bool                            enable;
@@ -40,18 +36,13 @@ struct mtk_plane_state {
        struct mtk_plane_pending_state  pending;
 };
 
-static inline struct mtk_drm_plane *to_mtk_plane(struct drm_plane *plane)
-{
-       return container_of(plane, struct mtk_drm_plane, base);
-}
-
 static inline struct mtk_plane_state *
 to_mtk_plane_state(struct drm_plane_state *state)
 {
        return container_of(state, struct mtk_plane_state, base);
 }
 
-int mtk_plane_init(struct drm_device *dev, struct mtk_drm_plane *mtk_plane,
+int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane,
                   unsigned long possible_crtcs, enum drm_plane_type type);
 
 #endif