dma-buf: Update docs for SYNC ioctl
authorDaniel Vetter <[email protected]>
Mon, 21 Mar 2016 07:24:22 +0000 (08:24 +0100)
committerDaniel Vetter <[email protected]>
Mon, 21 Mar 2016 08:26:45 +0000 (09:26 +0100)
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 <[email protected]>
Cc: Tiago Vignatti <[email protected]>
Cc: Stéphane Marchesin <[email protected]>
Cc: David Herrmann <[email protected]>
Cc: Sumit Semwal <[email protected]>
Cc: Daniel Vetter <[email protected]>
CC: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Hans Verkuil <[email protected]>
Acked-by: Sumit Semwal <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Documentation/dma-buf-sharing.txt
drivers/dma-buf/dma-buf.c

index 32ac32e773e116176a9f312815acbab1c0717105..ca44c58205858bdfc4115139c380f75a85ac1c3c 100644 (file)
@@ -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
 
index 774a60f4309a166cb0ad0baf50cd94b9cd2a03fc..4a2c07ee667773bf02b1ece356c60089ccffb867 100644 (file)
@@ -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)