STRUCT DRM_XE_VM_BIND(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct drm_xe_vm_bind(9)

okay so bestie, welcome to the Kernel API Manual β€” specifically the page for struct drm_xe_vm_bind, which is literally the input of &DRM_IOCTL_XE_VM_BIND. no cap, this is the glow-up struct that tells the kernel how to bind stuff into a VM. ✨


✨ SYNOPSIS ✨

struct drm_xe_vm_bind {
    __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];
 };

🫢 Members 🫢

  • extensions β€” pointer to the first extension struct, if any. yes bestie, the extension chain, if you've got one πŸ’«
  • vm_id β€” the ID of the VM to bind to. the actual destination, main character energy only 🌸
  • exec_queue_id β€” this one's picky: it must be of class DRM_XE_ENGINE_CLASS_VM_BIND, and the exec queue must have the same vm_id. If it's zero, the default VM bind engine is used instead. so like, zero = "you pick for me", iconic πŸŽ€
  • pad β€” MBZ. that's "must be zero", don't be quirky with it πŸ™ˆ
  • num_binds β€” how many binds are in this IOCTL. the count, the vibe check of quantity πŸ”₯
  • {unnamed_union} β€” anonymous. she has no name but she has range πŸ’…
  • bind β€” used if num_binds == 1. the one-at-a-time path ⭐
  • vector_of_binds β€” userptr to an array of struct drm_xe_vm_bind_op, used if num_binds > 1. the whole-groupchat path 🌈
  • pad2 β€” MBZ again. second verse, same as the first, zero it 😭
  • num_syncs β€” amount of syncs to wait on. how many syncs we're waiting on, literally ⏳
  • syncs β€” pointer to a struct drm_xe_sync array πŸ¦‹
  • reserved β€” reserved. hands off, bestie πŸ’œ

🌟 Description 🌟

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. so yes, minimal, asynchronous, and it works β€” obsessed πŸŽ€

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);

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/uapi/drm/xe_drm.h

  • Xe Device Block Diagram(9)
  • Xe uAPI Overview(9)
  • Xe IOCTL Extensions(9)
  • struct drm_xe_user_extension(9)
  • struct drm_xe_ext_set_property(9)
  • struct drm_xe_engine_class_instance(9)
  • struct drm_xe_engine(9)
  • struct drm_xe_query_engines(9)
  • enum drm_xe_memory_class(9)
  • struct drm_xe_mem_region(9)
  • struct drm_xe_query_mem_regions(9)
  • struct drm_xe_query_config(9)
  • struct drm_xe_gt(9)
  • struct drm_xe_query_gt_list(9)
  • struct drm_xe_query_topology_mask(9)
  • struct drm_xe_query_engine_cycles(9)
  • struct drm_xe_query_uc_fw_version(9)
  • struct drm_xe_query_pxp_status(9)
  • struct drm_xe_device_query(9)
  • struct drm_xe_gem_create(9)
  • struct drm_xe_gem_mmap_offset(9)
  • struct drm_xe_vm_create(9)
  • struct drm_xe_vm_destroy(9)
  • struct drm_xe_vm_bind_op(9)
  • struct drm_xe_vm_get_property(9)
  • struct drm_xe_exec_queue_create(9)
  • struct drm_xe_exec_queue_destroy(9)
  • struct drm_xe_exec_queue_get_property(9)
  • struct drm_xe_sync(9)
  • struct drm_xe_exec(9)
  • struct drm_xe_wait_user_fence(9)
  • enum drm_xe_observation_type(9)
  • enum drm_xe_observation_op(9)
  • struct drm_xe_observation_param(9)
  • enum drm_xe_observation_ioctls(9)
  • enum drm_xe_oa_unit_type(9)
  • struct drm_xe_oa_unit(9)
  • struct drm_xe_query_oa_units(9)
  • enum drm_xe_oa_format_type(9)
  • enum drm_xe_oa_property_id(9)
  • struct drm_xe_oa_config(9)
  • struct drm_xe_oa_stream_status(9)
  • struct drm_xe_oa_stream_info(9)
  • enum drm_xe_pxp_session_type(9)
  • enum drm_xe_eu_stall_property_id(9)
  • struct drm_xe_query_eu_stall(9)
  • struct drm_xe_madvise(9)
  • struct drm_xe_mem_range_attr(9)
  • struct drm_xe_vm_query_mem_range_attr(9)
  • struct drm_xe_exec_queue_set_property(9)
  • Xe DRM RAS(9)
  • enum drm_xe_ras_error_severity(9)
  • enum drm_xe_ras_error_component(9)

and that's the whole page, bestie β€” every last cross-reference, we did not skip a single one πŸ’…

this lil cutie came out of the kernel file ./include/uapi/drm, stamped October 2026, and it's filed under struct drm_xe_vm_bind(9) β€” go bind something, ily, mwah πŸ«ΆπŸ’–

πŸ“¦ where this page comes from