drm_vma_offs...ookup_locked(9)
πΈ NAME πΈ
okay so bestie, welcome to the drm_vma_offs...ookup_locked(9) page from the Kernel API Manual π. The function is drm_vma_offset_lookup_locked, and its whole vibe is literally find node in offset space β¨.
π¦ SYNOPSIS π¦
here's the signature, copied exactly because we do not mess with code:
struct drm_vma_offset_node * drm_vma_offset_lookup_locked (struct
drm_vma_offset_manager *mgr , unsigned long start , unsigned long pages
);
π ARGUMENTS π
mgrβ Manager object πstartβ Start address for object (page-based) πΈpagesβ Size of object (page-based) π
π DESCRIPTION π
Okay so, you give it a start address and an object size, and it finds a node. This returns the best match for the given node π₯. That is, start may point somewhere into a valid region and the given node will be returned, as long as the node spans the whole requested area (given the size in number of pages as pages) β¨.
π¨ Before lookup, the vma offset manager lookup lock must be acquired withdrm_vma_offset_lock_lookup. See there for an example. This can then be used to implement weakly referenced lookups usingkref_get_unless_zeroπ
π§ EXAMPLE π§
The original example section starts with a bare :, and then the code is literally this β copying it exactly, no edits:
drm_vma_offset_lock_lookup(mgr);
node = drm_vma_offset_lookup_locked(mgr);
if (node)
kref_get_unless_zero(container_of(node, sth, entr));
drm_vma_offset_unlock_lookup(mgr);
π₯ RETURN π₯
Returns NULL if no suitable node can be found. Otherwise, the best match is returned. It's the caller's responsibility to make sure the node doesn't get destroyed before the caller can access it π.
π SEE ALSO π
Kernel file ./drivers/gpu/drm/drm_vma_manager.c + these cuties:
vma offset manager(9)drm_vma_offset_manager_init(9)drm_vma_offset_manager_destroy(9)drm_vma_offset_add(9)drm_vma_offset_remove(9)drm_vma_node_allow(9)drm_vma_node_allow_once(9)drm_vma_node_revoke(9)drm_vma_node_is_allowed(9)
mwah π this page's source/version label is ./drivers/gpu/drm, it's dated October 2026, and the page name is drm_vma_offs...ookup_locked(9) β that's the footer tea, bestie π«Άβ¨
π¦ 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