aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rcar-du
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2015-02-22 12:24:59 -0500
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2015-03-03 09:16:25 -0500
commit47094194f070a5099854141bdbd54eae68e5ffd5 (patch)
treecd2020325481e9db10b26a9897fbfb0a6c559f60 /drivers/gpu/drm/rcar-du
parentf398f344eb59cd9803091ee08bee77b4e473971e (diff)
drm: rcar-du: Replace plane crtc and enabled fields by plane state
The crtc and enabled fields duplicates information stored in the plane state. Use the plane state instead and remove the fields. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du')
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_crtc.c6
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_plane.c15
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_plane.h3
3 files changed, 5 insertions, 19 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index faa46ed23a62..3f64707412e6 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -212,7 +212,7 @@ static void rcar_du_crtc_update_planes(struct drm_crtc *crtc)
212 struct rcar_du_plane *plane = &rcrtc->group->planes.planes[i]; 212 struct rcar_du_plane *plane = &rcrtc->group->planes.planes[i];
213 unsigned int j; 213 unsigned int j;
214 214
215 if (plane->crtc != &rcrtc->crtc || !plane->enabled) 215 if (plane->plane.state->crtc != &rcrtc->crtc)
216 continue; 216 continue;
217 217
218 /* Insert the plane in the sorted planes array. */ 218 /* Insert the plane in the sorted planes array. */
@@ -379,7 +379,7 @@ static void rcar_du_crtc_start(struct rcar_du_crtc *rcrtc)
379 for (i = 0; i < ARRAY_SIZE(rcrtc->group->planes.planes); ++i) { 379 for (i = 0; i < ARRAY_SIZE(rcrtc->group->planes.planes); ++i) {
380 struct rcar_du_plane *plane = &rcrtc->group->planes.planes[i]; 380 struct rcar_du_plane *plane = &rcrtc->group->planes.planes[i];
381 381
382 if (plane->crtc != crtc || !plane->enabled) 382 if (plane->plane.state->crtc != crtc)
383 continue; 383 continue;
384 384
385 rcar_du_plane_setup(plane); 385 rcar_du_plane_setup(plane);
@@ -608,8 +608,6 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index)
608 rcrtc->enabled = false; 608 rcrtc->enabled = false;
609 rcrtc->plane = &rgrp->planes.planes[index % 2]; 609 rcrtc->plane = &rgrp->planes.planes[index % 2];
610 610
611 rcrtc->plane->crtc = crtc;
612
613 ret = drm_crtc_init_with_planes(rcdu->ddev, crtc, &rcrtc->plane->plane, 611 ret = drm_crtc_init_with_planes(rcdu->ddev, crtc, &rcrtc->plane->plane,
614 NULL, &crtc_funcs); 612 NULL, &crtc_funcs);
615 if (ret < 0) 613 if (ret < 0)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
index f28d13dc6fc9..c5cb2ade2722 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
@@ -140,7 +140,8 @@ static void rcar_du_plane_setup_fb(struct rcar_du_plane *plane)
140 bool interlaced; 140 bool interlaced;
141 u32 mwr; 141 u32 mwr;
142 142
143 interlaced = plane->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE; 143 interlaced = plane->plane.state->crtc->state->adjusted_mode.flags
144 & DRM_MODE_FLAG_INTERLACE;
144 145
145 /* Memory pitch (expressed in pixels). Must be doubled for interlaced 146 /* Memory pitch (expressed in pixels). Must be doubled for interlaced
146 * operation with 32bpp formats. 147 * operation with 32bpp formats.
@@ -354,16 +355,11 @@ static int rcar_du_plane_atomic_check(struct drm_plane *plane,
354 355
355static void rcar_du_plane_disable(struct rcar_du_plane *rplane) 356static void rcar_du_plane_disable(struct rcar_du_plane *rplane)
356{ 357{
357 if (!rplane->enabled) 358 if (!rplane->plane.state->crtc)
358 return; 359 return;
359 360
360 mutex_lock(&rplane->group->planes.lock);
361 rplane->enabled = false;
362 mutex_unlock(&rplane->group->planes.lock);
363
364 rcar_du_plane_release(rplane); 361 rcar_du_plane_release(rplane);
365 362
366 rplane->crtc = NULL;
367 rplane->format = NULL; 363 rplane->format = NULL;
368} 364}
369 365
@@ -391,14 +387,9 @@ static void rcar_du_plane_atomic_update(struct drm_plane *plane,
391 rcar_du_plane_reserve(rplane, format); 387 rcar_du_plane_reserve(rplane, format);
392 } 388 }
393 389
394 rplane->crtc = state->crtc;
395 rplane->format = format; 390 rplane->format = format;
396 391
397 rcar_du_plane_setup(rplane); 392 rcar_du_plane_setup(rplane);
398
399 mutex_lock(&rplane->group->planes.lock);
400 rplane->enabled = true;
401 mutex_unlock(&rplane->group->planes.lock);
402} 393}
403 394
404static const struct drm_plane_helper_funcs rcar_du_plane_helper_funcs = { 395static const struct drm_plane_helper_funcs rcar_du_plane_helper_funcs = {
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.h b/drivers/gpu/drm/rcar-du/rcar_du_plane.h
index 012f2185ca1f..7050fc1e11ec 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.h
@@ -34,9 +34,6 @@ struct rcar_du_plane {
34 struct drm_plane plane; 34 struct drm_plane plane;
35 35
36 struct rcar_du_group *group; 36 struct rcar_du_group *group;
37 struct drm_crtc *crtc;
38
39 bool enabled;
40 37
41 int hwindex; /* 0-based, -1 means unused */ 38 int hwindex; /* 0-based, -1 means unused */
42 39