drm_vma_offs...ookup_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 with drm_vma_offset_lock_lookup. See there for an example. This can then be used to implement weakly referenced lookups using kref_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:


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