Lines Matching +full:non +full:- +full:negative
1 /* SPDX-License-Identifier: GPL-2.0-only */
8 * Many thanks to linaro-mm-sig list, and specially
16 #include <linux/iosys-map.h>
21 #include <linux/dma-mapping.h>
23 #include <linux/dma-fence.h>
31 * struct dma_buf_ops - operations possible on struct dma_buf
52 * device-specific carveout areas should check whether the buffer could
61 * Any exporter-private housekeeping data can be stored in the
68 * 0 on success, negative error code on failure. It might return -EBUSY
89 * DMA-buf can't be moved any more. Ideally, the exporter should
96 * This is called automatically for non-dynamic importers from
99 * Note that similar to non-dynamic exporters in their @map_dma_buf
107 * 0 on success, negative error code on failure.
115 * DMA-buf can be moved again.
117 * This is called with the dmabuf->resv object locked and is mutual
148 * available to buffer-users.
150 * This is always called with the dmabuf->resv object locked when
153 * Note that for non-dynamic exporters the driver must guarantee that
157 * Dynamic exporters do not need to follow this rule: For non-dynamic
169 * On failure, returns a negative error value wrapped into a pointer.
170 * May also return -EINTR when a signal was received while being
175 * DMA-BUF code (for non-dynamic importers) or the importer. Ownership
193 /* TODO: Add try_map_dma_buf version, to return immed with -EBUSY
225 * 0 on success or a negative error code on failure. This can for
227 * return -ERESTARTSYS or -EINTR when the call has been interrupted and
243 * 0 on success or a negative error code on failure. Can return
244 * -ERESTARTSYS or -EINTR when the call has been interrupted and needs
257 * Because dma-buf buffers have invariant size over their lifetime, the
258 * dma-buf core checks whether a vma is too large and rejects such
265 * address_space associated with the struct file stored in vma->vm_file
271 * association by setting vma->vm_file and adjusting vma->vm_pgoff in
282 * 0 on success or a negative error code on failure.
291 * struct dma_buf - shared buffer object
363 * Userspace-provided name; useful for accounting and debugging,
388 * Reservation object linked to this dma-buf.
396 * - Drivers must add a read fence through dma_resv_add_fence() with the
400 * - Similarly drivers must add a write fence through
404 * - Drivers may just always add a write fence, since that only
407 * - Some drivers only expose a synchronous userspace API with no
411 * - Driver should use dma_resv_usage_rw() when retrieving fences as
419 * - Dynamic importers must obey the write fences and wait for them to
423 * - Dynamic importers should set fences for any access that they can't
451 * `DMA-BUF statistics`_ for the uapi this enables.
461 * struct dma_buf_attach_ops - importer operations for an attachment
475 * @move_notify: [optional] notification that the DMA-buf is moving
486 * But the DMA-buf can now be in a different physical location, so all
487 * mappings should be destroyed and re-created as soon as possible.
490 * point to the new location of the DMA-buf.
496 * struct dma_buf_attachment - holds device-buffer attachment data
530 * struct dma_buf_export_info - holds information needed to export a dma_buf
531 * @exp_name: name of the exporter - useful for debugging.
532 * @owner: pointer to exporter module - used for refcounting kernel module
533 * @ops: Attach allocator-defined dma buf ops to the new buffer
534 * @size: Size of the buffer - invariant over the lifetime of the buffer
536 * @resv: reservation-object, NULL to allocate default one
553 * DEFINE_DMA_BUF_EXPORT_INFO - helper macro for exporters
554 * @name: export-info name
557 * zeroes it out and pre-populates exp_name in it.
564 * get_dma_buf - convenience wrapper for get_file.
567 * Increments the reference count on the dma-buf, needed in case of drivers
574 get_file(dmabuf->file); in get_dma_buf()
578 * dma_buf_is_dynamic - check if a DMA-buf uses dynamic mappings.
579 * @dmabuf: the DMA-buf to check
581 * Returns true if a DMA-buf exporter wants to be called with the dma_resv
587 return !!dmabuf->ops->pin; in dma_buf_is_dynamic()
591 * dma_buf_attachment_is_dynamic - check if a DMA-buf attachment uses dynamic
593 * @attach: the DMA-buf attachment to check
595 * Returns true if a DMA-buf importer wants to call the map/unmap functions with
601 return !!attach->importer_ops; in dma_buf_attachment_is_dynamic()