summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2017-08-15 18:52:04 +0300
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2017-12-04 18:38:31 +0200
commit401712e035c699d569dbd37024f4b21dc76cc870 (patch)
treee7c934c91b19b7f89ad107199513f298b16edb7e /drivers/gpu/drm/rcar-du/rcar_du_crtc.c
parent9c893a61b79d38b8997cc417a6b359222cf92414 (diff)
downloadblackbird-op-linux-401712e035c699d569dbd37024f4b21dc76cc870.tar.gz
blackbird-op-linux-401712e035c699d569dbd37024f4b21dc76cc870.zip
drm: rcar-du: Clip planes to screen boundaries
Unlike the KMS API, the hardware doesn't support planes exceeding the screen boundaries or planes being located fully off-screen. We need to clip plane coordinates to support the use case. Fortunately the DRM core offers a drm_atomic_helper_check_plane_state() helper that validates the scaling factor and clips the plane coordinates. Use it to implement the plane atomic check and use the clipped source and destination rectangles from the plane state instead of the unclipped source and CRTC coordinates to configure the device. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du/rcar_du_crtc.c')
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_crtc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index b492063a6e1f..5685d5af6998 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -319,7 +319,8 @@ static void rcar_du_crtc_update_planes(struct rcar_du_crtc *rcrtc)
struct rcar_du_plane *plane = &rcrtc->group->planes[i];
unsigned int j;
- if (plane->plane.state->crtc != &rcrtc->crtc)
+ if (plane->plane.state->crtc != &rcrtc->crtc ||
+ !plane->plane.state->visible)
continue;
/* Insert the plane in the sorted planes array. */
OpenPOWER on IntegriCloud