summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rcar-du
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2015-02-25 18:38:25 +0200
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2015-03-03 16:16:09 +0200
commit3053460482af5f43d6967f34c8497a615969e604 (patch)
tree6469ab279024ad8b0c4d1f355337025d22c9458e /drivers/gpu/drm/rcar-du
parent917de180379da229c8c37fa790b76d0353576581 (diff)
downloadlinux-3053460482af5f43d6967f34c8497a615969e604.tar.bz2
drm: rcar-du: Fix hardware plane allocation
The hardware plane allocator loops over all planes to find free candidates. However, instead of looping over the number of hardware planes, it loops over the number of software planes, which happens to be larger by one unit. This has no effect in practise as the extra plane is always cleared in the mask of free planes, but it should still be fixed for correctness. 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_plane.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
index 242db1e1a1e4..4a0669fd8176 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
@@ -54,7 +54,7 @@ int rcar_du_plane_reserve(struct rcar_du_plane *plane,
mutex_lock(&rgrp->planes.lock);
- for (i = 0; i < ARRAY_SIZE(rgrp->planes.planes); ++i) {
+ for (i = 0; i < RCAR_DU_NUM_HW_PLANES; ++i) {
if (!(rgrp->planes.free & (1 << i)))
continue;
@@ -63,7 +63,7 @@ int rcar_du_plane_reserve(struct rcar_du_plane *plane,
break;
}
- if (i == ARRAY_SIZE(rgrp->planes.planes))
+ if (i == RCAR_DU_NUM_HW_PLANES)
goto done;
rgrp->planes.free &= ~(1 << i);