STRUCT XE_GGTT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct xe_ggtt(9) ✨

okay bestie, buckle up β€” this is page 9 of the Kernel API Manual, and we're talking about struct xe_ggtt, the main character of GGTT structs. πŸ’…


πŸ’– NAME πŸ’–

struct xe_ggtt β€” the Main GGTT struct. yes, THE main one. iconic behavior only. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

like, here's literally the whole vibe of it:

struct xe_ggtt {
    struct xe_tile *tile;
    u64 start;
    u64 size;
    unsigned int flags;
    struct xe_bo *scratch;
    struct mutex lock;
    u64 __iomem *gsm;
    const struct xe_ggtt_pt_ops *pt_ops;
    struct drm_mm mm;
    unsigned int access_count;
    struct workqueue_struct *wq;
 };

not me pasting the entire struct definition, but also… yes. 🫢


πŸŽ€ Members πŸŽ€

  • tile β€” back pointer to the tile where this GGTT belongs. it literally points back home, iykyk. 🏠
  • start β€” the start offset of the GGTT. where it all begins, periodt. ✨
  • size β€” the total usable size of this GGTT. the whole usable slay. πŸ’…
  • flags β€” flags for this GGTT. the acceptable ones are:
    • XE_GGTT_FLAGS_64K β€” if the PTE size is 64K. otherwise, the regular one is 4K. no in-between, fr fr.
    • XE_GGTT_FLAGS_ONLINE β€” says whether the GGTT is online. it's protected by ggtt->lock after init. πŸ›‘οΈ
  • scratch β€” an internal object allocation used as a scratch page. lil note-taking page energy. πŸ“
  • lock β€” a mutex lock that protects the GGTT data. do NOT skip the lock bestie. πŸ”’
  • gsm β€” the iomem pointer to the actual location of the translation table living in the GSM, so the PTE manipulation is easy. convenient and cute. πŸ’«
  • pt_ops β€” page table operations, per platform. every platform gets its own flavor. 🌈
  • mm β€” the memory manager used to manage the individual GGTT allocations. she manages. she organizes. πŸ‘‘
  • access_count β€” counts the GGTT writes. keeping count, always. πŸ”’
  • wq β€” a dedicated unordered work queue that processes node removals. dedicated, unordered, unbothered. πŸ’β€β™€οΈ

🌸 Description 🌸

so in general, each tile can contain its own Global Graphics Translation Table (GGTT) instance. like, each tile gets its own little GGTT moment. no cap. 🧚


πŸ’œ SEE ALSO πŸ’œ

the kernel file ./drivers/gpu/drm/xe/xe_ggtt.c, plus Global Graphics Translation Table (GGTT)(9), struct xe_ggtt_node(9), struct xe_ggtt_pt_ops(9), xe_ggtt_start(9), xe_ggtt_size(9), xe_ggtt_alloc(9), xe_ggtt_init_early(9), xe_ggtt_node_remove(9), xe_ggtt_init(9), xe_ggtt_shift_nodes(9), xe_ggtt_insert_node(9), xe_ggtt_node_pt_size(9), xe_ggtt_map_bo(9), xe_ggtt_map_bo_unlocked(9), xe_ggtt_insert_node_transform(9), xe_ggtt_insert_bo_at(9), xe_ggtt_insert_bo(9), xe_ggtt_remove_bo(9), xe_ggtt_largest_hole(9), xe_ggtt_assign(9), xe_ggtt_node_save(9), xe_ggtt_node_load(9), xe_ggtt_dump(9), xe_ggtt_print_holes(9), xe_ggtt_encode_pte_flags(9), xe_ggtt_read_pte(9), xe_ggtt_node_addr(9), xe_ggtt_node_size(9)


that's the whole page bestie, every last reference accounted for, we ate and left no crumbs πŸ”₯

alright, cute sign-off time: this lil beauty lives in ./drivers/gpu/drm/xe, dated October 2026, and it's struct xe_ggtt(9) β€” stan forever. πŸ’–πŸŽ€β­

πŸ“¦ where this page comes from