public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	dri-devel@lists.freedesktop.org,
	Thomas Hellstrom <thellstrom@vmware.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Russell King <linux@armlinux.org.uk>,
	linux-renesas-soc@vger.kernel.org,
	Ben Skeggs <bskeggs@redhat.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Alexandru Gheorghe <Alexandru_Gheorghe@mentor.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH/RFC 1/4] drm: Add colorkey properties
Date: Tue, 19 Dec 2017 15:14:29 +0200	[thread overview]
Message-ID: <6363445.9viBvkM8do@avalon> (raw)
In-Reply-To: <774a29ec-fd51-7bc5-bcbb-ce0d49a76aa8@baylibre.com>

Hi Neil,

On Tuesday, 19 December 2017 11:00:28 EET Neil Armstrong wrote:
> On 17/12/2017 01:17, Laurent Pinchart wrote:
> > Color keying is the action of replacing pixels matching a given color
> > (or range of colors) with transparent pixels in an overlay when
> > performing blitting. Depending on the hardware capabilities, the
> > matching pixel can either become fully transparent, or gain a
> > programmable alpha value.
> > 
> > Color keying is found in a large number of devices whose capabilities
> > often differ, but they still have enough common features in range to
> > standardize color key properties. This commit adds four properties
> > related to color keying named colorkey.min, colorkey.max, colorkey.alpha
> > and colorkey.mode. Additional properties can be defined by drivers to
> > expose device-specific features.
> > 
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> > 
> >  drivers/gpu/drm/drm_atomic.c |  16 +++++++
> >  drivers/gpu/drm/drm_blend.c  | 108 ++++++++++++++++++++++++++++++++++++++
> >  include/drm/drm_blend.h      |   4 ++
> >  include/drm/drm_plane.h      |  28 ++++++++++-
> >  4 files changed, 155 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> > index 37445d50816a..4f57ec25e04d 100644
> > --- a/drivers/gpu/drm/drm_atomic.c
> > +++ b/drivers/gpu/drm/drm_atomic.c
> > @@ -756,6 +756,14 @@ static int drm_atomic_plane_set_property(struct

[snip]

> > +int drm_plane_create_colorkey_properties(struct drm_plane *plane,
> > +					 const struct drm_prop_enum_list *modes,
> > +					 unsigned int num_modes, bool replace)
> > +{
> > +#define CREATE_COLORKEY_PROP(plane, name, type, args...) ({		       \
> > +	prop = drm_property_create_##type(plane->dev, 0, "colorkey." #name,    
\
> > +					  args);			       \
> > +	if (prop) {							       \
> > +		drm_object_attach_property(&plane->base, prop, 0);	       \
> > +		plane->colorkey.name##_property = prop;			       \
> > +	}								       \
> > +	prop;								       \
> > +})
> > +
> > +	struct drm_property *prop;
> > +
> > +	/*
> > +	 * A minimum of two modes are required, with the first mode must named
> > +	 * "disabled".
> > +	 */
> > +	if (!modes || num_modes == 0 || strcmp(modes[0].name, "disabled"))
> > +		return -EINVAL;
> > +
> > +	prop = CREATE_COLORKEY_PROP(plane, mode, enum, modes, num_modes);
> > +	if (!prop)
> > +		return -ENOMEM;
> > +
> > +	prop = CREATE_COLORKEY_PROP(plane, min, range, 0, U64_MAX);
> > +	if (!prop)
> > +		return -ENOMEM;
> > +
> > +	prop = CREATE_COLORKEY_PROP(plane, max, range, 0, U64_MAX);
> > +	if (!prop)
> > +		return -ENOMEM;
> > +
> > +	if (replace) {
> > +		prop = CREATE_COLORKEY_PROP(plane, value, range, 0, U64_MAX);
> > +		if (!prop)
> > +			return -ENOMEM;
> > +	}
> 
> #undef CREATE_COLORKEY_PROP ?

That's a good idea, I'll fix it in the next version.

> > +
> > +	return 0;
> > +}
> > +EXPORT_SYMBOL(drm_plane_create_colorkey_properties);

[snip]

> Apart from that,
> 
> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2017-12-19 13:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-17  0:17 [PATCH/RFC 0/4] Implement standard color keying properties Laurent Pinchart
2017-12-17  0:17 ` [PATCH/RFC 1/4] drm: Add colorkey properties Laurent Pinchart
2017-12-19  9:00   ` Neil Armstrong
2017-12-19 13:14     ` Laurent Pinchart [this message]
2018-01-25 10:55   ` Maxime Ripard
2018-04-25 19:33   ` Dmitry Osipenko
2018-04-26 13:27   ` Ville Syrjälä
2017-12-17  0:17 ` [PATCH/RFC 2/4] drm: rcar-du: Use standard " Laurent Pinchart
2017-12-17  0:17 ` [PATCH/RFC 3/4] v4l: vsp1: Add support for colorkey alpha blending Laurent Pinchart
2017-12-17  0:17 ` [PATCH/RFC 4/4] drm: rcar-du: Add support for color keying on Gen3 Laurent Pinchart
2018-01-25 10:57   ` Maxime Ripard
2018-04-25 19:27 ` [PATCH/RFC 0/4] Implement standard color keying properties Dmitry Osipenko

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=6363445.9viBvkM8do@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=Alexandru_Gheorghe@mentor.com \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=narmstrong@baylibre.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=thellstrom@vmware.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