STRUCT TTM_KMAP_ITER_IOMAP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct ttm_kmap_iter_iomap(9) πŸ’–

okay bestie, welcome to the Kernel API Manual ✨ β€” we're about to talk about struct ttm_kmap_iter_iomap, which is literally the special-est little specialization for a struct io_mapping + struct sg_table backed struct ttm_resource. no cap, this one's a whole vibe πŸ¦‹


🌸 NAME 🌸

struct ttm_kmap_iter_iomap β€” Specialization for a struct io_mapping + struct sg_table backed struct ttm_resource. it's giving "i'm a kmap iterator but make it iomap-flavored" πŸ’…


✨ SYNOPSIS ✨

struct ttm_kmap_iter_iomap {
    struct ttm_kmap_iter base;
    struct io_mapping *iomap;
    struct sg_table *st;
    resource_size_t start;
    struct {
      struct scatterlist *sg;
      pgoff_t i;
      pgoff_t end;
      pgoff_t offs;
    } cache;
 };

like, look at her. she's got a base, she's got an iomap, she's got the whole cache situation going on. main character energy fr fr πŸ‘‘


πŸŽ€ Members πŸŽ€

  • base β€” the embedded struct ttm_kmap_iter that provides the usage interface. she's the personality, the public face, the way you actually talk to this struct 🫢
  • iomap β€” a struct io_mapping representing the underlying linear io_memory. iconic, honestly.
  • st β€” the sg_table into iomap, representing the memory of the struct ttm_resource. it's literally the whole point of the operation.
  • start β€” the offset that needs to be subtracted from st to make sg_dma_address(st->sgl) - start == 0 for iomap start. it's a little math, but we love her for it πŸ’œ
  • cache β€” the scatterlist traversal cache for fast lookups. because bestie, nobody wants to walk the whole sg list every single time πŸ™ˆ
  • cache.sg β€” pointer to the currently cached scatterlist segment. the segment of the moment, the one we're emotionally attached to rn.
  • cache.i β€” first index of sg, at PAGE_SIZE granularity. first index behavior only, no cap.
  • cache.end β€” last index + 1 of sg, at PAGE_SIZE granularity. yes, + 1. that's not a typo, that's the API, slay.
  • cache.offs β€” first offset into iomap of sg, at PAGE_SIZE granularity. the offs girlies rise 🌸

πŸ‘‘ SEE ALSO πŸ‘‘

y'all gotta check the Kernel file ./include/drm/ttm/ttm_resource.h and honestly the whole friend group:

so many references, so many icons πŸ§šπŸ’– iykyk.


okay that's the whole page bestie. every member, every field, every SEE ALSO β€” we kept it exactly as it is, no inventing, no skipping. periodt. πŸ’…

and that's a wrap, babe πŸŽ€ this page lives in ./include/drm/ttm and it's dated October 2026, courtesy of struct ttm_kmap_iter_iomap(9) β€” go forth and kmap responsibly, bestie 🌈⭐

πŸ“¦ where this page comes from