From 34a04f2b7baaa980fcb9eff9cbfb28a947c67f74 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 21 Jun 2013 17:54:50 +0200 Subject: drm: rcar-du: Add VSP1 compositor support Configure the plane source at plane setup time to source frames from memory or from the VSP1. Signed-off-by: Laurent Pinchart --- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/drm/rcar-du/rcar_du_kms.c') diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 2106b29..a69d607 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -217,17 +217,25 @@ static void rcar_du_output_poll_changed(struct drm_device *dev) */ static bool rcar_du_plane_needs_realloc(struct rcar_du_plane *plane, - struct rcar_du_plane_state *state) + struct rcar_du_plane_state *new_state) { - const struct rcar_du_format_info *cur_format; + struct rcar_du_plane_state *cur_state; - cur_format = to_rcar_plane_state(plane->plane.state)->format; + cur_state = to_rcar_plane_state(plane->plane.state); /* Lowering the number of planes doesn't strictly require reallocation * as the extra hardware plane will be freed when committing, but doing * so could lead to more fragmentation. */ - return !cur_format || cur_format->planes != state->format->planes; + if (!cur_state->format || + cur_state->format->planes != new_state->format->planes) + return true; + + /* Reallocate hardware planes if the source has changed. */ + if (cur_state->source != new_state->source) + return true; + + return false; } static unsigned int rcar_du_plane_hwmask(struct rcar_du_plane_state *state) -- cgit v1.1