STRUCT TTM_KMAP_ITER_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 a PAGE_SIZE part of the resource using kmap_local semantics. πŸ—ΊοΈ and like, here's what you're feeding it:
    • res_iter: Pointer to the struct ttm_kmap_iter representing the resource.
    • dmap: The struct iosys_map holding the virtual address after the operation.
    • i: The location within the resource to map. PAGE_SIZE granularity, okay? granularity matters, periodt.
  • unmap_local β€” the reverse slay πŸ’… unmaps a PAGE_SIZE part of the resource that was previously mapped using kmap_local. its little entourage:
    • res_iter: Pointer to the struct ttm_kmap_iter representing the resource.
    • dmap: The struct iosys_map holding the virtual address after the operation.
  • maps_tt β€” a bool, 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 have struct ttm_resource_manager::use_tt set β€” yes, both, i know, rude β€” but the latter (the aperture one) typically returns is_iomem == true from ttm_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 keep struct ttm_resource_manager::use_tt set. the difference shows up as is_iomem == true coming back from ttm_mem_io_reserve on 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