lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 14 Aug 2020 16:49:46 +0900
From:   Alexandre Courbot <acourbot@...omium.org>
To:     Helen Koike <helen.koike@...labora.com>
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Hans Verkuil <hans.verkuil@...co.com>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Sakari Ailus <sakari.ailus@....fi>,
        Linux Media Mailing List <linux-media@...r.kernel.org>,
        Boris Brezillon <boris.brezillon@...labora.com>,
        Tomasz Figa <tfiga@...omium.org>,
        Hirokazu Honda <hiroh@...omium.org>,
        Nicolas Dufresne <nicolas@...fresne.ca>,
        Brian Starkey <Brian.Starkey@....com>, kernel@...labora.com,
        narmstrong@...libre.com, LKML <linux-kernel@...r.kernel.org>,
        frkoenig@...omium.org, Maxime Jourdan <mjourdan@...libre.com>,
        Stanimir Varbanov <stanimir.varbanov@...aro.org>
Subject: Re: [PATCH v5 4/7] media: mediabus: Add helpers to convert a ext_pix
 format to/from a mbus_fmt

On Wed, Aug 5, 2020 at 4:32 AM Helen Koike <helen.koike@...labora.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@...labora.com>
> Signed-off-by: Helen Koike <helen.koike@...labora.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
>

Powered by blists - more mailing lists