STRUCT XE_VRAM_REGION(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 than usable_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: migrate and dpagemap_cache only exist when IS_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