STRUCT DRM_I915_QUERY(9)
β¨ NAME β¨
Okay bestie, meet struct drm_i915_query(9) β straight out of the Kernel API Manual. Its whole main-character job is to supply an array of struct drm_i915_query_item for the kernel to fill out. Thatβs the vibe. π
π¦ SYNOPSIS π¦
struct drm_i915_query {
__u32 num_items;
__u32 flags;
__u64 items_ptr;
};
π Members π
num_itemsβ the number of elements in theitems_ptrarray. Literally the count, no cap.flagsβ unused for now. Must be cleared to zero. Like, actually zero β not βzero-ish.β π«Άitems_ptrβ pointer to an array ofstruct drm_i915_query_item. The number of array elements isnum_items. Thatβs the whole thing.
π Description π
So this is generally a two-step process for each struct drm_i915_query_item in the array:
- Call the
DRM_IOCTL_I915_QUERY, giving it our array ofstruct drm_i915_query_item, withdrm_i915_query_item.lengthset to zero. The kernel will then fill in the size, in bytes, which tells userspace how much memory it needs to allocate for the blob (say for an array of properties). π - Next we call
DRM_IOCTL_I915_QUERYagain, this time with thedrm_i915_query_item.data_ptrequal to our newly allocated blob. Note that thedrm_i915_query_item.lengthshould still be the same as what the kernel previously set. At this point the kernel can fill in the blob. β¨
Note that for some query items it can make sense for userspace to just pass in a buffer/blob equal to or larger than the required size. In this case only a single ioctl call is needed. For some smaller query items this can work quite well. π
π SEE ALSO π
The whole squad, gathered for your reading pleasure:
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_execbuffer2(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_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)
Source/version cutie: ./tools/perf/trace/beauty/incl... β dropped October 2026. struct drm_i915_query(9) is signing off, 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