Lines Matching refs:buffer

9 buffer sharing API, how to use it for exporting and using shared buffers.
11 Any device driver which wishes to be a part of DMA buffer sharing, can do so as
15 exporter, and A as buffer-user.
18 - implements and manages operations[1] for the buffer
19 - allows other users to share the buffer by using dma_buf sharing APIs,
20 - manages the details of buffer allocation,
23 buffer,
25 The buffer-user
26 - is one of (many) sharing users of the buffer.
27 - doesn't need to worry about how the buffer is allocated, or where.
28 - needs a mechanism to get access to the scatterlist that makes up this buffer
35 The dma_buf buffer sharing API usage contains the following steps:
37 1. Exporter announces that it wishes to export a buffer
38 2. Userspace gets the file descriptor associated with the exported buffer, and
39 passes it around to potential buffer-users based on use case
40 3. Each buffer-user 'connects' itself to the buffer
41 4. When needed, buffer-user requests access to the buffer from exporter
42 5. When finished with its use, the buffer-user notifies end-of-DMA to exporter
43 6. when buffer-user is done using this buffer completely, it 'disconnects'
44 itself from the buffer.
47 1. Exporter's announcement of buffer export
49 The buffer exporter announces its wish to export a buffer. In this, it
50 connects its own private buffer data, provides implementation for operations
52 associated with this buffer. All these fields are filled in struct
61 buffer, so it can be exported. On failure to allocate the dma_buf object,
73 2. Userspace gets a handle to pass around to potential buffer-users
76 anonymous file associated with the buffer. It can then share the fd with other
82 This API installs an fd for the anonymous file associated with this buffer;
85 3. Each buffer-user 'connects' itself to the buffer
87 Each buffer-user now gets a reference to the buffer, using the fd passed to
96 After this, the buffer-user needs to attach its device with the buffer, which
97 helps the exporter to know of device buffer constraints.
108 the list of all attachments to a buffer.
110 Until this stage, the buffer-exporter has the option to choose not to actually
111 allocate the backing storage for this buffer, but wait for the first buffer-user
112 to request use of buffer for allocation.
115 4. When needed, buffer-user requests access to the buffer
117 Whenever a buffer-user wants to use the buffer for any DMA, it asks for
118 access to the buffer using dma_buf_map_attachment API. At least one attach to
119 the buffer must have happened before map_dma_buf can be called.
132 It is one of the buffer operations that must be implemented by the exporter.
133 It should return the sg_table containing scatterlist for this buffer, mapped
137 scan through the list of attachments for this buffer, collate the requirements
139 buffer.
143 that the exporter might wish to make available to buffer-users.
148 5. When finished, the buffer-user notifies end-of-DMA to exporter
150 Once the DMA for the current buffer-user is over, it signals 'end-of-DMA' to
169 6. when buffer-user is done using this buffer, it 'disconnects' itself from the
170 buffer.
172 After the buffer-user has no more interest in using this buffer, it should
173 disconnect itself from the buffer:
175 - it first detaches itself from the buffer.
184 - Then, the buffer-user returns the buffer reference to exporter.
189 This API then reduces the refcount for this buffer.
209 - and the backing storage has been allocated for this buffer,
210 another new buffer-user intends to attach itself to this buffer, it might
214 if the new buffer-user has stricter 'backing-storage constraints', and the
218 Once all users have finished accessing and have unmapped this buffer, the
219 exporter could potentially move the buffer to the stricter backing-storage,
220 and then allow further {map,unmap}_dma_buf operations from any buffer-user
224 buffer-user device as requested, dma_buf_attach() would return an error to
225 denote non-compatibility of the new buffer-sharing request with the current
226 buffer.
231 Kernel cpu access to a dma-buf buffer object
274 2. Accessing the buffer
339 Being able to mmap an export dma-buf buffer object has 2 main use-cases:
347 the need to handle this specially in userspace frameworks for buffer sharing
362 with a imported dma-buf buffer object as with a native buffer object. This is
365 mmap a buffer rather invasive.
407 buffer and hence should not be handled by dma-buf itself. This is explicitly
409 different exporters handle this differently, buffer sharing can fail in
428 - Any exporters or users of the dma-buf buffer sharing framework must have