drm: rcar-du: Clip planes to screen boundaries
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 15 Aug 2017 15:52:04 +0000 (18:52 +0300)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Mon, 4 Dec 2017 16:38:31 +0000 (18:38 +0200)
commit401712e035c699d569dbd37024f4b21dc76cc870
treee7c934c91b19b7f89ad107199513f298b16edb7e
parent9c893a61b79d38b8997cc417a6b359222cf92414
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>
drivers/gpu/drm/rcar-du/rcar_du_crtc.c
drivers/gpu/drm/rcar-du/rcar_du_plane.c
drivers/gpu/drm/rcar-du/rcar_du_vsp.c