drm_gpuvm_sm_map_ops_create(9)
π drm_gpuvm_sm_map_ops_create(9) β the Kernel API Manual page, bestie edition π
okay so this is from the Kernel API Manual, page drm_gpuvm_sm_map_ops_create(9), and honestly? it's giving "quiet little function that does SO much behind the scenes." let's get into it β¨
πΈ NAME πΈ
drm_gpuvm_sm_map_ops_create β creates the &drm_gpuva_ops to split and merge π«Ά
β SYNOPSIS β
struct drm_gpuva_ops * drm_gpuvm_sm_map_ops_create (struct drm_gpuvm
*gpuvm , const struct drm_gpuvm_map_req *req );
like, yes, it's a pointer-returning function with two args. we love a signature that fits on two lines π
π ARGUMENTS π
gpuvmβ thedrm_gpuvmthat represents the GPU VA space. it's the main character here, no cap πreqβ the map request arguments. the whole vibe of what you're asking for lives in here π¦
π₯ DESCRIPTION π₯
so what this bad boy does: it creates a list of operations to perform the splitting and merging of existing mapping(s) with the newly requested one. it's basically the group-chat moderator that sorts out who's sitting where π
you can iterate that list with drm_gpuva_for_each_op, and here's the thing β you must process it in the given order. fr fr, the order matters, bestie. the list can contain map, unmap and remap operations, but it can also be completely empty if no operation is required β like, say, if the requested mapping already exists in the exact same way. iconic behavior honestly π
some numbers so you know what you're working with:
- an arbitrary amount of unmap operations π
- a maximum of two remap operations βοΈ
- a single map operation β and that one represents the original map operation requested by the caller πΊοΈ
β οΈ okay this part is important, pay attention: 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,drm_gpuva_insert,drm_gpuva_destroy_lockedand/ordrm_gpuva_destroy_unlockedshould be used.
and after the caller finishes processing the returned drm_gpuva_ops, they must be freed with drm_gpuva_ops_free. yes, that's a must. free your memory, queen β¨
π RETURN π
a pointer to the drm_gpuva_ops on success, an ERR_PTR on failure. so check that pointer before you go celebrating π
π¦ SEE ALSO π¦
this list is LONG, so buckle up, bestie β grab a snack π
- 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_madvise_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)
and that's the whole page, bestie π this one came out of ./drivers/gpu/drm and it's dated October 2026 β so like, future vibes only πβ¨ go forth and split and merge responsibly π«Άπ
π¦ 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