drm_gpuvm_ma...e_ops_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” the drm_gpuvm that 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 the drm_gpuvm's view of the GPU VA space. the previously obtained operations must be either processed or abandoned. to update the drm_gpuvm's view of the GPU VA space you should use drm_gpuva_insert, drm_gpuva_destroy_locked and/or drm_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 πŸŽ€


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