linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <tfiga@chromium.org>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Hans Verkuil <hans.verkuil@cisco.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Pawel Osciak <posciak@chromium.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCHv2 03/12] videobuf2: add V4L2_FLAG_MEMORY_NON_CONSISTENT flag
Date: Thu, 13 Feb 2020 16:08:09 +0900	[thread overview]
Message-ID: <CAAFQd5B3NbUO9dD9GjeCE5BCD9d74XLdqoSF5K45hWKLHwJHMA@mail.gmail.com> (raw)
In-Reply-To: <20200204025641.218376-4-senozhatsky@chromium.org>

On Tue, Feb 4, 2020 at 11:57 AM Sergey Senozhatsky
<senozhatsky@chromium.org> wrote:
>
> By setting or clearing V4L2_FLAG_MEMORY_NON_CONSISTENT flag
> user-space should be able to set or clear queue's NON_CONSISTENT
> ->dma_attrs. Queue's ->dma_attrs are passed to the underlying
> allocator in __vb2_buf_mem_alloc(), so thus user-space is able
> to request vb2 buffer's memory to be either consistent (coherent)
> or non-consistent.
>
> Change-Id: Ib333081c482e23c9a89386078293e19c3fd59076
> Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
> ---
>  Documentation/media/uapi/v4l/buffer.rst | 27 +++++++++++++++++++++++++
>  include/uapi/linux/videodev2.h          |  2 ++
>  2 files changed, 29 insertions(+)
>
> diff --git a/Documentation/media/uapi/v4l/buffer.rst b/Documentation/media/uapi/v4l/buffer.rst
> index 9149b57728e5..af007daf0591 100644
> --- a/Documentation/media/uapi/v4l/buffer.rst
> +++ b/Documentation/media/uapi/v4l/buffer.rst
> @@ -705,6 +705,33 @@ Buffer Flags
>
>  .. c:type:: v4l2_memory
>
> +Memory Consistency Flags
> +========================
> +
> +.. tabularcolumns:: |p{7.0cm}|p{2.2cm}|p{8.3cm}|
> +
> +.. cssclass:: longtable
> +
> +.. flat-table::
> +    :header-rows:  0
> +    :stub-columns: 0
> +    :widths:       3 1 4
> +
> +    * .. _`V4L2_FLAG_MEMORY_NON_CONSISTENT`:
> +
> +      - ``V4L2_FLAG_MEMORY_NON_CONSISTENT``
> +      - 0x00000001
> +      - vb2 buffer is allocated either in consistent (it will be automatically
> +       coherent between CPU and bus) or non-consistent memory. The latter
> +       can provide performance gains, for instance CPU cache sync/flush
> +       operations can be avoided if the buffer is accesed by the corresponding
> +       device only and CPU does not read/write to/from that buffer. However,
> +       this requires extra care from the driver -- it must guarantee memory
> +       consistency by issuing cache flush/sync when consistency is needed.
> +       If this flag is set V4L2 will attempt to allocate vb2 buffer in
> +       non-consistent memory. This flag is ignored if queue does not report
> +        :ret:`V4L2_BUF_CAP_SUPPORTS_CACHE_HINTS` capability.

nit: Should the patch adding the capability flag precede this one?

> +
>  enum v4l2_memory
>  ================
>
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 5f9357dcb060..72efc1c544cd 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -189,6 +189,8 @@ enum v4l2_memory {
>         V4L2_MEMORY_DMABUF           = 4,
>  };
>
> +#define V4L2_FLAG_MEMORY_NON_CONSISTENT                (1 << 0)
> +
>  /* see also http://vektor.theorem.ca/graphics/ycbcr/ */
>  enum v4l2_colorspace {
>         /*
> --
> 2.25.0.341.g760bfbb309-goog
>

  reply	other threads:[~2020-02-13  7:08 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04  2:56 [RFC][PATCHv2 00/12] Implement V4L2_BUF_FLAG_NO_CACHE_* flags Sergey Senozhatsky
2020-02-04  2:56 ` [RFC][PATCHv2 01/12] videobuf2: add cache management members Sergey Senozhatsky
2020-02-19  8:05   ` Hans Verkuil
2020-02-19  8:16     ` Sergey Senozhatsky
2020-02-19  8:27       ` Hans Verkuil
2020-02-04  2:56 ` [RFC][PATCHv2 02/12] videobuf2: handle V4L2 buffer cache flags Sergey Senozhatsky
2020-02-05  8:13   ` Sergey Senozhatsky
2020-02-19  8:07   ` Hans Verkuil
2020-02-19  8:13     ` Sergey Senozhatsky
2020-02-19  8:25       ` Hans Verkuil
2020-02-19  8:46   ` Hans Verkuil
2020-02-04  2:56 ` [RFC][PATCHv2 03/12] videobuf2: add V4L2_FLAG_MEMORY_NON_CONSISTENT flag Sergey Senozhatsky
2020-02-13  7:08   ` Tomasz Figa [this message]
2020-02-19  8:19   ` Hans Verkuil
2020-02-19  8:56   ` Hans Verkuil
2020-02-25  7:45     ` Sergey Senozhatsky
2020-02-04  2:56 ` [RFC][PATCHv2 04/12] videobuf2: add queue memory consistency parameter Sergey Senozhatsky
2020-02-04  2:56 ` [RFC][PATCHv2 05/12] videobuf2: handle V4L2_FLAG_MEMORY_NON_CONSISTENT flag Sergey Senozhatsky
2020-02-19  8:25   ` Hans Verkuil
2020-02-19  8:59     ` Sergey Senozhatsky
2020-02-19  9:04       ` Hans Verkuil
2020-02-19  8:48   ` Hans Verkuil
2020-02-19  9:05     ` Sergey Senozhatsky
2020-02-19  9:11       ` Hans Verkuil
2020-02-04  2:56 ` [RFC][PATCHv2 06/12] videobuf2: factor out planes prepare/finish functions Sergey Senozhatsky
2020-02-04  2:56 ` [RFC][PATCHv2 07/12] videobuf2: do not sync caches when we are allowed not to Sergey Senozhatsky
2020-02-04  2:56 ` [RFC][PATCHv2 08/12] videobuf2: check ->synced flag in prepare() and finish() Sergey Senozhatsky
2020-02-04  2:56 ` [RFC][PATCHv2 09/12] videobuf2: let user-space know if driver supports cache hints Sergey Senozhatsky
2020-02-19  8:33   ` Hans Verkuil
2020-02-19  8:45     ` Sergey Senozhatsky
2020-02-19  8:56       ` Hans Verkuil
2020-02-04  2:56 ` [RFC][PATCHv2 10/12] videobuf2: add begin/end cpu_access callbacks to dma-contig Sergey Senozhatsky
2020-02-04  2:56 ` [RFC][PATCHv2 11/12] videobuf2: add begin/end cpu_access callbacks to dma-sg Sergey Senozhatsky
2020-02-19  8:35   ` Hans Verkuil
2020-02-19  8:42     ` Sergey Senozhatsky
2020-02-04  2:56 ` [RFC][PATCHv2 12/12] videobuf2: don't test db_attach in dma-contig prepare and finish Sergey Senozhatsky
2020-02-19  8:53 ` [RFC][PATCHv2 00/12] Implement V4L2_BUF_FLAG_NO_CACHE_* flags Hans Verkuil
2020-02-26 11:20   ` Sergey Senozhatsky

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=CAAFQd5B3NbUO9dD9GjeCE5BCD9d74XLdqoSF5K45hWKLHwJHMA@mail.gmail.com \
    --to=tfiga@chromium.org \
    --cc=hans.verkuil@cisco.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=posciak@chromium.org \
    --cc=sakari.ailus@iki.fi \
    --cc=senozhatsky@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).