summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/rcar-du/rcar_du_kms.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-06-21 19:54:50 +0400
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2016-02-20 03:58:54 +0300
commit34a04f2b7baaa980fcb9eff9cbfb28a947c67f74 (patch)
tree0e5e38842768ff4edd6937f687abda7bcddf02da /drivers/gpu/drm/rcar-du/rcar_du_kms.c
parentaf8ad96290598561acb310d6a94b0e25ef383d12 (diff)
downloadlinux-34a04f2b7baaa980fcb9eff9cbfb28a947c67f74.tar.xz
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 <laurent.pinchart+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du/rcar_du_kms.c')
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_kms.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
index 2106b29664ef..a69d6075ceae 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)