drm_gpuvm_ma...e_ops_create(9)
β¨ drm_gpuvm_madvise_ops_create(9) β¨
okay so this is a page straight out of the Kernel API Manual bestie, and it's giving "niche GPU memory lore" energy. stick with me, it's actually slay π
π NAME π
drm_gpuvm_madvise_ops_create β literally creates the &drm_gpuva_ops needed to split stuff. that's the whole job. iconic.
π¦ SYNOPSIS π¦
struct drm_gpuva_ops * drm_gpuvm_madvise_ops_create (struct drm_gpuvm
*gpuvm , const struct drm_gpuvm_map_req *req );
πΈ ARGUMENTS πΈ
gpuvmβ thedrm_gpuvmthat represents the GPU VA space. main character of the address world β¨reqβ the map request arguments. like, what you're actually asking for π
π₯ DESCRIPTION π₯
so what this function does is it makes a list of operations to perform the splitting of existent mapping(s) at the start or the end, all based on the request map. ngl it's lowkey doing surgery on your mappings.
the list can be iterated with drm_gpuva_for_each_op and must be processed in the given order. no skipping, no shuffling, order matters, periodt. it can contain map and remap operations, but it also can be empty if no operation is required β like, for example, if the requested mapping already exists in the exact same way. empty list, no notes, we move π
there will be no unmap operations, a maximum of two remap operations and two map operations. the two map operations correspond to: one from start to the end of drm_gpuvaX, and another from the start of drm_gpuvaY to end. those are the two besties π«Ά
bestie heads up π β before calling this function again with another mapping request it is necessary to update thedrm_gpuvm's view of the GPU VA space. the previously obtained operations must be either processed or abandoned. to update thedrm_gpuvm's view of the GPU VA space you should usedrm_gpuva_insert,drm_gpuva_destroy_lockedand/ordrm_gpuva_destroy_unlocked. don't skip this step, i'm literally begging π
and after the caller finished processing the returned drm_gpuva_ops, they must free them with drm_gpuva_ops_free. clean up after yourself, it's not cute to leak π
β RETURN β
a pointer to the drm_gpuva_ops on success, an ERR_PTR on failure. so like, check it before you use it, iykyk π
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/drm_gpuvm.c - Overview(9)
- Split and Merge(9)
- Madvise Logic - Splitting and Traversal(9)
- Locking(9)
- Examples(9)
get_next_vm_bo_from_list(9)for_each_vm_bo_in_list(9)restore_vm_bo_list(9)drm_gpuvm_bo_is_zombie(9)drm_gpuvm_bo_list_add(9)drm_gpuvm_bo_list_del_init(9)drm_gpuvm_bo_list_del(9)drm_gpuvm_range_valid(9)drm_gpuvm_resv_object_alloc(9)drm_gpuvm_init(9)drm_gpuvm_put(9)drm_gpuvm_prepare_vm(9)drm_gpuvm_prepare_objects(9)drm_gpuvm_prepare_range(9)drm_gpuvm_exec_lock(9)drm_gpuvm_exec_lock_array(9)drm_gpuvm_exec_lock_range(9)drm_gpuvm_validate(9)drm_gpuvm_resv_add_fence(9)drm_gpuvm_bo_create(9)drm_gpuvm_bo_put(9)drm_gpuvm_bo_put_deferred(9)drm_gpuvm_bo_deferred_cleanup(9)drm_gpuvm_bo_find(9)drm_gpuvm_bo_obtain_locked(9)drm_gpuvm_bo_obtain_prealloc(9)drm_gpuvm_bo_extobj_add(9)drm_gpuvm_bo_evict(9)drm_gpuva_insert(9)drm_gpuva_remove(9)drm_gpuva_link(9)drm_gpuva_unlink(9)drm_gpuva_unlink_defer(9)drm_gpuva_find_first(9)drm_gpuva_find(9)drm_gpuvm_interval_empty(9)drm_gpuva_map(9)drm_gpuva_remap(9)drm_gpuva_unmap(9)drm_gpuvm_sm_map(9)drm_gpuvm_sm_unmap(9)drm_gpuvm_sm_map_exec_lock(9)drm_gpuvm_sm_unmap_exec_lock(9)drm_gpuvm_sm_map_ops_create(9)drm_gpuvm_sm_unmap_ops_create(9)drm_gpuvm_prefetch_ops_create(9)drm_gpuvm_bo_unmap_ops_create(9)drm_gpuva_ops_free(9)
okay that's the whole page, no cap π and for the credits moment: this one lives in ./drivers/gpu/drm and it's dated October 2026. slay, go split some mappings responsibly bestie π§β¨
π¦ 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