STRUCT __DRM_I915_MEMORY_REGION_INFO(9)
π struct __drm_i915_memory_region_info(9) β Kernel API Manual π
okay so this is a page from the Kernel API Manual, and it's literally all about one little struct that tells you everything the driver knows about a memory region. bestie, it's giving "backstage pass to your GPU's brain" energy π§ β¨
πΈ NAME πΈ
struct __drm_i915_memory_region_info β describes one region as known to the driver π«Ά
β¨ 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;
};
};
};
no cap, that's the whole vibe of it π
π Members π
regionβ theclass:instancepair encoding π that's the ID card for the region, basically.rsvd0β MBZ. (that's "must be zero" β don't be the main character who fills it in π)probed_sizeβ memory probed by the driver β
lowkey important: it should not be possible to ever encounter a zero value here, and also note that no current region type will ever return -1 here. for future region types though, that might be a possibility. and the same applies to the other size fields, iykyk.
unallocated_sizeβ estimate of memory remaining π
fr fr, this one requiresCAP_PERFMONorCAP_SYS_ADMINto get reliable accounting. without that (or if this is an older kernel) the value here will always equal theprobed_size. also note this is only currently tracked forI915_MEMORY_CLASS_DEVICEregions β for other types the value here will always equal theprobed_size.
{unnamed_union}β anonymous π«₯ (yes literally anonymous, it's a mystery girlie)rsvd1β MBZ π again: must be zero. hands off.{unnamed_struct}β anonymous π (another anonymous one, we love a private queen)probed_cpu_visible_sizeβ memory probed by the driver that is CPU accessible π
this will always be <= probed_size, and the remainder (if there is any) will not be CPU accessible.
on systems without small BAR, the probed_size will always equal the probed_cpu_visible_size, since all of it will be CPU accessible β¨
note this is only tracked forI915_MEMORY_CLASS_DEVICEregions (for other types the value here will always equal theprobed_size).
and bestie listen: if the value returned here is zero, then this must be an old kernel which lacks the relevant small-bar uAPI support (includingI915_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 whenprobed_cpu_visible_size == probed_size. π§
unallocated_cpu_visible_sizeβ estimate of CPU visible memory remaining π
note this is only tracked forI915_MEMORY_CLASS_DEVICEregions (for other types the value here will always equal theprobed_cpu_visible_size).
requiresCAP_PERFMONorCAP_SYS_ADMINto get reliable accounting. without this the value here will always equal theprobed_cpu_visible_size. and note this is only currently tracked forI915_MEMORY_CLASS_DEVICEregions (for other types the value here will also always equal theprobed_cpu_visible_size).
if this is an older kernel the value here will be zero, see also probed_cpu_visible_size. π
π¦ Description π¦
okay so heads up: this is using both struct drm_i915_query_item and struct drm_i915_query π«Ά. for this new query we're adding the new query id DRM_I915_QUERY_MEMORY_REGIONS at drm_i915_query_item.query_id. slay, that's the whole plot π₯
π SEE ALSO π
kernel file ./Documentation/gpu/rfc/i915_small_bar.h struct __drm_i915_gem_create_ext(9) π
and that's the tea, bestie π΅π
this page came from ./Documentation/gpu/rfc, dated October 2026, and it's filed under struct __drm..._region_info(9) β go off, you icon ππ
π¦ 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