ttm_lru_item_to_res(9)
π ttm_lru_item_to_res β the kernel API manual, bestie edition β¨
okay so real quick, before anything else: this whole page is from the Kernel API Manual, and the function we're obsessing over today is literally called ttm_lru_item_to_res. yes it's a mouthful. no we're not changing it. periodt π
β¨ NAME β¨
ttm_lru_item_to_res β downcast a struct ttm_lru_item to a struct ttm_resource π«Ά
like, you hand it the little embedded thing, it hands you back the big thing it's chillin' inside. that's the whole gig. iykyk.
πΈ SYNOPSIS πΈ
struct ttm_resource * ttm_lru_item_to_res (struct ttm_lru_item *item );
literally one call. one argument. one pointer back. we love a low-effort icon π
π ARGUMENTS π
itemβ thestruct ttm_lru_itemyou wanna downcast, babe. that's it, that's the whole input. just point it at the item and let the function cook π
π RETURN π
a pointer to the embedding struct ttm_resource β¨ β the bigger struct that your item is nested inside, no cap. it's giving "found my person" energy fr fr.
π¦ SEE ALSO π¦
bestie. buckle up. the lore is DEEP on this one π the kernel file <cyan>./include/drm/ttm/ttm_resource.h</cyan> is where all the receipts live, and here's the full extended universe:
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)struct ttm_lru_bulk_move_pos(9)struct ttm_lru_bulk_move(9)struct ttm_resource_cursor(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)
ngl you could lose a whole afternoon in there. hydration check first though π§π
okay that's the page π sourced straight from <purple>./include/drm/ttm</purple> and dated October 2026 β so mark your calendar, screenshot this, send it to the group chat, and go downcast responsibly. mwah π
π¦ 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