STRUCT DRM_XE_EXEC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct drm_xe_exec(9) ✨

okay bestie, welcome to the Kernel API Manual πŸ’… β€” yes we're in the kernel API manual, and yes it's serving. today's main character is struct drm_xe_exec, and honestly? she's iconic. let's get into it πŸŽ€


πŸ’– NAME πŸ’–

struct drm_xe_exec β€” the input of &DRM_IOCTL_XE_EXEC. that's it, that's the whole vibe check. she's the little envelope you hand the kernel to say "hey, run this thing" πŸ¦‹


✨ SYNOPSIS ✨

struct drm_xe_exec {
    __u64 extensions;
    __u32 exec_queue_id;
  #define DRM_XE_MAX_SYNCS 1024;
    __u32 num_syncs;
    __u64 syncs;
    __u64 address;
    __u16 num_batch_buffer;
    __u16 pad[3];
    __u64 reserved[2];
 };

like, look at her. immaculate. no notes. πŸ’…


🌸 Members 🌸

  • extensions β€” pointer to the first extension struct, if there is one. if any. no pressure. 🫢
  • exec_queue_id β€” the exec queue ID for the batch buffer. this is which queue is doing the running, iykyk.
  • num_syncs β€” how many struct drm_xe_sync are chilling in the array. amount of them. the headcount.
  • syncs β€” pointer to the struct drm_xe_sync array. this is where the sync structs actually live.
  • address β€” the address of the batch buffer if num_batch_buffer == 1, or an array of batch buffer addresses. yes, it changes shape depending on that count. she contains multitudes πŸ’€
  • num_batch_buffer β€” number of batch buffers in this exec, and it must match the width of the engine. do not play with this. she will know.
  • pad β€” MBZ. (that's "must be zero", bestie β€” not "maybe zero", not "zero-ish", MBZ. keep it zero 🚨)
  • reserved β€” reserved. don't touch, don't poke, don't ask. πŸ™ˆ

πŸ¦‹ Description πŸ¦‹

so here's the moment you've all been waiting for β€” this is an example of using struct drm_xe_exec to execute the object sitting at BIND_ADDRESS (and yes, the example for that lives in struct drm_xe_vm_bind), by an exec_queue (example for that? it's over in struct drm_xe_exec_queue_create). and if you want it synchronized, there's an example waiting for you in struct drm_xe_sync. we love a crossover episode πŸ‘‘

struct drm_xe_exec exec = {
    .exec_queue_id = exec_queue,
    .syncs = sync,
    .num_syncs = 1,
    .address = BIND_ADDRESS,
    .num_batch_buffer = 1,
};
ioctl(fd, DRM_IOCTL_XE_EXEC, exec);

literally that's it. fill the struct, call the ioctl, slay. ✨πŸ”₯


🧚 SEE ALSO 🧚

the kernel file, aka where all the lore is written down: ./include/uapi/drm/xe_drm.h πŸ“–

and now the whole group chat, because nobody gets left on read:

  • 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_bind(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_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 page, bestie 🫢 sourced straight from ./include/uapi/drm, dated October 2026, and yes that's a real date, no I don't make the rules πŸ’œ go run some batch buffers, stay hydrated, keep your pad at MBZ, periodt. πŸ“βœ¨

πŸ“¦ where this page comes from