|
XenevaOS
|
#include <xe_drm.h>

Public Attributes | ||
| __u64 | extensions | |
| __u32 | vm_id | |
| __u32 | exec_queue_id | |
| __u32 | pad | |
| __u32 | num_binds | |
| union { | ||
| struct drm_xe_vm_bind_op bind | ||
| __u64 vector_of_binds | ||
| }; | ||
| __u32 | pad2 | |
| __u32 | num_syncs | |
| __u64 | syncs | |
| __u64 | reserved [2] | |
struct drm_xe_vm_bind - Input of &DRM_IOCTL_XE_VM_BIND
Below is an example of a minimal use of &struct drm_xe_vm_bind to asynchronously bind the buffer data at address BIND_ADDRESS to illustrate userptr. It can be synchronized by using the example provided for &struct drm_xe_sync.
.. code-block:: C
data = aligned_alloc(ALIGNMENT, BO_SIZE);
struct drm_xe_vm_bind bind = {
.vm_id = vm,
.num_binds = 1,
.bind.obj = 0,
.bind.obj_offset = to_user_pointer(data),
.bind.range = BO_SIZE,
.bind.addr = BIND_ADDRESS,
.bind.op = DRM_XE_VM_BIND_OP_MAP_USERPTR,
.bind.flags = 0,
.num_syncs = 1,
.syncs = &sync,
.exec_queue_id = 0,
};
ioctl(fd, DRM_IOCTL_XE_VM_BIND, &bind);
| union { ... } drm_xe_vm_bind |
| struct drm_xe_vm_bind_op drm_xe_vm_bind::bind |
@bind: used if num_binds == 1
| __u32 drm_xe_vm_bind::exec_queue_id |
@exec_queue_id: exec_queue_id, must be of class DRM_XE_ENGINE_CLASS_VM_BIND and exec queue must have same vm_id. If zero, the default VM bind engine is used.
| __u64 drm_xe_vm_bind::extensions |
@extensions: Pointer to the first extension struct, if any
| __u32 drm_xe_vm_bind::num_binds |
@num_binds: number of binds in this IOCTL
| __u32 drm_xe_vm_bind::num_syncs |
@num_syncs: amount of syncs to wait on
| __u32 drm_xe_vm_bind::pad |
@pad: MBZ
| __u32 drm_xe_vm_bind::pad2 |
@pad2: MBZ
| __u64 drm_xe_vm_bind::reserved[2] |
@reserved: Reserved
| __u64 drm_xe_vm_bind::syncs |
@syncs: pointer to struct drm_xe_sync array
| __u64 drm_xe_vm_bind::vector_of_binds |
@vector_of_binds: userptr to array of struct drm_xe_vm_bind_op if num_binds > 1
| __u32 drm_xe_vm_bind::vm_id |
@vm_id: The ID of the VM to bind to