All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
	DRI Development <dri-devel@lists.freedesktop.org>
Cc: "Chris Wilson" <chris@chris-wilson.co.uk>,
	"Tiago Vignatti" <tiago.vignatti@intel.com>,
	"Stéphane Marchesin" <marcheu@chromium.org>,
	"David Herrmann" <dh.herrmann@gmail.com>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Daniel Vetter" <daniel.vetter@intel.com>,
	linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	intel-gfx@lists.freedesktop.org, devel@driverdev.osuosl.org
Subject: Re: [PATCH] dma-buf: Update docs for SYNC ioctl
Date: Mon, 21 Mar 2016 08:53:18 +0100	[thread overview]
Message-ID: <56EFA86E.5030602@xs4all.nl> (raw)
In-Reply-To: <1458546705-3564-1-git-send-email-daniel.vetter@ffwll.ch>

On 03/21/2016 08:51 AM, Daniel Vetter wrote:
> Just a bit of wording polish plus mentioning that it can fail and must
> be restarted.
> 
> Requested by Sumit.
> 
> v2: Fix them typos (Hans).
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tiago Vignatti <tiago.vignatti@intel.com>
> Cc: Stéphane Marchesin <marcheu@chromium.org>
> Cc: David Herrmann <dh.herrmann@gmail.com>
> Cc: Sumit Semwal <sumit.semwal@linaro.org>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> CC: linux-media@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linaro-mm-sig@lists.linaro.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: devel@driverdev.osuosl.org
> Cc: Hans Verkuil <hverkuil@xs4all.nl>
> Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  Documentation/dma-buf-sharing.txt | 11 ++++++-----
>  drivers/dma-buf/dma-buf.c         |  2 +-
>  2 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/dma-buf-sharing.txt b/Documentation/dma-buf-sharing.txt
> index 32ac32e773e1..ca44c5820585 100644
> --- a/Documentation/dma-buf-sharing.txt
> +++ b/Documentation/dma-buf-sharing.txt
> @@ -352,7 +352,8 @@ Being able to mmap an export dma-buf buffer object has 2 main use-cases:
>  
>     No special interfaces, userspace simply calls mmap on the dma-buf fd, making
>     sure that the cache synchronization ioctl (DMA_BUF_IOCTL_SYNC) is *always*
> -   used when the access happens. This is discussed next paragraphs.
> +   used when the access happens. Note that DMA_BUF_IOCTL_SYNC can fail with
> +   -EAGAIN or -EINTR, in which case it must be restarted.
>  
>     Some systems might need some sort of cache coherency management e.g. when
>     CPU and GPU domains are being accessed through dma-buf at the same time. To
> @@ -366,10 +367,10 @@ Being able to mmap an export dma-buf buffer object has 2 main use-cases:
>         want (with the new data being consumed by the GPU or say scanout device)
>       - munmap once you don't need the buffer any more
>  
> -    Therefore, for correctness and optimal performance, systems with the memory
> -    cache shared by the GPU and CPU i.e. the "coherent" and also the
> -    "incoherent" are always required to use SYNC_START and SYNC_END before and
> -    after, respectively, when accessing the mapped address.
> +    For correctness and optimal performance, it is always required to use
> +    SYNC_START and SYNC_END before and after, respectively, when accessing the
> +    mapped address. Userspace cannot rely on coherent access, even when there
> +    are systems where it just works without calling these ioctls.
>  
>  2. Supporting existing mmap interfaces in importers
>  
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index 774a60f4309a..4a2c07ee6677 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -612,7 +612,7 @@ EXPORT_SYMBOL_GPL(dma_buf_begin_cpu_access);
>   * @dmabuf:	[in]	buffer to complete cpu access for.
>   * @direction:	[in]	length of range for cpu access.
>   *
> - * This call must always succeed.
> + * Can return negative error values, returns 0 on success.
>   */
>  int dma_buf_end_cpu_access(struct dma_buf *dmabuf,
>  			   enum dma_data_direction direction)
> 

Much better :-)

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

  reply	other threads:[~2016-03-21  7:53 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 20:02 [PATCH] dma-buf,drm,ion: Propagate error code from dma_buf_start_cpu_access() Chris Wilson
2016-03-19 10:09 ` [PATCH] dma-buf, drm, ion: " Daniel Vetter
2016-03-19 10:09   ` Daniel Vetter
2016-03-21  6:13   ` Sumit Semwal
2016-03-21  7:30     ` [PATCH] dma-buf: Update docs for SYNC ioctl Daniel Vetter
2016-03-21  7:35       ` Sumit Semwal
2016-03-21  7:40       ` Hans Verkuil
2016-03-21  7:50         ` Daniel Vetter
2016-03-21  7:50           ` Daniel Vetter
2016-03-21  7:51     ` Daniel Vetter
2016-03-21  7:53       ` Hans Verkuil [this message]
2016-03-21 12:26       ` David Herrmann
2016-03-21 12:26         ` David Herrmann
2016-03-21 17:14         ` Daniel Vetter
2016-03-21 17:14           ` Daniel Vetter
2016-03-23 11:30           ` David Herrmann
2016-03-23 11:56             ` Chris Wilson
2016-03-23 11:56               ` Chris Wilson
2016-03-23 15:32               ` David Herrmann
2016-03-23 15:42                 ` Chris Wilson
2016-03-23 15:42                   ` Chris Wilson
2016-03-28 19:42                   ` Tiago Vignatti
2016-03-29  9:47                     ` David Herrmann
2016-03-29  9:47                       ` David Herrmann
2016-03-29 17:20                       ` Tiago Vignatti
2016-03-21 13:16       ` Tiago Vignatti
2016-03-21 13:16         ` Tiago Vignatti
2016-03-21 13:13 ` [PATCH] dma-buf,drm,ion: Propagate error code from dma_buf_start_cpu_access() Tiago Vignatti

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=56EFA86E.5030602@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dh.herrmann@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-media@vger.kernel.org \
    --cc=marcheu@chromium.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tiago.vignatti@intel.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 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.