STRUCT TTM_RESOURCE_CURSOR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

struct ttm_resource_cursor β€” bestie, it's literally the cursor struct for iterating over the resources in a manager ✨ (yeah the original NAME line is kinda shy and gives you nothing else, so that's the whole vibe, iykyk πŸ’…)


πŸŽ€ SYNOPSIS πŸŽ€

struct ttm_resource_cursor {
    struct ttm_resource_manager *man;
    struct ttm_lru_item hitch;
    struct list_head bulk_link;
    struct ttm_lru_bulk_move *bulk;
    unsigned int mem_type;
    unsigned int priority;
 };

πŸ’– Members πŸ’–

  • man β€” the resource manager you're currently iterating over, main character of the traversal 🫢
  • hitch β€” a hitch list node, and the way it works is it gets inserted before the next resource you're gonna iterate over. Lowkey iconic bookmarking behavior πŸŽ€
  • bulk_link β€” a list link for the list of cursors that are traversing the bulk sublist of bulk. It's protected by the ttm device's lru_lock πŸ”’ (yes, the lock, respect it)
  • bulk β€” pointer to the struct ttm_lru_bulk_move whose subrange hitch is inserted into. It's NULL if there isn't one. 🚨 Never dereference this pointer β€” the struct ttm_lru_bulk_move object it points to might have already been freed 😭. The pointer is only for comparison, nothing else, periodt.
  • mem_type β€” the memory type of the LRU list you're traversing. Heads up: this field is only valid iff bulk != NULL ⭐
  • priority β€” the current priority, that's it, that's the field πŸ’œ

πŸ¦‹ Description πŸ¦‹

It's a cursor πŸ’« β€” you use it to iterate over the resources in a manager. That's the whole job and honestly it ate.


🌈 SEE ALSO 🌈

Kernel file ./include/drm/ttm/ttm_resource.h, TTM_NUM_MOVE_FENCES(9), enum ttm_lru_item_type(9), struct ttm_lru_item(9), ttm_lru_item_init(9), struct ttm_resource_manager(9), struct ttm_bus_placement(9), struct ttm_resource(9), ttm_lru_item_to_res(9), struct ttm_lru_bulk_move_pos(9), struct ttm_lru_bulk_move(9), struct ttm_kmap_iter_iomap(9), struct ttm_kmap_iter_linear_io(9), ttm_resource_manager_set_used(9), ttm_resource_manager_used(9), ttm_resource_manager_cleanup(9), ttm_resource_manager_for_each_res(9)


ok that's the whole page bestie, go forth and iterate responsibly πŸ§šβ€β™€οΈπŸ’–

mwah πŸ’‹ β€” this one lives in ./include/drm/ttm, dated October 2026, and it's filed under struct ttm_resource_cursor(9). slay ✨

πŸ“¦ where this page comes from