drm_gpusvm_get_pages(9)
π drm_gpusvm_get_pages(9)
okay so bestie, welcome to the Kernel API Manual β this one's drm_gpusvm_get_pages, and it's genuinely the moment where your CPU pages get their whole GPU-era glow-up β¨
π NAME π
drm_gpusvm_get_pages β grab pages and populate the GPU SVM pages struct, no cap.
π¦ SYNOPSIS π¦
int drm_gpusvm_get_pages (struct drm_gpusvm *gpusvm , struct
drm_gpusvm_pages *svm_pages , struct mm_struct *mm , struct
mmu_interval_notifier *notifier , unsigned long pages_start , unsigned
long pages_end , const struct drm_gpusvm_ctx *ctx );
like, look at that signature. seven whole parameters. main character energy fr fr π
πΈ ARGUMENTS πΈ
gpusvmβ Pointer to the GPU SVM structure. your home base πsvm_pagesβ The SVM pages to populate. This will contain the dma-addresses β so yeah, it comes back with the goods πmmβ The mm corresponding to the CPU range. the vibe check for which address space we're in.notifierβ The corresponding notifier for the given CPU range. it's giving "I'll let you know if anything moves" π£pages_startβ Start CPU address for the pages.pages_endβ End CPU address for the pages (exclusive). exclusive!! important!! don't @ me πctxβ GPU SVM context.
β¨ DESCRIPTION β¨
This function gets and maps pages for the CPU range and ensures they are mapped for DMA access.
that's it. that's the whole thing. it lowkey ate and left no crumbs β CPU range in, DMA-mapped pages out, and everything in between is handled for you π«Ά
π₯ RETURN π₯
0 on success, negative error code on failure. classic. iconic. periodt. π
π SEE ALSO π
Kernel file ./drivers/gpu/drm/drm_gpusvm.c
Overview(9)Locking(9)Partial Unmapping of Ranges(9)Examples(9)npages_in_range(9)drm_gpusvm_notifier_find(9)drm_gpusvm_range_find(9)drm_gpusvm_notifier_invalidate(9)drm_gpusvm_init(9)to_drm_gpusvm_notifier(9)drm_gpusvm_notifier_insert(9)drm_gpusvm_notifier_remove(9)drm_gpusvm_fini(9)drm_gpusvm_notifier_alloc(9)drm_gpusvm_notifier_free(9)to_drm_gpusvm_range(9)drm_gpusvm_range_insert(9)__drm_gpusvm_range_remove(9)drm_gpusvm_range_alloc(9)drm_gpusvm_hmm_pfn_to_order(9)drm_gpusvm_check_pages(9)drm_gpusvm_scan_mm(9)drm_gpusvm_range_chunk_size(9)drm_gpusvm_driver_lock_held(9)drm_gpusvm_find_vma_start(9)drm_gpusvm_range_find_or_insert(9)__drm_gpusvm_unmap_pages(9)__drm_gpusvm_free_pages(9)drm_gpusvm_free_pages(9)drm_gpusvm_range_remove(9)drm_gpusvm_range_get(9)drm_gpusvm_range_destroy(9)drm_gpusvm_range_put(9)drm_gpusvm_pages_valid(9)drm_gpusvm_pages_valid_unlocked(9)drm_gpusvm_unmap_pages(9)drm_gpusvm_range_evict(9)drm_gpusvm_has_mapping(9)drm_gpusvm_range_set_unmapped(9)
like, that's a whole friend group and you're gonna want to know all of them π
and that's the page!! π this lil manpage lives in ./drivers/gpu/drm, and it's stamped October 2026 β mwah, go read the actual source, ily, bye π§π
π¦ 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