STRUCT TTM_KMAP_ITER_OPS(9)
π struct ttm_kmap_iter_ops(9) β like, the Kernel API Manual but make it make sense π
okay so bestie, picture this: it's a Kernel API Manual page, and the whole main character of it is struct ttm_kmap_iter_ops β which is, no cap, the ops structure for a struct ttm_kmap_iter. that's it. that's the vibe. β¨
πΈ NAME πΈ
struct ttm_kmap_iter_ops β literally the Ops structure for a struct ttm_kmap_iter. iconic behavior, honestly.
π¦ SYNOPSIS π¦
struct ttm_kmap_iter_ops {
void (*map_local)(struct ttm_kmap_iter *res_iter, struct iosys_map
*dmap, pgoff_t i);
void (*unmap_local)(struct ttm_kmap_iter *res_iter, struct iosys_map
*dmap);
bool maps_tt;
};
copy it exactly, bestie, don't be re-typing it from memory π
π Members π
okay so here's the cast of characters, one bullet each, they're all main characters:
map_localβ maps aPAGE_SIZEpart of the resource usingkmap_localsemantics. πΊοΈ and like, here's what you're feeding it:- res_iter: Pointer to the
struct ttm_kmap_iterrepresenting the resource. - dmap: The
struct iosys_mapholding the virtual address after the operation. - i: The location within the resource to map.
PAGE_SIZEgranularity, okay? granularity matters, periodt.
- res_iter: Pointer to the
unmap_localβ the reverse slay π unmaps aPAGE_SIZEpart of the resource that was previously mapped usingkmap_local. its little entourage:- res_iter: Pointer to the
struct ttm_kmap_iterrepresenting the resource. - dmap: The
struct iosys_mapholding the virtual address after the operation.
- res_iter: Pointer to the
maps_ttβ abool, and the whole question is: does the iterator map TT memory directly, or is it mapping a TT through an aperture? π and like, both these modes havestruct ttm_resource_manager::use_ttset β yes, both, i know, rude β but the latter (the aperture one) typically returnsis_iomem == truefromttm_mem_io_reserve. so that's the lil tell you're looking for, iykyk π§
π₯ SEE ALSO π₯
- Kernel file
./include/drm/ttm/ttm_kmap_iter.h struct ttm_kmap_iter(9)
π reminder:maps_ttβ direct TT mapping vs. TT through an aperture β both keepstruct ttm_resource_manager::use_ttset. the difference shows up asis_iomem == truecoming back fromttm_mem_io_reserveon the aperture route. don't mix them up, bestie, i'm begging π
okay that's the whole page, you ate that π«Ά this beauty lives at ./include/drm/ttm, version dating to October 2026, and it's filed as struct ttm_kmap_iter_ops(9) β go be a main character with your kmap iterators, 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