STRUCT TTM_DEVICE(9)
π 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β theTTM_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 viattm_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 tommap. 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 thestruct address_spacefor 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
- 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