STRUCT DRM_I915_MEMORY_REGION_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct drm_i915_memory_region_info(9) 🌸

okay bestie, welcome to the Kernel API Manual, section 9 β€” and today's main character is struct drm_i915_memory_region_info, no cap πŸ’…

✨ NAME ✨

struct drm_i915_memory_region_info β€” literally just describes one region as known to the driver. that's the whole vibe 🫢


πŸŽ€ SYNOPSIS πŸŽ€

struct drm_i915_memory_region_info {
    struct drm_i915_gem_memory_class_instance region;
    __u32 rsvd0;
    __u64 probed_size;
    __u64 unallocated_size;
    union {
      __u64 rsvd1[8];
      struct {
        __u64 probed_cpu_visible_size;
        __u64 unallocated_cpu_visible_size;
      };
    };
 };

like, look at that struct. it's giving organized. it's giving fields. obsessed 😭


πŸ‘‘ Members πŸ‘‘

  • region β€” the class:instance pair encoding πŸ¦‹
  • rsvd0 β€” MBZ. that's it. that's the field πŸ’€
  • probed_size β€” memory probed by the driver ✨
note that it should not be possible to ever encounter a zero value here, also note that no current region type will ever return -1 here. although for future region types, this might be a possibility. the same applies to the other size fields. so like... don't panic, but also, future-proofing is real πŸ™ˆ
  • unallocated_size β€” an estimate of memory remaining 🌸
requires CAP_PERFMON or CAP_SYS_ADMIN to get reliable accounting. without this (or if this is an older kernel) the value here will always equal the probed_size. note this is only currently tracked for I915_MEMORY_CLASS_DEVICE regions (for other types the value here will always equal the probed_size). so no cap, you get the same number back 😀
  • {unnamed_union} β€” anonymous. she has no name but she serves πŸŽ€
  • rsvd1 β€” MBZ. again. iconic of her πŸ’…
  • {unnamed_struct} β€” anonymous. also unnamed. also slaying quietly ⭐
  • probed_cpu_visible_size β€” memory probed by the driver that is CPU accessible πŸ’œ
this will be always be <= probed_size, and the remainder (if there is any) will not be CPU accessible. read that twice bestie, it matters πŸ”₯
on systems without small BAR, the probed_size will always equal the probed_cpu_visible_size, since all of it will be CPU accessible. convenient!! 🌈
note this is only tracked for I915_MEMORY_CLASS_DEVICE regions (for other types the value here will always equal the probed_size). yes, same rule as before 🧚
note that if the value returned here is zero, then this must be an old kernel which lacks the relevant small-bar uAPI support (including I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS), but on such systems we should never actually end up with a small BAR configuration, assuming we are able to load the kernel module. hence it should be safe to treat this the same as when probed_cpu_visible_size == probed_size. lowkey a whole paragraph but you got this πŸ™
  • unallocated_cpu_visible_size β€” an estimate of CPU visible memory remaining πŸ“
note this is only tracked for I915_MEMORY_CLASS_DEVICE regions (for other types the value here will always equal the probed_cpu_visible_size). we been knew πŸ’
requires CAP_PERFMON or CAP_SYS_ADMIN to get reliable accounting. without this the value here will always equal the probed_cpu_visible_size. note this is only currently tracked for I915_MEMORY_CLASS_DEVICE regions (for other types the value here will also always equal the probed_cpu_visible_size). yes it says it twice. yes it means it. ✨
if this is an older kernel the value here will be zero, see also probed_cpu_visible_size. old kernel = zero, don't come for me πŸ’€

πŸ’– Description πŸ’–

so here's the tea: this is using both struct drm_i915_query_item and struct drm_i915_query. for this new query we are adding the new query id DRM_I915_QUERY_MEMORY_REGIONS at drm_i915_query_item.query_id. that's the whole bit β€” you query, she answers 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

the friend group is HUGE, get comfy πŸ’…

  • Kernel file ./tools/perf/trace/beauty/include/uapi/drm/i915_drm.h
  • uevents 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(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_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)

and that's the whole page, bestie!! 🌈 this cutie came from ./tools/perf/trace/beauty/incl..., dated October 2026, and she's filed under struct drm_i..._region_info(9). go forth and query your memory regions, i'm so proud of you πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from