STRUCT I915_VMA_RESOURCE(9)
π 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β theunbind_fencelock.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 tostruct i915_sw_fenceused 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 aftervm_resourceunbind.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 backendi915_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 intoprivate. π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_workuses 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 forobj->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
- 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