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 v2 11/13] drm: rcar-du: Add alpha support for VSP planes
Date: Tue, 26 Apr 2016 00:36:36 +0300	[thread overview]
Message-ID: <1461620198-13428-12-git-send-email-laurent.pinchart+renesas@ideasonboard.com> (raw)
In-Reply-To: <1461620198-13428-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

Make the global alpha multiplier of VSP planes configurable through the
alpha 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 | 38 +++++++++++++++++------------------
 1 file changed, 19 insertions(+), 19 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 de7ef041182b..8c89a6401542 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -148,40 +148,41 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
 	struct rcar_du_vsp_plane_state *state =
 		to_rcar_vsp_plane_state(plane->plane.state);
 	struct drm_framebuffer *fb = plane->plane.state->fb;
-	struct v4l2_rect src;
-	struct v4l2_rect dst;
-	dma_addr_t paddr[2] = { 0, };
-	u32 pixelformat = 0;
+	struct vsp1_du_atomic_config cfg = {
+		.pixelformat = 0,
+		.pitch = fb->pitches[0],
+		.alpha = state->alpha,
+		.zpos = 0,
+	};
 	unsigned int i;
 
-	src.left = state->state.src_x >> 16;
-	src.top = state->state.src_y >> 16;
-	src.width = state->state.src_w >> 16;
-	src.height = state->state.src_h >> 16;
+	cfg.src.left = state->state.src_x >> 16;
+	cfg.src.top = state->state.src_y >> 16;
+	cfg.src.width = state->state.src_w >> 16;
+	cfg.src.height = state->state.src_h >> 16;
 
-	dst.left = state->state.crtc_x;
-	dst.top = state->state.crtc_y;
-	dst.width = state->state.crtc_w;
-	dst.height = state->state.crtc_h;
+	cfg.dst.left = state->state.crtc_x;
+	cfg.dst.top = state->state.crtc_y;
+	cfg.dst.width = state->state.crtc_w;
+	cfg.dst.height = state->state.crtc_h;
 
 	for (i = 0; i < state->format->planes; ++i) {
 		struct drm_gem_cma_object *gem;
 
 		gem = drm_fb_cma_get_gem_obj(fb, i);
-		paddr[i] = gem->paddr + fb->offsets[i];
+		cfg.mem[i] = gem->paddr + fb->offsets[i];
 	}
 
 	for (i = 0; i < ARRAY_SIZE(formats_kms); ++i) {
 		if (formats_kms[i] == state->format->fourcc) {
-			pixelformat = formats_v4l2[i];
+			cfg.pixelformat = formats_v4l2[i];
 			break;
 		}
 	}
 
-	WARN_ON(!pixelformat);
+	WARN_ON(!cfg.pixelformat);
 
-	vsp1_du_atomic_update(plane->vsp->vsp, plane->index, pixelformat,
-			      fb->pitches[0], paddr, &src, &dst);
+	vsp1_du_atomic_update(plane->vsp->vsp, plane->index, &cfg);
 }
 
 static int rcar_du_vsp_plane_atomic_check(struct drm_plane *plane,
@@ -220,8 +221,7 @@ static void rcar_du_vsp_plane_atomic_update(struct drm_plane *plane,
 	if (plane->state->crtc)
 		rcar_du_vsp_plane_setup(rplane);
 	else
-		vsp1_du_atomic_update(rplane->vsp->vsp, rplane->index, 0, 0, 0,
-				      NULL, NULL);
+		vsp1_du_atomic_update(rplane->vsp->vsp, rplane->index, NULL);
 }
 
 static const struct drm_plane_helper_funcs rcar_du_vsp_plane_helper_funcs = {
-- 
2.7.3


  parent reply	other threads:[~2016-04-25 21:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 21:36 [PATCH v2 00/13] R-Car VSP improvements for v4.7 - Round 2 Laurent Pinchart
2016-04-25 21:36 ` [PATCH v2 01/13] dt-bindings: Add Renesas R-Car FCP DT bindings Laurent Pinchart
2016-04-28  2:54   ` Rob Herring
2016-04-28  6:36     ` Laurent Pinchart
2016-04-28  8:00       ` Geert Uytterhoeven
2016-04-28  8:00         ` Geert Uytterhoeven
     [not found]   ` <1461620198-13428-2-git-send-email-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2016-05-11 12:36     ` [PATCH v2.1] " Laurent Pinchart
2016-05-11 12:36       ` Laurent Pinchart
2016-05-11 12:38       ` Geert Uytterhoeven
2016-05-11 13:05       ` Rob Herring
2016-04-25 21:36 ` [PATCH v2 02/13] v4l: Add Renesas R-Car FCP driver Laurent Pinchart
2016-04-25 21:36 ` [PATCH v2 03/13] v4l: vsp1: Implement runtime PM support Laurent Pinchart
2016-04-25 21:36 ` [PATCH v2 04/13] v4l: vsp1: Don't handle clocks manually Laurent Pinchart
2016-04-25 21:36 ` [PATCH v2 05/13] v4l: vsp1: Add FCP support Laurent Pinchart
2016-06-17 11:07   ` Mauro Carvalho Chehab
2016-06-17 14:35     ` Laurent Pinchart
2016-04-25 21:36 ` [PATCH v2 06/13] v4l: vsp1: Add output node value to routing table Laurent Pinchart
2016-04-25 21:36 ` [PATCH v2 07/13] v4l: vsp1: Replace container_of() with dedicated macro Laurent Pinchart
2016-04-25 21:36 ` [PATCH v2 08/13] v4l: vsp1: Make vsp1_entity_get_pad_compose() more generic Laurent Pinchart
2016-04-26 18:09   ` Sergei Shtylyov
2016-04-27 15:26     ` Laurent Pinchart
2016-04-25 21:36 ` [PATCH v2 09/13] v4l: vsp1: Move frame sequence number from video node to pipeline Laurent Pinchart
2016-04-25 21:36 ` [PATCH v2 10/13] v4l: vsp1: Group DRM RPF parameters in a structure Laurent Pinchart
2016-04-25 21:36 ` Laurent Pinchart [this message]
2016-04-25 21:36 ` [PATCH v2 12/13] drm: rcar-du: Add Z-order support for VSP planes Laurent Pinchart
2016-04-25 21:36 ` [PATCH v2 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=1461620198-13428-12-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.