|
XenevaOS
|
#include <dma-buf.h>

Classes | |
| struct | dma_buf_poll_cb_t |
Public Attributes | |
| size_t | size |
| struct file * | file |
| struct list_head | attachments |
| const struct dma_buf_ops * | ops |
| unsigned | vmapping_counter |
| struct iosys_map | vmap_ptr |
| const char * | exp_name |
: | |
Userspace-provided name. Default value is NULL. If not NULL, length cannot be longer than DMA_BUF_NAME_LEN, including NIL char. Useful for accounting and debugging. Read/Write accesses are protected by @name_lock See the IOCTLs DMA_BUF_SET_NAME or DMA_BUF_SET_NAME_A/B | |
| const char * | name |
| spinlock_t | name_lock |
| struct module * | owner |
| struct list_head | list_node |
| void * | priv |
| struct dma_resv * | resv |
| wait_queue_head_t | poll |
| struct dma_buf::dma_buf_poll_cb_t | cb_in |
| struct dma_buf::dma_buf_poll_cb_t | cb_out |
struct dma_buf - shared buffer object
This represents a shared buffer, created by calling dma_buf_export(). The userspace representation is a normal file descriptor, which can be created by calling dma_buf_fd().
Shared dma buffers are reference counted using dma_buf_put() and get_dma_buf().
Device DMA access is handled by the separate &struct dma_buf_attachment.
| struct list_head dma_buf::attachments |
@attachments:
List of dma_buf_attachment that denotes all devices attached, protected by &dma_resv lock @resv.
| struct dma_buf::dma_buf_poll_cb_t dma_buf::cb_in |
| struct dma_buf::dma_buf_poll_cb_t dma_buf::cb_out |
| const char* dma_buf::exp_name |
@exp_name:
Name of the exporter; useful for debugging. Must not be NULL
| struct file* dma_buf::file |
| const char* dma_buf::name |
| spinlock_t dma_buf::name_lock |
@name_lock: Spinlock to protect name access for read access.
| const struct dma_buf_ops* dma_buf::ops |
@ops: dma_buf_ops associated with this buffer object.
| struct module* dma_buf::owner |
@owner:
Pointer to exporter module; used for refcounting when exporter is a kernel module.
| wait_queue_head_t dma_buf::poll |
@poll: for userspace poll support
| void* dma_buf::priv |
@priv: exporter specific private data for this buffer object.
| struct dma_resv* dma_buf::resv |
@resv:
Reservation object linked to this dma-buf.
IMPLICIT SYNCHRONIZATION RULES:
Drivers which support implicit synchronization of buffer access as e.g. exposed in Implicit Fence Poll Support_ must follow the below rules.
DYNAMIC IMPORTER RULES:
Dynamic importers, see dma_buf_attachment_is_dynamic(), have additional constraints on how they set up fences:
IMPORTANT:
All drivers and memory management related functions must obey the struct dma_resv rules, specifically the rules for updating and obeying fences. See enum dma_resv_usage for further descriptions.
| size_t dma_buf::size |
@size:
Size of the buffer; invariant over the lifetime of the buffer.
| struct iosys_map dma_buf::vmap_ptr |
@vmap_ptr: The current vmap ptr if @vmapping_counter > 0. Protected by @resv.
| unsigned dma_buf::vmapping_counter |
@vmapping_counter:
Used internally to refcnt the vmaps returned by dma_buf_vmap(). Protected by @resv.