drm_gpuvm_bo...ain_prealloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_gpuvm_bo_obtain_prealloc(9) β€” from the Kernel API Manual, bestie

okay so picture this: you're deep in the kernel, you've got a &drm_gpuvm and a &drm_gem_object, and you just want the &drm_gpuvm_bo that represents them together. that's literally this function. no cap. πŸ¦‹


✨ NAME ✨

drm_gpuvm_bo_obtain_prealloc β€” obtains an instance of the &drm_gpuvm_bo for the given &drm_gpuvm and &drm_gem_object. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

struct drm_gpuvm_bo * drm_gpuvm_bo_obtain_prealloc (struct drm_gpuvm_bo
*__vm_bo );

🧚 ARGUMENTS 🧚

  • __vm_bo β€” a pre-allocated struct drm_gpuvm_bo. yes, you bring your own. it's giving prepared, organised, main character energy. πŸ’–

πŸ”₯ DESCRIPTION πŸ”₯

So here's the tea. πŸ“

It finds the drm_gpuvm_bo representing the combination of the given drm_gpuvm and drm_gem_object.

If it is found? slay β€” it increases the reference count of the found drm_gpuvm_bo accordingly, while the __vm_bo reference count is decreased. swappy swap, both counts handled, no leaks, we love to see it. ✨

If it is not found? __vm_bo is returned without further increase of the reference count. iconic behaviour, honestly.

⚠️ okay important warning time, don't skip this: the provided __vm_bo must not already be in the gpuva, evict, or extobj lists prior to calling this method. fr fr. do not do it. 😭

A new drm_gpuvm_bo is added to the GEMs gpuva list. noted. πŸ’…


🌈 RETURN 🌈

a pointer to the found drm_gpuvm_bo or __vm_bo if no existing drm_gpuvm_bo was found. either way you get a pointer, king behaviour. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

the whole squad, obviously β€” Kernel file ./drivers/gpu/drm/drm_gpuvm.c plus: 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_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 friend group, mwah. πŸ’œ


that's the page!! this one came out of ./drivers/gpu/drm and it's dated October 2026 β€” so bestie, go forth and obtain those preallocated bo's responsibly. you got this πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from