From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Alexandru Gheorghe <Alexandru_Gheorghe@mentor.com>
Cc: <laurent.pinchart@ideasonboard.com>,
<linux-renesas-soc@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>, <linux-media@vger.kernel.org>,
<geert@linux-m68k.org>, <sergei.shtylyov@cogentembedded.com>
Subject: Re: [PATCH v2 1/2] v4l: vsp1: Add support for colorkey alpha blending
Date: Wed, 7 Jun 2017 13:56:54 -0300 [thread overview]
Message-ID: <20170607135654.067f4dda@vento.lan> (raw)
In-Reply-To: <1494152007-30094-2-git-send-email-Alexandru_Gheorghe@mentor.com>
Em Sun, 7 May 2017 13:13:26 +0300
Alexandru Gheorghe <Alexandru_Gheorghe@mentor.com> escreveu:
> The vsp2 hw supports changing of the alpha of pixels that match a color
> key, this patch adds support for this feature in order to be used by
> the rcar-du driver.
> The colorkey is interpreted different depending of the pixel format:
> * RGB - all color components have to match.
> * YCbCr - only the Y component has to match.
>
> Signed-off-by: Alexandru Gheorghe <Alexandru_Gheorghe@mentor.com>
As most of the changes on this series are for DRM, from my side,
feel free to merge this via DRM tree.
Acked-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> ---
> drivers/media/platform/vsp1/vsp1_drm.c | 3 +++
> drivers/media/platform/vsp1/vsp1_rpf.c | 10 ++++++++--
> drivers/media/platform/vsp1/vsp1_rwpf.h | 3 +++
> include/media/vsp1.h | 3 +++
> 4 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
> index 3627f08..a4d0aee 100644
> --- a/drivers/media/platform/vsp1/vsp1_drm.c
> +++ b/drivers/media/platform/vsp1/vsp1_drm.c
> @@ -393,6 +393,9 @@ int vsp1_du_atomic_update(struct device *dev, unsigned int rpf_index,
> else
> rpf->format.plane_fmt[1].bytesperline = cfg->pitch;
> rpf->alpha = cfg->alpha;
> + rpf->colorkey = cfg->colorkey;
> + rpf->colorkey_en = cfg->colorkey_en;
> + rpf->colorkey_alpha = cfg->colorkey_alpha;
> rpf->interlaced = cfg->interlaced;
>
> if (soc_device_match(r8a7795es1) && rpf->interlaced) {
> diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c b/drivers/media/platform/vsp1/vsp1_rpf.c
> index a12d6f9..91f2a9f 100644
> --- a/drivers/media/platform/vsp1/vsp1_rpf.c
> +++ b/drivers/media/platform/vsp1/vsp1_rpf.c
> @@ -356,8 +356,14 @@ static void rpf_configure(struct vsp1_entity *entity,
> }
>
> vsp1_rpf_write(rpf, dl, VI6_RPF_MSK_CTRL, 0);
> - vsp1_rpf_write(rpf, dl, VI6_RPF_CKEY_CTRL, 0);
> -
> + if (rpf->colorkey_en) {
> + vsp1_rpf_write(rpf, dl, VI6_RPF_CKEY_SET0,
> + (rpf->colorkey_alpha << 24) | rpf->colorkey);
> + vsp1_rpf_write(rpf, dl, VI6_RPF_CKEY_CTRL,
> + VI6_RPF_CKEY_CTRL_SAPE0);
> + } else {
> + vsp1_rpf_write(rpf, dl, VI6_RPF_CKEY_CTRL, 0);
> + }
> }
>
> static const struct vsp1_entity_operations rpf_entity_ops = {
> diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.h b/drivers/media/platform/vsp1/vsp1_rwpf.h
> index fbe6aa6..2d7f4b9 100644
> --- a/drivers/media/platform/vsp1/vsp1_rwpf.h
> +++ b/drivers/media/platform/vsp1/vsp1_rwpf.h
> @@ -51,6 +51,9 @@ struct vsp1_rwpf {
> unsigned int brs_input;
>
> unsigned int alpha;
> + u32 colorkey;
> + bool colorkey_en;
> + u32 colorkey_alpha;
>
> u32 mult_alpha;
> u32 outfmt;
> diff --git a/include/media/vsp1.h b/include/media/vsp1.h
> index 97265f7..65e3934 100644
> --- a/include/media/vsp1.h
> +++ b/include/media/vsp1.h
> @@ -32,6 +32,9 @@ struct vsp1_du_atomic_config {
> struct v4l2_rect dst;
> unsigned int alpha;
> unsigned int zpos;
> + u32 colorkey;
> + u32 colorkey_alpha;
> + bool colorkey_en;
> bool interlaced;
> };
>
Thanks,
Mauro
next prev parent reply other threads:[~2017-06-07 16:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-07 10:13 [PATCH v2 0/2] rcar-du, vsp1: rcar-gen3: Add support for colorkey alpha blending Alexandru Gheorghe
2017-05-07 10:13 ` [PATCH v2 1/2] v4l: vsp1: " Alexandru Gheorghe
2017-06-07 16:56 ` Mauro Carvalho Chehab [this message]
2017-05-07 10:13 ` [PATCH v2 2/2] drm: rcar-du: " Alexandru Gheorghe
2017-05-08 16:33 ` [PATCH v2 0/2] rcar-du, vsp1: rcar-gen3: " Eric Anholt
2017-05-08 18:29 ` Daniel Vetter
2017-05-09 7:12 ` Gheorghe, Alexandru
2017-11-27 11:12 ` 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=20170607135654.067f4dda@vento.lan \
--to=mchehab@s-opensource.com \
--cc=Alexandru_Gheorghe@mentor.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox