diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-12-09 16:50:55 -0500 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2016-12-13 07:24:28 -0500 |
commit | e7e21c72b178e963f3c990cb839d86f568999916 (patch) | |
tree | 80698d8bc3a5c3952e498ca0ef3e764c6ccff3c9 /drivers/dma-buf | |
parent | 0959a1683d78270bab6381d498707fb8655ae11c (diff) |
dma-buf: Final bits of doc polish
- Put all the remaing bits of the old doc into suitable places in the
new sphinx world.
- Also document the poll support, we forgot to do that.
- Delete dma-buf-sharing.txt.
v2: Don't forget to update MAINTAINERS.
Cc: linux-doc@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20161209215055.3492-1-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/dma-buf')
-rw-r--r-- | drivers/dma-buf/dma-buf.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index eae0846cbd95..91aff74ed092 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c | |||
@@ -124,6 +124,28 @@ static loff_t dma_buf_llseek(struct file *file, loff_t offset, int whence) | |||
124 | return base + offset; | 124 | return base + offset; |
125 | } | 125 | } |
126 | 126 | ||
127 | /** | ||
128 | * DOC: fence polling | ||
129 | * | ||
130 | * To support cross-device and cross-driver synchronization of buffer access | ||
131 | * implicit fences (represented internally in the kernel with struct &fence) can | ||
132 | * be attached to a &dma_buf. The glue for that and a few related things are | ||
133 | * provided in the &reservation_object structure. | ||
134 | * | ||
135 | * Userspace can query the state of these implicitly tracked fences using poll() | ||
136 | * and related system calls: | ||
137 | * | ||
138 | * - Checking for POLLIN, i.e. read access, can be use to query the state of the | ||
139 | * most recent write or exclusive fence. | ||
140 | * | ||
141 | * - Checking for POLLOUT, i.e. write access, can be used to query the state of | ||
142 | * all attached fences, shared and exclusive ones. | ||
143 | * | ||
144 | * Note that this only signals the completion of the respective fences, i.e. the | ||
145 | * DMA transfers are complete. Cache flushing and any other necessary | ||
146 | * preparations before CPU access can begin still need to happen. | ||
147 | */ | ||
148 | |||
127 | static void dma_buf_poll_cb(struct dma_fence *fence, struct dma_fence_cb *cb) | 149 | static void dma_buf_poll_cb(struct dma_fence *fence, struct dma_fence_cb *cb) |
128 | { | 150 | { |
129 | struct dma_buf_poll_cb_t *dcb = (struct dma_buf_poll_cb_t *)cb; | 151 | struct dma_buf_poll_cb_t *dcb = (struct dma_buf_poll_cb_t *)cb; |