drm_gpuvm_resv_add_fence(9)
π
drm_gpuvm_resv_add_fence(9) β your Kernel API Manual moment β¨
okay so bestie, welcome to the Kernel API Manual, and today's main character is drm_gpuvm_resv_add_fence(9). she's a void function, she returns nothing, and she's here to drop a fence into all the right dma-resv places. no cap. π
β¨ NAME β¨
drm_gpuvm_resv_add_fence β literally the "add fence to private and all extobj dma-resv" girlie π«Ά
πΈ SYNOPSIS πΈ
void drm_gpuvm_resv_add_fence (struct drm_gpuvm *gpuvm , struct drm_exec
*exec , struct dma_fence *fence , enum dma_resv_usage private_usage ,
enum dma_resv_usage extobj_usage );
that's the whole signature, copy it exactly, don't @ me π
π¦ ARGUMENTS π¦
gpuvmβ thestruct drm_gpuvm *we're adding a fence to, aka the whole vibe we're decorating β¨execβ thestruct drm_exec *locking context, she's holding the locks so we can do this safely πfenceβ thestruct dma_fence *we're actually adding, the guest of honour πprivate_usageβ theenum dma_resv_usagefor the private dma-resv, that's her personal lane πextobj_usageβ theenum dma_resv_usagefor the extobj dma-resv, the shared/external-object energy π
heads up bestie: the private usage and the extobj usage are separate parameters, so you literally cannot mix them up unless you're trying (don't try) π
π SEE ALSO π
start with the kernel file itself, bestie β ./drivers/gpu/drm/drm_gpuvm.c β and then the whole friend group shows up:
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_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_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)
that's the whole page, no crumbs left behind π§
and for the sign-off: this little beauty lives under ./drivers/gpu/drm, dated October 2026 β so go forth, add those fences to private and all extobj dma-resv, and slay ππ₯ periodt.
π¦ 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