STRUCT DRM_GPUVM_BO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct drm_gpuvm_bo(9) β€” Kernel API Manual πŸ’–

okay so this is the Kernel API Manual entry for struct drm_gpuvm_bo, and it's basically the situationship between a drm_gpuvm and a drm_gem_object. It's giving "indirection that makes everything faster," bestie. Let's get into it. πŸ¦‹βœ¨

🌸 NAME 🌸

struct drm_gpuvm_bo β€” structure representing a &drm_gpuvm and &drm_gem_object combination. πŸ’…

✨ SYNOPSIS ✨

       struct drm_gpuvm_bo {
           struct drm_gpuvm *vm;
           struct drm_gem_object *obj;
           bool evicted;
           struct kref kref;
           struct {
             struct list_head gpuva;
             struct {
               struct list_head gem;
               struct list_head extobj;
               struct list_head evict;
               struct llist_node bo_defer;
             } entry;
           } list;
        };

πŸ‘‘ Members πŸ‘‘

  • vm β€” the drm_gpuvm that obj is mapped in. It's a reference counted pointer, so handle with care, queen. πŸ’–
  • obj β€” the drm_gem_object being mapped in vm. Also a reference counted pointer. πŸŽ€
  • evicted β€” tells you whether the drm_gem_object is evicted; this field is protected by the drm_gem_object's dma-resv lock. No cap. πŸ”’
  • kref β€” the reference count for this drm_gpuvm_bo. Keep track, bestie. πŸ‘‘
  • list β€” structure containing all list_heads.
  • list.gpuva β€” the list of linked drm_gpuvas.

It is safe to access entries from this list as long as the GEM's gpuva lock is held. See also struct drm_gem_object. 🫢

  • list.entry β€” structure containing all list_heads serving as entry.
    • list.entry.gem β€” list entry to attach to the gpuva list on the drm_gem_object.
    • list.entry.evict β€” list entry to attach to the drm_gpuvm's evict list.
    • list.entry.bo_defer β€” list entry to attach to the drm_gpuvm's bo_defer list.

πŸ’– Description πŸ’–

This structure is an abstraction representing a drm_gpuvm and drm_gem_object combination. It serves as an indirection to accelerate iterating all drm_gpuvas within a drm_gpuvm backed by the same drm_gem_object. Iconic behavior, honestly. ✨

Furthermore it is used to cache evicted GEM objects for a certain GPU-VM to accelerate validation. Lowkey a speedrun strat. πŸ”₯

Typically, drivers want to create an instance of a struct drm_gpuvm_bo once a GEM object is mapped first in a GPU-VM and release the instance once the last mapping of the GEM object in this GPU-VM is unmapped. Periodt. πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/drm/drm_gpuvm.h is the main character here, and it's bringing the whole crew:

okay that's the whole entire page, bestie β€” signed off from ./include/drm, October 2026, for struct drm_gpuvm_bo(9). πŸ’œβœ¨πŸ‘‘

πŸ“¦ where this page comes from