All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Courbot <acourbot@chromium.org>
To: Helen Koike <helen.koike@collabora.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Tomasz Figa <tfiga@chromium.org>,
	Hirokazu Honda <hiroh@chromium.org>,
	Nicolas Dufresne <nicolas@ndufresne.ca>,
	Brian Starkey <Brian.Starkey@arm.com>,
	kernel@collabora.com, narmstrong@baylibre.com,
	LKML <linux-kernel@vger.kernel.org>,
	frkoenig@chromium.org, Maxime Jourdan <mjourdan@baylibre.com>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>
Subject: Re: [PATCH v5 4/7] media: mediabus: Add helpers to convert a ext_pix format to/from a mbus_fmt
Date: Fri, 14 Aug 2020 16:49:46 +0900	[thread overview]
Message-ID: <CAPBb6MW4zbhfkrG0P8VA-xgMMt0Wt7+mo6SZRDekRKiS0Q1xhA@mail.gmail.com> (raw)
In-Reply-To: <20200804192939.2251988-5-helen.koike@collabora.com>

On Wed, Aug 5, 2020 at 4:32 AM Helen Koike <helen.koike@collabora.com> wrote:
>
> Just a new version of v4l2_fill_mbus_format() and v4l2_fill_ext_pix_format()
> to deal with the new v4l2_ext_pix_format struct.
> This is needed to convert the VIMC driver to the EXT_FMT/EXT_BUF iocts.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Signed-off-by: Helen Koike <helen.koike@collabora.com>
> ---
> Changes in v4:
> - Add helper v4l2_fill_ext_pix_format()
> - Rebased on top of media/master (post 5.8-rc1)
>
> Changes in v3:
> - Rebased on top of media/master (post 5.4-rc1)
>
> Changes in v2:
> - New patch
> ---
>  include/media/v4l2-mediabus.h | 42 +++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>
> diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
> index 45f88f0248c4e..8133407377f7d 100644
> --- a/include/media/v4l2-mediabus.h
> +++ b/include/media/v4l2-mediabus.h
> @@ -119,6 +119,26 @@ v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt,
>         pix_fmt->xfer_func = mbus_fmt->xfer_func;
>  }
>
> +/**
> + * v4l2_fill_ext_pix_format - Ancillary routine that fills a &struct

I feel the names of these functions are maybe too generic - maybe they
should carry the fact that the source is a mbus or ext_pix format?


> + *     v4l2_ext_pix_format fields from a &struct v4l2_mbus_framefmt.
> + *
> + * @pix_fmt:   pointer to &struct v4l2_ext_pix_format to be filled
> + * @mbus_fmt:  pointer to &struct v4l2_mbus_framefmt to be used as model
> + */
> +static inline void
> +v4l2_fill_ext_pix_format(struct v4l2_ext_pix_format *pix_fmt,
> +                    const struct v4l2_mbus_framefmt *mbus_fmt)
> +{
> +       pix_fmt->width = mbus_fmt->width;
> +       pix_fmt->height = mbus_fmt->height;
> +       pix_fmt->field = mbus_fmt->field;
> +       pix_fmt->colorspace = mbus_fmt->colorspace;
> +       pix_fmt->ycbcr_enc = mbus_fmt->ycbcr_enc;
> +       pix_fmt->quantization = mbus_fmt->quantization;
> +       pix_fmt->xfer_func = mbus_fmt->xfer_func;
> +}
> +
>  /**
>   * v4l2_fill_pix_format - Ancillary routine that fills a &struct
>   *     v4l2_mbus_framefmt from a &struct v4l2_pix_format and a
> @@ -182,4 +202,26 @@ v4l2_fill_mbus_format_mplane(struct v4l2_mbus_framefmt *mbus_fmt,
>         mbus_fmt->xfer_func = pix_mp_fmt->xfer_func;
>  }
>
> +/**
> + * v4l2_fill_mbus_format_ext - Ancillary routine that fills a &struct
> + *     v4l2_mbus_framefmt from a &struct v4l2_ext_pix_format.
> + *
> + * @mbus_fmt:  pointer to &struct v4l2_mbus_framefmt to be filled
> + * @pix_fmt:   pointer to &struct v4l2_ext_pix_format to be used as model
> + * @code:      data format code (from &enum v4l2_mbus_pixelcode)
> + */
> +static inline void
> +v4l2_fill_mbus_format_ext(struct v4l2_mbus_framefmt *mbus_fmt,
> +                         const struct v4l2_ext_pix_format *pix_fmt, u32 code)
> +{
> +       mbus_fmt->width = pix_fmt->width;
> +       mbus_fmt->height = pix_fmt->height;
> +       mbus_fmt->field = pix_fmt->field;
> +       mbus_fmt->colorspace = pix_fmt->colorspace;
> +       mbus_fmt->ycbcr_enc = pix_fmt->ycbcr_enc;
> +       mbus_fmt->quantization = pix_fmt->quantization;
> +       mbus_fmt->xfer_func = pix_fmt->xfer_func;
> +       mbus_fmt->code = code;
> +}
> +
>  #endif
> --
> 2.28.0.rc2
>

  reply	other threads:[~2020-08-14  7:50 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 19:29 [PATCH v5 0/7] media: v4l2: Add extended fmt and buffer ioctls Helen Koike
2020-08-04 19:29 ` [PATCH v5 1/7] media: v4l2: Extend pixel formats to unify single/multi-planar handling (and more) Helen Koike
2020-08-14  7:49   ` Alexandre Courbot
2020-11-19 16:23     ` Helen Koike
2020-09-09 11:41   ` Hans Verkuil
2020-09-14  2:14     ` Helen Koike
2020-10-02 19:49   ` Tomasz Figa
2020-11-14 14:21     ` Helen Koike
2020-11-19  5:45       ` Tomasz Figa
2020-11-19 10:08         ` Helen Koike
2020-11-19 13:43           ` Helen Koike
2020-12-14 10:19             ` Tomasz Figa
2020-08-04 19:29 ` [PATCH v5 2/7] media: v4l2: Add extended buffer operations Helen Koike
2020-08-06 19:45   ` kernel test robot
2020-08-06 19:45     ` kernel test robot
2020-08-06 20:30   ` kernel test robot
2020-08-06 20:30     ` kernel test robot
2020-08-14  7:49   ` Alexandre Courbot
2020-09-09 12:27   ` Hans Verkuil
2020-11-23 15:08     ` Helen Koike
2020-11-23 15:46       ` Tomasz Figa
2020-11-23 17:40         ` Helen Koike
2020-12-03 15:11           ` Hans Verkuil
2020-12-03 19:52             ` Helen Koike
2020-12-14 10:46               ` Tomasz Figa
2020-12-15 14:36                 ` Helen Koike
2020-12-16  3:13                   ` Tomasz Figa
2020-12-17 13:19                     ` Helen Koike
2020-12-21  3:13                       ` Tomasz Figa
2020-12-23 12:04                         ` Helen Koike
2021-01-08 10:00                           ` Tomasz Figa
2020-12-14 10:38             ` Tomasz Figa
2020-11-20 11:14   ` Tomasz Figa
2020-11-23 20:33     ` Helen Koike
2020-12-14 10:36       ` Tomasz Figa
2020-12-14 13:23         ` Helen Koike
2020-12-15  9:03           ` Tomasz Figa
2020-08-04 19:29 ` [PATCH v5 3/7] media: videobuf2: Expose helpers to implement the _ext_fmt and _ext_buf hooks Helen Koike
2020-12-14  8:52   ` Tomasz Figa
2020-12-14 12:29     ` Helen Koike
2020-08-04 19:29 ` [PATCH v5 4/7] media: mediabus: Add helpers to convert a ext_pix format to/from a mbus_fmt Helen Koike
2020-08-14  7:49   ` Alexandre Courbot [this message]
2020-08-04 19:29 ` [PATCH v5 5/7] media: vivid: Convert the capture and output drivers to EXT_FMT/EXT_BUF Helen Koike
2020-08-04 19:29 ` [PATCH v5 6/7] media: vimc: Implement the ext_fmt and ext_buf hooks Helen Koike
2020-08-04 19:29 ` [PATCH v5 7/7] media: docs: add documentation for the Extended API Helen Koike
2020-08-14  7:49   ` Alexandre Courbot
2020-11-19 10:28   ` Helen Koike
2020-11-20 11:06   ` Tomasz Figa
2020-11-20 12:24     ` Hans Verkuil
2020-11-20 12:40       ` Tomasz Figa
2020-11-20 13:20         ` Hans Verkuil
2021-01-14 18:04           ` Helen Koike
2020-08-04 19:34 ` [PATCH v5 0/7] media: v4l2: Add extended fmt and buffer ioctls Helen Koike
2020-08-14  7:49 ` Alexandre Courbot
2020-11-27 15:06 ` Helen Koike

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=CAPBb6MW4zbhfkrG0P8VA-xgMMt0Wt7+mo6SZRDekRKiS0Q1xhA@mail.gmail.com \
    --to=acourbot@chromium.org \
    --cc=Brian.Starkey@arm.com \
    --cc=boris.brezillon@collabora.com \
    --cc=frkoenig@chromium.org \
    --cc=hans.verkuil@cisco.com \
    --cc=helen.koike@collabora.com \
    --cc=hiroh@chromium.org \
    --cc=kernel@collabora.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mjourdan@baylibre.com \
    --cc=narmstrong@baylibre.com \
    --cc=nicolas@ndufresne.ca \
    --cc=sakari.ailus@iki.fi \
    --cc=stanimir.varbanov@linaro.org \
    --cc=tfiga@chromium.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.