STRUCT DRM_I915_GEM_EXECBUFFER2(9)
π NAME
struct drm_i915_gem_execbuffer2 β the struct for the DRM_I915_GEM_EXECBUFFER2 ioctl. Bestie, this is the whole vibe of "hey kernel, please actually run my GPU commands". She's the main character of the i915 exec path, no cap.
This page lives in the Kernel API Manual, section 9 (iykyk).
β¨ SYNOPSIS β¨
struct drm_i915_gem_execbuffer2 {
__u64 buffers_ptr;
__u32 buffer_count;
__u32 batch_start_offset;
__u32 batch_len;
__u32 DR1;
__u32 DR4;
__u32 num_cliprects;
__u64 cliprects_ptr;
__u64 flags;
#define I915_EXEC_RING_MASK (0x3f);
#define I915_EXEC_DEFAULT (0<<0);
#define I915_EXEC_RENDER (1<<0);
#define I915_EXEC_BSD (2<<0);
#define I915_EXEC_BLT (3<<0);
#define I915_EXEC_VEBOX (4<<0);
#define I915_EXEC_CONSTANTS_MASK (3<<6);
#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) ;
#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6);
#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) ;
#define I915_EXEC_GEN7_SOL_RESET (1<<8);
#define I915_EXEC_SECURE (1<<9);
#define I915_EXEC_IS_PINNED (1<<10);
#define I915_EXEC_NO_RELOC (1<<11);
#define I915_EXEC_HANDLE_LUT (1<<12);
#define I915_EXEC_BSD_SHIFT (13);
#define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT);
#define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT);
#define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT);
#define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT);
#define I915_EXEC_RESOURCE_STREAMER (1<<15);
#define I915_EXEC_FENCE_IN (1<<16);
#define I915_EXEC_FENCE_OUT (1<<17);
#define I915_EXEC_BATCH_FIRST (1<<18);
#define I915_EXEC_FENCE_ARRAY (1<<19);
#define I915_EXEC_FENCE_SUBMIT (1 << 20);
#define I915_EXEC_USE_EXTENSIONS (1 << 21);
#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_USE_EXTENSIONS << 1));
__u64 rsvd1;
__u64 rsvd2;
};
Look at all those flag #defines living rent-free inside the struct π β every single one matters, so don't skip them.
π¦ Members π¦
buffers_ptr
A pointer to a list of gem_exec_object2 structs. It's giving "here's my stack of stuff".
buffer_count
The number of elements in the buffers_ptr array.
batch_start_offset
The offset in the batchbuffer where execution starts from. Like pressing play at a specific timestamp β±οΈ.
batch_len
The length in bytes of the batch buffer, starting from the batch_start_offset. If it's 0, the length is assumed to be the batch buffer object size. Slay, defaults β¨.
DR1
deprecated π
DR4
also deprecated ππ
num_cliprects
See cliprects_ptr. These two are a package deal π«Ά.
cliprects_ptr
Kernel clipping was a DRI1 misfeature. Yeah. That's the whole note. π
Important: it is invalid to use this field ifI915_EXEC_FENCE_ARRAYorI915_EXEC_USE_EXTENSIONSflags are not set.
If I915_EXEC_FENCE_ARRAY is set, then this is a pointer to an array of drm_i915_gem_exec_fence and num_cliprects is the length of the array. Cute, right?
If I915_EXEC_USE_EXTENSIONS is set, then this is a pointer to a single i915_user_extension and num_cliprects is 0. Zero. Nada. Periodt.
flags
Execbuf flags. All of them. The whole #define buffet up in the synopsis is this field's lore π₯.
rsvd1
Context id.
rsvd2
in and out sync_file file descriptors. Okay here's the tea, both halves of this one field are doing double duty:
When I915_EXEC_FENCE_IN or I915_EXEC_FENCE_SUBMIT flag is set, the lower 32 bits of this field will have the in sync_file fd (input).
When I915_EXEC_FENCE_OUT flag is set, the upper 32 bits of this field will have the out sync_file fd (output).
Two fds, one __u64. She's efficient like that π
π SEE ALSO π
Kernel file ./tools/perf/trace/beauty/include/uapi/drm/i915_drm.huevents generated by i915 on its device node(9)struct i915_user_extension(9)enum drm_i915_gem_engine_class(9)struct i915_engine_class_instance(9)perf_events exposed by i915 through /sys/bus/event_sources/drivers/i915(9)struct drm_i915_getparam(9)drm_i915_getparam_t(9)struct drm_i915_gem_mmap_offset(9)struct drm_i915_gem_set_domain(9)struct drm_i915_gem_exec_fence(9)struct drm_i915_gem_execbuffer_ext_timeline_fences(9)struct drm_i915_gem_caching(9)struct drm_i915_gem_context_create_ext(9)struct drm_i915_gem_context_param(9)Virtual Engine uAPI(9)struct i915_context_engines_parallel_submit(9)Context Engine Map uAPI(9)struct drm_i915_gem_context_create_ext_setparam(9)struct drm_i915_gem_vm_control(9)struct drm_i915_gem_userptr(9)struct drm_i915_perf_oa_config(9)struct drm_i915_query_item(9)struct drm_i915_query(9)struct drm_i915_query_topology_info(9)Engine Discovery uAPI(9)struct drm_i915_engine_info(9)struct drm_i915_query_engine_info(9)struct drm_i915_query_perf_config(9)enum drm_i915_gem_memory_class(9)struct drm_i915_gem_memory_class_instance(9)struct drm_i915_memory_region_info(9)struct drm_i915_query_memory_regions(9)struct drm_i915_query_guc_submission_version(9)GuC HWCONFIG blob uAPI(9)struct drm_i915_gem_create_ext(9)struct drm_i915_gem_create_ext_memory_regions(9)struct drm_i915_gem_create_ext_protected_content(9)struct drm_i915_gem_create_ext_set_pat(9)
Okay that's the whole page, bestie π
β¨ She's sourced from ./tools/perf/trace/beauty/incl... (yes the footer literally truncates it like that, iconic), dated October 2026, and she's filed under struct drm_..._execbuffer2(9). Go read the headers, mwah π«Άπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms