STRUCT TTM_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

struct ttm_device β€” bestie, this is the buffer object driver's very own device-specific data struct, and it's holding so much πŸ’–


✨ SYNOPSIS ✨

okay so picture this, the whole struct, no cap, exactly like this:

struct ttm_device {
    struct list_head device_list;
    unsigned int alloc_flags;
    const struct ttm_device_funcs *funcs;
    struct ttm_resource_manager sysman;
    struct ttm_resource_manager *man_drv[TTM_NUM_MEM_TYPES];
    struct drm_vma_offset_manager *vma_manager;
    struct ttm_pool pool;
    spinlock_t lru_lock;
    struct list_head unevictable;
    struct address_space *dev_mapping;
    struct workqueue_struct *wq;
 };

like, she's got range 🫢


πŸŽ€ Members πŸŽ€

girlies let's go member by member, i'm literally obsessed with each one:

  • device_list β€” our entry in the global device list. Constant after bo device init β€” so don't be out here changing it after, mkay? πŸ™ˆ
  • alloc_flags β€” the TTM_ALLOCATION_* flags. that's the whole vibe πŸ’…
  • funcs β€” the function table for the device. again Constant after bo device init, so once it's set, it's set, periodt ✨
  • sysman β€” the resource manager for the system domain. access it via ttm_manager_type, don't just go grabbing it directly, iykyk 🌸
  • man_drv β€” an array of resource managers, one per resource type. one for every type bestie, equal opportunity management πŸ”₯
  • vma_manager β€” the address space manager for finding BOs to mmap. she's literally the matchmaker of memory mapping 😭
  • pool β€” the page pool for the device. filled with pages, staying hydrated πŸ“
  • lru_lock β€” protection for the per manager LRU and ddestroy lists. the bodyguard, fr fr 🫑
  • unevictable β€” buffer objects which are pinned or swapped and as such not on an LRU list. they're too famous to be evicted, main character energy πŸ‘‘
  • dev_mapping β€” a pointer to the struct address_space for invalidating CPU mappings on buffer move. protected by load/unload sync β€” respect the sync, babes 🧚
  • wq β€” work queue structure for the delayed delete workqueue. she does the cleanup, slay πŸ’œ
lowkey important: those "constant after bo device init" notes are not decorative, they're the rules of the house 🏠

🌈 SEE ALSO 🌈

  • Kernel file ./include/drm/ttm/ttm_device.h
  • struct ttm_global(9)

and that's the whole thing bestie, go be iconic with it 🌟

with love from the Kernel API Manual, brought to you by ./include/drm/ttm, dated October 2026 β€” struct ttm_device(9) gang forever πŸ’…βœ¨

πŸ“¦ where this page comes from