All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 12/13] drm: rcar-du: Add Z-order support for VSP planes
Date: Sun, 24 Apr 2016 02:49:59 +0300	[thread overview]
Message-ID: <1461455400-28767-13-git-send-email-laurent.pinchart+renesas@ideasonboard.com> (raw)
In-Reply-To: <1461455400-28767-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

Make the Z-order of VSP planes configurable through the zpos property,
exactly as for the native DU planes.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 11 ++++++++---
 drivers/gpu/drm/rcar-du/rcar_du_vsp.h |  2 ++
 2 files changed, 10 insertions(+), 3 deletions(-)

Cc: dri-devel@lists.freedesktop.org

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
index 8c89a6401542..4927fb3b8554 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -152,7 +152,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
 		.pixelformat = 0,
 		.pitch = fb->pitches[0],
 		.alpha = state->alpha,
-		.zpos = 0,
+		.zpos = state->zpos,
 	};
 	unsigned int i;
 
@@ -180,8 +180,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
 		}
 	}
 
-	WARN_ON(!cfg.pixelformat);
-
 	vsp1_du_atomic_update(plane->vsp->vsp, plane->index, &cfg);
 }
 
@@ -269,6 +267,7 @@ static void rcar_du_vsp_plane_reset(struct drm_plane *plane)
 		return;
 
 	state->alpha = 255;
+	state->zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1;
 
 	plane->state = &state->state;
 	plane->state->plane = plane;
@@ -283,6 +282,8 @@ static int rcar_du_vsp_plane_atomic_set_property(struct drm_plane *plane,
 
 	if (property == rcdu->props.alpha)
 		rstate->alpha = val;
+	else if (property == rcdu->props.zpos)
+		rstate->zpos = val;
 	else
 		return -EINVAL;
 
@@ -299,6 +300,8 @@ static int rcar_du_vsp_plane_atomic_get_property(struct drm_plane *plane,
 
 	if (property == rcdu->props.alpha)
 		*val = rstate->alpha;
+	else if (property == rcdu->props.zpos)
+		*val = rstate->zpos;
 	else
 		return -EINVAL;
 
@@ -378,6 +381,8 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp)
 
 		drm_object_attach_property(&plane->plane.base,
 					   rcdu->props.alpha, 255);
+		drm_object_attach_property(&plane->plane.base,
+					   rcdu->props.zpos, 1);
 	}
 
 	return 0;
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.h b/drivers/gpu/drm/rcar-du/rcar_du_vsp.h
index df3bf3805c69..510dcc9c6816 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.h
@@ -44,6 +44,7 @@ static inline struct rcar_du_vsp_plane *to_rcar_vsp_plane(struct drm_plane *p)
  * @state: base DRM plane state
  * @format: information about the pixel format used by the plane
  * @alpha: value of the plane alpha property
+ * @zpos: value of the plane zpos property
  */
 struct rcar_du_vsp_plane_state {
 	struct drm_plane_state state;
@@ -51,6 +52,7 @@ struct rcar_du_vsp_plane_state {
 	const struct rcar_du_format_info *format;
 
 	unsigned int alpha;
+	unsigned int zpos;
 };
 
 static inline struct rcar_du_vsp_plane_state *
-- 
2.7.3


  parent reply	other threads:[~2016-04-23 23:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-23 23:49 [PATCH 00/13] R-Car VSP improvements for v4.7 - Round 2 Laurent Pinchart
2016-04-23 23:49 ` Laurent Pinchart
2016-04-23 23:49 ` [PATCH 01/13] dt-bindings: Add Renesas R-Car FCP DT bindings Laurent Pinchart
     [not found]   ` <1461455400-28767-2-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2016-04-25  7:32     ` Geert Uytterhoeven
2016-04-25  7:32       ` Geert Uytterhoeven
2016-04-25 13:27       ` Laurent Pinchart
2016-04-23 23:49 ` [PATCH 02/13] v4l: Add Renesas R-Car FCP driver Laurent Pinchart
2016-04-25  7:37   ` Geert Uytterhoeven
2016-04-25 14:00     ` Laurent Pinchart
2016-04-23 23:49 ` [PATCH 03/13] v4l: vsp1: Implement runtime PM support Laurent Pinchart
2016-04-25  8:24   ` Geert Uytterhoeven
2016-04-25 13:33     ` Laurent Pinchart
2016-04-23 23:49 ` [PATCH 04/13] v4l: vsp1: Don't handle clocks manually Laurent Pinchart
2016-04-23 23:49 ` [PATCH 05/13] v4l: vsp1: Add FCP support Laurent Pinchart
2016-04-23 23:49 ` [PATCH 06/13] v4l: vsp1: Add output node value to routing table Laurent Pinchart
2016-04-23 23:49 ` [PATCH 07/13] v4l: vsp1: Replace container_of() with dedicated macro Laurent Pinchart
2016-04-23 23:49 ` [PATCH 08/13] v4l: vsp1: Make vsp1_entity_get_pad_compose() more generic Laurent Pinchart
2016-04-23 23:49 ` [PATCH 09/13] v4l: vsp1: Move frame sequence number from video node to pipeline Laurent Pinchart
2016-04-23 23:49 ` [PATCH 10/13] v4l: vsp1: Group DRM RPF parameters in a structure Laurent Pinchart
2016-04-23 23:49 ` [PATCH 11/13] drm: rcar-du: Add alpha support for VSP planes Laurent Pinchart
2016-04-23 23:49   ` Laurent Pinchart
2016-04-23 23:49 ` Laurent Pinchart [this message]
2016-04-23 23:50 ` [PATCH 13/13] v4l: vsp1: Remove deprecated DRM API Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461455400-28767-13-git-send-email-laurent.pinchart+renesas@ideasonboard.com \
    --to=laurent.pinchart+renesas@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.