drm: rcar-du: Embed rcar_du_planes structure into rcar_du_group
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 28 Apr 2015 21:05:56 +0000 (00:05 +0300)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Mon, 25 May 2015 12:34:11 +0000 (15:34 +0300)
The rcar_du_planes structure contains a single field and is only
instantiated in the rcar_du_group structure. Embed it directly and
remove the rcar_du_planes structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
drivers/gpu/drm/rcar-du/rcar_du_crtc.c
drivers/gpu/drm/rcar-du/rcar_du_group.h
drivers/gpu/drm/rcar-du/rcar_du_kms.c
drivers/gpu/drm/rcar-du/rcar_du_plane.c
drivers/gpu/drm/rcar-du/rcar_du_plane.h

index 7d0b8ef9bea21ca04a7fc678f3913dc1768615fd..b5f66b78cbb26aa38faec51e2df47c483d7a8971 100644 (file)
@@ -213,8 +213,8 @@ static void rcar_du_crtc_update_planes(struct rcar_du_crtc *rcrtc)
        u32 dptsr = 0;
        u32 dspr = 0;
 
-       for (i = 0; i < ARRAY_SIZE(rcrtc->group->planes.planes); ++i) {
-               struct rcar_du_plane *plane = &rcrtc->group->planes.planes[i];
+       for (i = 0; i < ARRAY_SIZE(rcrtc->group->planes); ++i) {
+               struct rcar_du_plane *plane = &rcrtc->group->planes[i];
                unsigned int j;
 
                if (plane->plane.state->crtc != &rcrtc->crtc)
@@ -427,8 +427,8 @@ void rcar_du_crtc_resume(struct rcar_du_crtc *rcrtc)
        rcar_du_crtc_start(rcrtc);
 
        /* Commit the planes state. */
-       for (i = 0; i < ARRAY_SIZE(rcrtc->group->planes.planes); ++i) {
-               struct rcar_du_plane *plane = &rcrtc->group->planes.planes[i];
+       for (i = 0; i < ARRAY_SIZE(rcrtc->group->planes); ++i) {
+               struct rcar_du_plane *plane = &rcrtc->group->planes[i];
 
                if (plane->plane.state->crtc != &rcrtc->crtc)
                        continue;
@@ -592,7 +592,7 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index)
        rcrtc->enabled = false;
 
        ret = drm_crtc_init_with_planes(rcdu->ddev, crtc,
-                                       &rgrp->planes.planes[index % 2].plane,
+                                       &rgrp->planes[index % 2].plane,
                                        NULL, &crtc_funcs);
        if (ret < 0)
                return ret;
index ed36433fbe84a55d2fbd3e822d9681251f596d3b..ea02bb02f3e1b6ce218322c7334c11c2c900b86c 100644 (file)
@@ -40,7 +40,7 @@ struct rcar_du_group {
 
        struct mutex lock;
 
-       struct rcar_du_planes planes;
+       struct rcar_du_plane planes[RCAR_DU_NUM_KMS_PLANES];
 };
 
 u32 rcar_du_group_read(struct rcar_du_group *rgrp, u32 reg);
index 5fd6f8c07ec200e64aa509a634ce0a008f60859d..4012afacab5fd1db75ef8008f447436219380840 100644 (file)
@@ -291,7 +291,7 @@ static int rcar_du_atomic_check(struct drm_device *dev,
                 * plane(s) as freed.
                 */
                if (!plane_state->format) {
-                       index = plane - plane->group->planes.planes;
+                       index = plane - plane->group->planes;
                        group_freed_planes[plane->group->index] |= 1 << index;
                        plane_state->hwindex = -1;
                        continue;
@@ -304,7 +304,7 @@ static int rcar_du_atomic_check(struct drm_device *dev,
                        groups |= 1 << plane->group->index;
                        needs_realloc = true;
 
-                       index = plane - plane->group->planes.planes;
+                       index = plane - plane->group->planes;
                        group_freed_planes[plane->group->index] |= 1 << index;
                        plane_state->hwindex = -1;
                }
@@ -327,7 +327,7 @@ static int rcar_du_atomic_check(struct drm_device *dev,
                unsigned int used_planes = 0;
 
                for (i = 0; i < RCAR_DU_NUM_KMS_PLANES; ++i) {
-                       struct rcar_du_plane *plane = &group->planes.planes[i];
+                       struct rcar_du_plane *plane = &group->planes[i];
                        struct rcar_du_plane_state *plane_state;
                        struct drm_plane_state *s;
 
index b5565417f6736644532fc653af616ef5e7902f08..99fefcaf6597df7041728ccf0fda5bea5a426972 100644 (file)
@@ -389,7 +389,6 @@ static const uint32_t formats[] = {
 
 int rcar_du_planes_init(struct rcar_du_group *rgrp)
 {
-       struct rcar_du_planes *planes = &rgrp->planes;
        struct rcar_du_device *rcdu = rgrp->dev;
        unsigned int num_planes;
        unsigned int num_crtcs;
@@ -409,7 +408,7 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp)
                enum drm_plane_type type = i < num_crtcs
                                         ? DRM_PLANE_TYPE_PRIMARY
                                         : DRM_PLANE_TYPE_OVERLAY;
-               struct rcar_du_plane *plane = &planes->planes[i];
+               struct rcar_du_plane *plane = &rgrp->planes[i];
 
                plane->group = rgrp;
 
index 6b17b1f4f414fa91275be41359e9479830bc21c0..d1fb9b16a060812f6d43a1fec8c46014ada29bb0 100644 (file)
@@ -38,10 +38,6 @@ static inline struct rcar_du_plane *to_rcar_plane(struct drm_plane *plane)
        return container_of(plane, struct rcar_du_plane, plane);
 }
 
-struct rcar_du_planes {
-       struct rcar_du_plane planes[RCAR_DU_NUM_KMS_PLANES];
-};
-
 /**
  * struct rcar_du_plane_state - Driver-specific plane state
  * @state: base DRM plane state