drm_gpuvm_sm_map_ops_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the drm_gpuvm that 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 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, drm_gpuva_insert, drm_gpuva_destroy_locked and/or drm_gpuva_destroy_unlocked should 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 πŸ“


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