ttm_bo_kmap(9)
π ttm_bo_kmap
okay so bestie, welcome to the ttm_bo_kmap(9) glow-up β this is straight out of the Kernel API Manual and it's lowkey one of those little glue functions that holds the whole graphics subsystem together. no cap.
β¨ NAME β¨
ttm_bo_kmap β and yeah, the source tarball literally leaves this line empty π so we're not gonna make up a tagline for it. main character with no bio, truly iconic.
πΈ SYNOPSIS πΈ
int ttm_bo_kmap (struct ttm_buffer_object *bo , unsigned long start_page
, unsigned long num_pages , struct ttm_bo_kmap_obj *map );
π ARGUMENTS π
boβ the buffer object in question, aka the whole reason we're here πstart_pageβ the first page to map. like where the mapping starts, bestie.num_pagesβ how many pages we're mapping. the count. the vibe. the quantity.mapβ pointer to astruct ttm_bo_kmap_objthat represents the map π«Ά
π¦ DESCRIPTION π¦
so what this does is it sets up a kernel virtual mapping to the data sitting in the buffer object β and it pulls that off using ioremap, vmap or kmap. which one? whichever, that's the vibe β¨.
once that's done you can call the ttm_kmap_obj_virtual function to grab a virtual address pointing at the data. literally the payoff. that's how you actually touch the bytes π
and the return values, because obviously:
-ENOMEMβ out of memory π-EINVALβ invalid range π
bestie pls check your range before you call this. -EINVAL is not the moment we want.
π SEE ALSO π
the whole squad, all linked from the kernel file ./drivers/gpu/drm/ttm/ttm_bo_util.c β go read them, iykyk:
ttm_move_memcpy(9)ttm_bo_move_memcpy(9)ttm_buffer_object_transfer(9)ttm_io_prot(9)ttm_bo_kmap_try_from_panic(9)ttm_bo_kunmap(9)ttm_bo_vmap(9)ttm_bo_vunmap(9)ttm_bo_move_accel_cleanup(9)ttm_bo_move_sync_cleanup(9)ttm_bo_pipeline_gutting(9)ttm_lru_walk_for_evict(9)ttm_bo_lru_cursor_fini(9)ttm_bo_lru_cursor_init(9)ttm_bo_lru_cursor_next(9)ttm_bo_lru_cursor_first(9)ttm_bo_shrink(9)ttm_bo_shrink_suitable(9)ttm_bo_shrink_avoid_wait(9)
anyway that's the whole page, mwah π β this one lives under ./drivers/gpu/drm/ttm, dated October 2026, and it's filed as ttm_bo_kmap(9). slay, go map some pages π§π
π¦ 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