All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	linux-media@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Subject: Re: [PATCH v2 04/23] v4l: Add premultiplied alpha flag for pixel formats
Date: Fri, 27 Jun 2014 12:39:00 +0000	[thread overview]
Message-ID: <53AD65E4.4000809@xs4all.nl> (raw)
In-Reply-To: <1403567669-18539-5-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

Hi Laurent,

A small comment below:

On 06/24/2014 01:54 AM, Laurent Pinchart wrote:
> When set, the new V4L2_PIX_FMT_FLAG_PREMUL_ALPHA flag indicates that the
> pixel values are premultiplied by the alpha channel value.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>   Documentation/DocBook/media/v4l/pixfmt.xml | 28 +++++++++++++++++++++++++++-
>   Documentation/DocBook/media/v4l/v4l2.xml   |  2 +-
>   drivers/media/v4l2-core/v4l2-ioctl.c       |  5 +++--
>   include/uapi/linux/videodev2.h             |  8 +++++++-
>   4 files changed, 38 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
> index 8c56cacd..c8e1487 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt.xml
> @@ -135,6 +135,12 @@ extended fields were set to zero. On return drivers must set the
>   <constant>V4L2_PIX_FMT_PRIV_MAGIC</constant> and all the extended field to
>   applicable values.</para></entry>
>   	</row>
> +	<row>
> +	  <entry>__u32</entry>
> +	  <entry><structfield>flags</structfield></entry>
> +	    <entry>Flags set by the application or driver, see <xref
> +linkend="format-flags" />.</entry>
> +	</row>
>         </tbody>
>       </tgroup>
>     </table>
> @@ -220,9 +226,15 @@ codes can be used.</entry>
>             and the number of valid entries in the
>             <structfield>plane_fmt</structfield> array.</entry>
>           </row>
> +	<row>
> +	  <entry>__u8</entry>
> +	  <entry><structfield>flags</structfield></entry>
> +	  <entry>Flags set by the application or driver, see <xref
> +linkend="format-flags" />.</entry>
> +	</row>
>           <row>
>             <entry>__u8</entry>
> -          <entry><structfield>reserved[11]</structfield></entry>
> +          <entry><structfield>reserved[10]</structfield></entry>
>             <entry>Reserved for future extensions. Should be zeroed by the
>              application.</entry>
>           </row>
> @@ -1079,4 +1091,18 @@ concatenated to form the JPEG stream. </para>
>   	</tbody>
>         </tgroup>
>       </table>
> +
> +    <table frame="none" pgwide="1" id="format-flags">
> +      <title>Format Flags</title>
> +      <tgroup cols="3">
> +	&cs-def;
> +	<tbody valign="top">
> +	  <row>
> +	    <entry><constant>V4L2_PIX_FMT_FLAG_PREMUL_ALPHA</constant></entry>
> +	    <entry>0x00000001</entry>
> +	    <entry>The pixel values are premultiplied by the alpha channel value.</entry>

It would be helpful if you would give a small example here.

Regards,

	Hans

> +	  </row>
> +	</tbody>
> +      </tgroup>
> +    </table>
>     </section>
> diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml
> index d0a48be..f2f81f0 100644
> --- a/Documentation/DocBook/media/v4l/v4l2.xml
> +++ b/Documentation/DocBook/media/v4l/v4l2.xml
> @@ -155,7 +155,7 @@ applications. -->
>   	<revnumber>3.16</revnumber>
>   	<date>2014-05-27</date>
>   	<authorinitials>lp</authorinitials>
> -	<revremark>Extended &v4l2-pix-format;.
> +	<revremark>Extended &v4l2-pix-format;. Added format flags.
>   	</revremark>
>         </revision>
>
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 01b4588..5a25159 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -256,7 +256,8 @@ static void v4l_print_format(const void *arg, bool write_only)
>   		pix = &p->fmt.pix;
>   		pr_cont(", width=%u, height=%u, "
>   			"pixelformat=%c%c%c%c, field=%s, "
> -			"bytesperline=%u, sizeimage=%u, colorspace=%d\n",
> +			"bytesperline=%u, sizeimage=%u, colorspace=%d, "
> +			"flags %u\n",
>   			pix->width, pix->height,
>   			(pix->pixelformat & 0xff),
>   			(pix->pixelformat >>  8) & 0xff,
> @@ -264,7 +265,7 @@ static void v4l_print_format(const void *arg, bool write_only)
>   			(pix->pixelformat >> 24) & 0xff,
>   			prt_names(pix->field, v4l2_field_names),
>   			pix->bytesperline, pix->sizeimage,
> -			pix->colorspace);
> +			pix->colorspace, pix->flags);
>   		break;
>   	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>   	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 2656a94..7861b50 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -288,6 +288,7 @@ struct v4l2_pix_format {
>   	__u32          		sizeimage;
>   	__u32			colorspace;	/* enum v4l2_colorspace */
>   	__u32			priv;		/* private data, depends on pixelformat */
> +	__u32			flags;		/* format flags (V4L2_PIX_FMT_FLAG_*) */
>   };
>
>   /*      Pixel format         FOURCC                          depth  Description  */
> @@ -452,6 +453,9 @@ struct v4l2_pix_format {
>   /* priv field value to indicates that subsequent fields are valid. */
>   #define V4L2_PIX_FMT_PRIV_MAGIC		0xdeadbeef
>
> +/* Flags */
> +#define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA	0x00000001
> +
>   /*
>    *	F O R M A T   E N U M E R A T I O N
>    */
> @@ -1726,6 +1730,7 @@ struct v4l2_plane_pix_format {
>    * @colorspace:		enum v4l2_colorspace; supplemental to pixelformat
>    * @plane_fmt:		per-plane information
>    * @num_planes:		number of planes for this format
> + * @flags:		format flags (V4L2_PIX_FMT_FLAG_*)
>    */
>   struct v4l2_pix_format_mplane {
>   	__u32				width;
> @@ -1736,7 +1741,8 @@ struct v4l2_pix_format_mplane {
>
>   	struct v4l2_plane_pix_format	plane_fmt[VIDEO_MAX_PLANES];
>   	__u8				num_planes;
> -	__u8				reserved[11];
> +	__u8				flags;
> +	__u8				reserved[10];
>   } __attribute__ ((packed));
>
>   /**
>

WARNING: multiple messages have this Message-ID (diff)
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	linux-media@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Subject: Re: [PATCH v2 04/23] v4l: Add premultiplied alpha flag for pixel formats
Date: Fri, 27 Jun 2014 14:39:00 +0200	[thread overview]
Message-ID: <53AD65E4.4000809@xs4all.nl> (raw)
In-Reply-To: <1403567669-18539-5-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

Hi Laurent,

A small comment below:

On 06/24/2014 01:54 AM, Laurent Pinchart wrote:
> When set, the new V4L2_PIX_FMT_FLAG_PREMUL_ALPHA flag indicates that the
> pixel values are premultiplied by the alpha channel value.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>   Documentation/DocBook/media/v4l/pixfmt.xml | 28 +++++++++++++++++++++++++++-
>   Documentation/DocBook/media/v4l/v4l2.xml   |  2 +-
>   drivers/media/v4l2-core/v4l2-ioctl.c       |  5 +++--
>   include/uapi/linux/videodev2.h             |  8 +++++++-
>   4 files changed, 38 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
> index 8c56cacd..c8e1487 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt.xml
> @@ -135,6 +135,12 @@ extended fields were set to zero. On return drivers must set the
>   <constant>V4L2_PIX_FMT_PRIV_MAGIC</constant> and all the extended field to
>   applicable values.</para></entry>
>   	</row>
> +	<row>
> +	  <entry>__u32</entry>
> +	  <entry><structfield>flags</structfield></entry>
> +	    <entry>Flags set by the application or driver, see <xref
> +linkend="format-flags" />.</entry>
> +	</row>
>         </tbody>
>       </tgroup>
>     </table>
> @@ -220,9 +226,15 @@ codes can be used.</entry>
>             and the number of valid entries in the
>             <structfield>plane_fmt</structfield> array.</entry>
>           </row>
> +	<row>
> +	  <entry>__u8</entry>
> +	  <entry><structfield>flags</structfield></entry>
> +	  <entry>Flags set by the application or driver, see <xref
> +linkend="format-flags" />.</entry>
> +	</row>
>           <row>
>             <entry>__u8</entry>
> -          <entry><structfield>reserved[11]</structfield></entry>
> +          <entry><structfield>reserved[10]</structfield></entry>
>             <entry>Reserved for future extensions. Should be zeroed by the
>              application.</entry>
>           </row>
> @@ -1079,4 +1091,18 @@ concatenated to form the JPEG stream. </para>
>   	</tbody>
>         </tgroup>
>       </table>
> +
> +    <table frame="none" pgwide="1" id="format-flags">
> +      <title>Format Flags</title>
> +      <tgroup cols="3">
> +	&cs-def;
> +	<tbody valign="top">
> +	  <row>
> +	    <entry><constant>V4L2_PIX_FMT_FLAG_PREMUL_ALPHA</constant></entry>
> +	    <entry>0x00000001</entry>
> +	    <entry>The pixel values are premultiplied by the alpha channel value.</entry>

It would be helpful if you would give a small example here.

Regards,

	Hans

> +	  </row>
> +	</tbody>
> +      </tgroup>
> +    </table>
>     </section>
> diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml
> index d0a48be..f2f81f0 100644
> --- a/Documentation/DocBook/media/v4l/v4l2.xml
> +++ b/Documentation/DocBook/media/v4l/v4l2.xml
> @@ -155,7 +155,7 @@ applications. -->
>   	<revnumber>3.16</revnumber>
>   	<date>2014-05-27</date>
>   	<authorinitials>lp</authorinitials>
> -	<revremark>Extended &v4l2-pix-format;.
> +	<revremark>Extended &v4l2-pix-format;. Added format flags.
>   	</revremark>
>         </revision>
>
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 01b4588..5a25159 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -256,7 +256,8 @@ static void v4l_print_format(const void *arg, bool write_only)
>   		pix = &p->fmt.pix;
>   		pr_cont(", width=%u, height=%u, "
>   			"pixelformat=%c%c%c%c, field=%s, "
> -			"bytesperline=%u, sizeimage=%u, colorspace=%d\n",
> +			"bytesperline=%u, sizeimage=%u, colorspace=%d, "
> +			"flags %u\n",
>   			pix->width, pix->height,
>   			(pix->pixelformat & 0xff),
>   			(pix->pixelformat >>  8) & 0xff,
> @@ -264,7 +265,7 @@ static void v4l_print_format(const void *arg, bool write_only)
>   			(pix->pixelformat >> 24) & 0xff,
>   			prt_names(pix->field, v4l2_field_names),
>   			pix->bytesperline, pix->sizeimage,
> -			pix->colorspace);
> +			pix->colorspace, pix->flags);
>   		break;
>   	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>   	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 2656a94..7861b50 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -288,6 +288,7 @@ struct v4l2_pix_format {
>   	__u32          		sizeimage;
>   	__u32			colorspace;	/* enum v4l2_colorspace */
>   	__u32			priv;		/* private data, depends on pixelformat */
> +	__u32			flags;		/* format flags (V4L2_PIX_FMT_FLAG_*) */
>   };
>
>   /*      Pixel format         FOURCC                          depth  Description  */
> @@ -452,6 +453,9 @@ struct v4l2_pix_format {
>   /* priv field value to indicates that subsequent fields are valid. */
>   #define V4L2_PIX_FMT_PRIV_MAGIC		0xdeadbeef
>
> +/* Flags */
> +#define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA	0x00000001
> +
>   /*
>    *	F O R M A T   E N U M E R A T I O N
>    */
> @@ -1726,6 +1730,7 @@ struct v4l2_plane_pix_format {
>    * @colorspace:		enum v4l2_colorspace; supplemental to pixelformat
>    * @plane_fmt:		per-plane information
>    * @num_planes:		number of planes for this format
> + * @flags:		format flags (V4L2_PIX_FMT_FLAG_*)
>    */
>   struct v4l2_pix_format_mplane {
>   	__u32				width;
> @@ -1736,7 +1741,8 @@ struct v4l2_pix_format_mplane {
>
>   	struct v4l2_plane_pix_format	plane_fmt[VIDEO_MAX_PLANES];
>   	__u8				num_planes;
> -	__u8				reserved[11];
> +	__u8				flags;
> +	__u8				reserved[10];
>   } __attribute__ ((packed));
>
>   /**
>

  reply	other threads:[~2014-06-27 12:39 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23 23:54 [PATCH v2 00/23] Renesas VSP1: alpha support and miscellaneous fixes Laurent Pinchart
2014-06-23 23:54 ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 01/23] v4l: Add ARGB and XRGB pixel formats Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-27  9:34   ` Hans Verkuil
2014-06-27  9:34     ` Hans Verkuil
2014-07-17 21:53   ` Hans Verkuil
2014-07-17 21:53     ` Hans Verkuil
2014-07-18 12:31     ` Laurent Pinchart
2014-07-18 12:31       ` Laurent Pinchart
2014-07-18 13:14       ` Hans Verkuil
2014-07-18 13:14         ` Hans Verkuil
2014-07-18 13:21         ` Hans Verkuil
2014-07-18 13:21           ` Hans Verkuil
2014-06-23 23:54 ` [PATCH v2 02/23] DocBook: media: Document ALPHA_COMPONENT control usage on output devices Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-27  9:34   ` Hans Verkuil
2014-06-27  9:34     ` Hans Verkuil
2014-06-23 23:54 ` [PATCH v2 03/23] v4l: Support extending the v4l2_pix_format structure Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-27 12:36   ` Hans Verkuil
2014-06-27 12:36     ` Hans Verkuil
2014-06-29 20:41     ` Laurent Pinchart
2014-06-29 20:41       ` Laurent Pinchart
2014-07-17 21:04   ` Hans Verkuil
2014-07-17 21:04     ` Hans Verkuil
2014-07-21 20:56     ` Laurent Pinchart
2014-07-21 20:56       ` Laurent Pinchart
2014-07-21 22:17       ` Hans Verkuil
2014-07-21 22:17         ` Hans Verkuil
2014-07-17 21:22   ` Hans Verkuil
2014-07-17 21:22     ` Hans Verkuil
2014-07-18  5:10     ` Hans Verkuil
2014-07-18  5:10       ` Hans Verkuil
2014-07-18 12:27       ` Laurent Pinchart
2014-07-18 12:27         ` Laurent Pinchart
2014-07-18 13:12         ` Hans Verkuil
2014-07-18 13:12           ` Hans Verkuil
2014-06-23 23:54 ` [PATCH v2 04/23] v4l: Add premultiplied alpha flag for pixel formats Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-27 12:39   ` Hans Verkuil [this message]
2014-06-27 12:39     ` Hans Verkuil
2014-06-23 23:54 ` [PATCH v2 05/23] v4l: vb2: Fix stream start and buffer completion race Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-24 10:25   ` Hans Verkuil
2014-06-24 10:25     ` Hans Verkuil
2014-06-23 23:54 ` [PATCH v2 06/23] v4l: vsp1: Fix routing cleanup when stopping the stream Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 07/23] v4l: vsp1: Release buffers at stream stop Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-24 12:00   ` Sergei Shtylyov
2014-06-24 12:00     ` Sergei Shtylyov
2014-07-01  7:16     ` Laurent Pinchart
2014-07-01  7:16       ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 08/23] v4l: vsp1: Fix pipeline stop timeout Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 09/23] v4l: vsp1: Fix typos Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 10/23] v4l: vsp1: Cleanup video nodes at removal time Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 11/23] v4l: vsp1: Propagate vsp1_device_get errors to the callers Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 12/23] v4l: vsp1: Setup control handler automatically at stream on time Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 13/23] v4l: vsp1: sru: Fix the intensity control default value Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 14/23] v4l: vsp1: sru: Make the intensity controllable during streaming Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 15/23] v4l: vsp1: wpf: Simplify cast to pipeline structure Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 16/23] v4l: vsp1: wpf: Clear RPF to WPF association at stream off time Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 17/23] v4l: vsp1: Switch to XRGB formats Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 18/23] v4l: vsp1: Add alpha channel support to the memory ports Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 19/23] v4l: vsp1: Add V4L2_CID_ALPHA_COMPONENT control support Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 20/23] v4l: vsp1: bru: Support premultiplied alpha at the BRU inputs Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 21/23] v4l: vsp1: bru: Support non-premultiplied colors at the BRU output Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 22/23] v4l: vsp1: bru: Make the background color configurable Laurent Pinchart
2014-06-23 23:54   ` Laurent Pinchart
2014-06-23 23:54 ` [PATCH v2 23/23] v4l: vsp1: uds: Fix scaling of alpha layer Laurent Pinchart
2014-06-23 23:54   ` 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=53AD65E4.4000809@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-sh@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.