diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2017-08-15 18:45:21 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2017-12-04 13:04:11 +0200 |
commit | 9c893a61b79d38b8997cc417a6b359222cf92414 (patch) | |
tree | 1ca2b8bff67f6820adccfbf96c5bcd237414bef1 /drivers/gpu/drm/rcar-du/rcar_du_vsp.c | |
parent | dd286a531461748ff1b1b3f1d7255389a131ed27 (diff) | |
download | linux-stable-9c893a61b79d38b8997cc417a6b359222cf92414.tar.gz linux-stable-9c893a61b79d38b8997cc417a6b359222cf92414.tar.bz2 linux-stable-9c893a61b79d38b8997cc417a6b359222cf92414.zip |
drm: rcar-du: Share plane atomic check code between Gen2 and Gen3
The plane atomic check implementation is identical on Gen2 (DU planes)
and Gen3 (VSP planes), but two separate functions exist as they operate
on different data structures. Refactor the code to share the
implementation.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du/rcar_du_vsp.c')
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index 2c96147bc444..dd66dcb8da23 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c @@ -268,28 +268,8 @@ static int rcar_du_vsp_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) { struct rcar_du_vsp_plane_state *rstate = to_rcar_vsp_plane_state(state); - struct rcar_du_vsp_plane *rplane = to_rcar_vsp_plane(plane); - struct rcar_du_device *rcdu = rplane->vsp->dev; - - if (!state->fb || !state->crtc) { - rstate->format = NULL; - return 0; - } - if (state->src_w >> 16 != state->crtc_w || - state->src_h >> 16 != state->crtc_h) { - dev_dbg(rcdu->dev, "%s: scaling not supported\n", __func__); - return -EINVAL; - } - - rstate->format = rcar_du_format_info(state->fb->format->format); - if (rstate->format == NULL) { - dev_dbg(rcdu->dev, "%s: unsupported format %08x\n", __func__, - state->fb->format->format); - return -EINVAL; - } - - return 0; + return __rcar_du_plane_atomic_check(plane, state, &rstate->format); } static void rcar_du_vsp_plane_atomic_update(struct drm_plane *plane, |