STRUCT XE_VRAM_REGION(9)
β¨ struct xe_vram_region(9) β¨
okay bestie, buckle up π
this is a page from the Kernel API Manual, and it's literally the whole lore on struct xe_vram_region β like, what even is it?
πΈ NAME πΈ
struct xe_vram_region β the memory region structure. fr fr, this one is used to describe a memory region in an xe device, like HBM memory or CXL extension memory. no cap, that's the whole vibe π«Ά
π SYNOPSIS π
struct xe_vram_region {
struct xe_device *xe;
u8 id;
resource_size_t io_start;
resource_size_t io_size;
resource_size_t dpa_base;
resource_size_t usable_size;
resource_size_t actual_physical_size;
void __iomem *mapping;
struct xe_ttm_vram_mgr ttm;
u32 placement;
#if IS_ENABLED(CONFIG_DRM_XE_PAGEMAP);
struct xe_migrate *migrate;
struct drm_pagemap_cache *dpagemap_cache;
#endif;
};
π Members π
okay so here's the cast of characters, and yes every single one of them matters π
xeβ back pointer to the xe device. it's giving "who's your parent" energy πidβ the VRAM region instance id. and the value should be unique for a VRAM region, periodt π no duplicates allowed bestie.io_startβ IO start address of this VRAM instance β¨io_sizeβ IO size of this VRAM instance. this one represents how much of this VRAM we can actually access via the CPU through the VRAM BAR. lowkey iconic detail: this can be smaller thanusable_size, in which case only part of VRAM is CPU accessible (typically the first 256M). this configuration is known as small-bar. yes that's a real name, iykyk π§dpa_baseβ this memory region's DPA (device physical address) base π¦usable_sizeβ usable size of VRAM. it's the usable size of VRAM excluding reserved portions (e.g stolen mem) πactual_physical_sizeβ the actual VRAM size. and that's the actual VRAM size including reserved portions (e.g stolen mem) π₯mappingβ pointer to VRAM mappable space βttmβ the VRAM TTM manager πplacementβ TTM placement dedicated for this region πmigrateβ back pointer to migrate πdpagemap_cacheβ the drm_pagemap cache. that's it, that's the whole description, she said what she said π
heads up bestie:migrateanddpagemap_cacheonly exist whenIS_ENABLED(CONFIG_DRM_XE_PAGEMAP)is true, so don't come for them if that config is off π«Ά
π SEE ALSO π
if you wanna read the source (and honestly, obsessed), go look at the kernel file ./drivers/gpu/drm/xe/xe_vram_types.h β¨
kisses bestie, this one's a wrap π this page is comin' at you straight from ./drivers/gpu/drm/xe, dated October 2026, in the good ol' Kernel API Manual β slay, and happy hacking ππ¦
π¦ 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