STRUCT XE_BO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, welcome to the struct xe_bo(9) page from the Kernel API Manual πŸ’… this is literally all about the Xe buffer object β€” the struct that holds the tea for a buffer object, and it slay.

struct xe_bo β€” Xe buffer object.


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the full struct, no cap β€” vibe-check every field because we are not skipping a single one:

       struct xe_bo {
           struct ttm_buffer_object ttm;
           struct xe_bo *backup_obj;
           struct xe_bo *parent_obj;
           struct dma_buf *dma_buf;
           u32 flags;
           struct xe_vm *vm;
           struct xe_tile *tile;
           struct ttm_place placements[XE_BO_MAX_PLACEMENTS];
           struct ttm_placement placement;
           struct xe_ggtt_node *ggtt_node[XE_MAX_TILES_PER_DEVICE];
           struct iosys_map vmap;
           struct ttm_bo_kmap_obj kmap;
           struct list_head pinned_link;
         #ifdef CONFIG_PROC_FS;
           struct xe_drm_client *client;
           struct list_head client_link;
         #endif;
           struct {
             u32 atomic_access;
           } attr;
           u32 pxp_key_instance;
           struct llist_node freed;
           int update_index;
           bool created;
           bool ccs_cleared;
           struct xe_mem_pool_node *bb_ccs[XE_SRIOV_VF_CCS_CTX_COUNT];
           u16 cpu_caching;
           struct drm_pagemap_devmem devmem_allocation;
           struct list_head vram_userfault_link;
           u64 min_align;
           struct {
             u32 state;
             u32 vma_count;
             u32 willneed_count;
           } purgeable;
        };

πŸ’– Members πŸ’–

okay, member-by-member, and the way that we're covering every single one is giving responsible bestie 🫢

  • ttm β€” TTM base buffer object. main character energy, honestly.
  • backup_obj β€” the backup object when pinned and suspended (vram only).
  • parent_obj β€” ref to the parent BO if this is a backup_obj.
  • dma_buf β€” imported dma-buf ref to keep its resv alive.
  • flags β€” flags for this buffer object.
  • vm β€” VM this BO is attached to; for extobj this will be NULL.
  • tile β€” tile this BO is attached to (kernel BO only).
  • placements β€” valid placements for this BO. obsessed.
  • placement β€” current placement for this BO.
  • ggtt_node β€” array of GGTT nodes if this BO is mapped in the GGTTs.
  • vmap β€” iosys map of this buffer.
  • kmap β€” TTM BO kmap object for internal use only. Keep off. ngl, this is not the one to poke at 🚫
  • pinned_link β€” link to present / evicted list of pinned BO.
  • client β€” xe_drm_client which created the BO.
  • client_link β€” link into xe_drm_client.objects_list.
  • attr β€” user controlled attributes for the BO.
  • attr.atomic_access β€” type of atomic access the BO needs, protected by the BO dma-resv lock.
  • pxp_key_instance β€” PXP key instance this BO was created against. A 0 in this variable indicates that the BO does not use PXP encryption.
  • freed β€” list node for delayed put. not me forgetting the delayed put πŸ‘€
  • update_index β€” update index if PT BO.
  • created β€” whether the BO has passed initial creation.
  • ccs_cleared β€” true means that the CCS region of the BO is already cleared.
  • bb_ccs β€” BB instructions of CCS read/write. Valid only for VF.
  • cpu_caching β€” CPU caching mode. Currently only used for userspace objects. Exceptions are system memory on DGFX, which is always WB. it ate.
  • devmem_allocation β€” SVM device memory allocation. it's giving device memory realness ✨
  • vram_userfault_link β€” link into mem_access.vram_userfault.list.
  • min_align β€” minimum alignment needed for this BO if different from default. lowkey important.
  • purgeable β€” purgeability state and accounting.

and yes bestie, all fields are protected by the BO's dma-resv lock. fr fr πŸ”’

  • purgeable.state β€” BO purgeability state (WILLNEED/DONTNEED/PURGED).
  • purgeable.vma_count β€” number of VMAs currently mapping this BO.
  • purgeable.willneed_count β€” number of active WILLNEED holders.

Counts WILLNEED VMAs plus active dma-buf exports for non-imported BOs. The BO flips to DONTNEED on a 1->0 transition only when VMAs still exist; if the last VMA is removed, the previous BO state is preserved.


🌈 SEE ALSO 🌈

  • Kernel file ./drivers/gpu/drm/xe/xe_bo_types.h β€” iconic source-of-truth behavior, iykyk 🌟

and that's the whole page, bestie 🫢 β€” the source/version is ./drivers/gpu/drm/xe, dated October 2026, and the page is struct xe_bo(9). periodt πŸ’…

πŸ“¦ where this page comes from