diff options
| -rw-r--r-- | Documentation/dma-buf-sharing.txt | 11 | ||||
| -rw-r--r-- | 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: | |||
| 352 | 352 | ||
| 353 | No special interfaces, userspace simply calls mmap on the dma-buf fd, making | 353 | No special interfaces, userspace simply calls mmap on the dma-buf fd, making |
| 354 | sure that the cache synchronization ioctl (DMA_BUF_IOCTL_SYNC) is *always* | 354 | sure that the cache synchronization ioctl (DMA_BUF_IOCTL_SYNC) is *always* |
| 355 | used when the access happens. This is discussed next paragraphs. | 355 | used when the access happens. Note that DMA_BUF_IOCTL_SYNC can fail with |
| 356 | -EAGAIN or -EINTR, in which case it must be restarted. | ||
| 356 | 357 | ||
| 357 | Some systems might need some sort of cache coherency management e.g. when | 358 | Some systems might need some sort of cache coherency management e.g. when |
| 358 | CPU and GPU domains are being accessed through dma-buf at the same time. To | 359 | 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: | |||
| 366 | want (with the new data being consumed by the GPU or say scanout device) | 367 | want (with the new data being consumed by the GPU or say scanout device) |
| 367 | - munmap once you don't need the buffer any more | 368 | - munmap once you don't need the buffer any more |
| 368 | 369 | ||
| 369 | Therefore, for correctness and optimal performance, systems with the memory | 370 | For correctness and optimal performance, it is always required to use |
| 370 | cache shared by the GPU and CPU i.e. the "coherent" and also the | 371 | SYNC_START and SYNC_END before and after, respectively, when accessing the |
| 371 | "incoherent" are always required to use SYNC_START and SYNC_END before and | 372 | mapped address. Userspace cannot rely on coherent access, even when there |
| 372 | after, respectively, when accessing the mapped address. | 373 | are systems where it just works without calling these ioctls. |
| 373 | 374 | ||
| 374 | 2. Supporting existing mmap interfaces in importers | 375 | 2. Supporting existing mmap interfaces in importers |
| 375 | 376 | ||
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); | |||
| 612 | * @dmabuf: [in] buffer to complete cpu access for. | 612 | * @dmabuf: [in] buffer to complete cpu access for. |
| 613 | * @direction: [in] length of range for cpu access. | 613 | * @direction: [in] length of range for cpu access. |
| 614 | * | 614 | * |
| 615 | * This call must always succeed. | 615 | * Can return negative error values, returns 0 on success. |
| 616 | */ | 616 | */ |
| 617 | int dma_buf_end_cpu_access(struct dma_buf *dmabuf, | 617 | int dma_buf_end_cpu_access(struct dma_buf *dmabuf, |
| 618 | enum dma_data_direction direction) | 618 | enum dma_data_direction direction) |
