STRUCT I915_VMA_RESOURCE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct i915_vma_resource(9) πŸ’–

okay bestie, welcome to the Kernel API Manual page for struct i915_vma_resource(9) β€” it’s giving snapshotted unbind information and we’re gonna get into every single member, no skipping, periodt. πŸ’…


🌸 NAME 🌸

struct i915_vma_resource β€” Snapshotted unbind information. That’s the whole vibe. ✨


✨ SYNOPSIS ✨

Here’s the struct, bestie β€” verbatim, don’t touch the code block:

struct i915_vma_resource {
    struct dma_fence unbind_fence;
    spinlock_t lock;
    refcount_t hold_count;
    struct work_struct work;
    struct i915_sw_fence chain;
    struct rb_node rb;
    u64 __subtree_last;
    struct i915_address_space *vm;
    intel_wakeref_t wakeref;
    struct i915_vma_bindinfo bi;
  #if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR);
    struct intel_memory_region *mr;
  #endif;
    const struct i915_vma_ops *ops;
    void *private;
    u64 start;
    u64 node_size;
    u64 vma_size;
    u32 guard;
    u32 page_sizes_gtt;
    u32 bound_flags;
    bool allocated:1;
    bool immediate_unbind:1;
    bool needs_wakeref:1;
    bool skip_pte_rewrite:1;
    u32 *tlb;
 };

🫢 Members 🫢

  • unbind_fence β€” the fence that marks unbinding complete. Important caveat bestie: this fence is not considered published until unbind is scheduled, and because of that it’s illegal to access this fence before scheduled unbind other than for refcounting. 😭
  • lock β€” the unbind_fence lock.
  • hold_count β€” number of holders blocking the fence from finishing. The vma itself is keeping a hold, and that hold is released when unbind is scheduled. πŸŽ€
  • work β€” work struct for deferred unbind work.
  • chain β€” pointer to struct i915_sw_fence used to await dependencies.
  • rb β€” rb node for the vm's pending unbind interval tree. 🌈
  • __subtree_last β€” interval tree private member.
  • vm β€” non-refcounted pointer to the vm. This is for internal use only, and this member is cleared after vm_resource unbind.
  • wakeref β€” wakeref. That’s it. That’s the member. πŸ’€
  • bi β€” information needed for async bind only, but that can be dropped after the bind has taken place.

Also, little note from the page: Consider making this a separate argument to the bind_vma op, coalescing with other arguments like vm, stash, cache_level and flags.

  • mr β€” the memory region of the object pointed to by the vma. It lives inside the #if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR); block in the struct above. πŸ¦‹
  • ops β€” pointer to the backend i915_vma_ops.
  • private β€” bind backend private info.
  • start β€” offset into the address space of bind range start. Note that this is after any padding that might have been allocated. ✨
  • node_size β€” size of the allocated range manager node with padding subtracted.
  • vma_size β€” bind size.
  • guard β€” the size of guard area preceding and trailing the bind.
  • page_sizes_gtt β€” resulting page sizes from the bind operation.
  • bound_flags β€” flags indicating binding status.
  • allocated β€” backend private data. TODO: should move into private. πŸ‘‘
  • immediate_unbind β€” unbind can be done immediately and doesn't need to be deferred to a work item awaiting unsignaled fences. This is a hack. (dma_fence_work uses a fence flag for this, but this seems slightly cleaner).
  • needs_wakeref β€” whether a wakeref is needed during unbind. Since we can't take a wakeref in the dma-fence signalling critical path, it needs to be taken when the unbind is scheduled. πŸ”₯
  • skip_pte_rewrite β€” during ggtt suspend and vm takedown, pte rewriting needs to be skipped for unbind.
  • tlb β€” pointer for obj->mm.tlb, if async unbind. Otherwise, NULL.

πŸ’œ Description πŸ’œ

The lifetime of a struct i915_vma_resource is from a binding request to the actual possible asynchronous unbind has completed. That’s the whole arc, bestie. 🧚


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/gpu/drm/i915/i915_vma_resource.h, plus struct i915_vma_bindinfo(9), i915_vma_resource_get(9), i915_vma_resource_put(9), and i915_vma_resource_init(9).


okay that’s the page, mwah πŸ’… β€” source/version vibe is ./drivers/gpu/drm/i915, date is October 2026, and the footer title energy is struct i915_vma_resource(9). byeee πŸ«ΆπŸ’–

πŸ“¦ where this page comes from