drivers/gpu/drm/i915/i915_vma_resource.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/i915_vma_resource.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/i915_vma_resource.h- Extension
.h- Size
- 8379 bytes
- Lines
- 262
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/dma-fence.hlinux/refcount.hi915_gem.hi915_scatterlist.hi915_sw_fence.hintel_runtime_pm.h
Detected Declarations
struct intel_memory_regionstruct i915_page_sizesstruct i915_vma_bindinfostruct i915_vma_resourcefunction i915_vma_resource_putfunction i915_vma_resource_allocfunction i915_vma_resource_fini
Annotated Snippet
struct i915_page_sizes {
/**
* The sg mask of the pages sg_table. i.e the mask of
* the lengths for each sg entry.
*/
unsigned int phys;
/**
* The gtt page sizes we are allowed to use given the
* sg mask and the supported page sizes. This will
* express the smallest unit we can use for the whole
* object, as well as the larger sizes we may be able
* to use opportunistically.
*/
unsigned int sg;
};
/**
* struct i915_vma_bindinfo - Information needed for async bind
* only but that can be dropped after the bind has taken place.
* Consider making this a separate argument to the bind_vma
* op, coalescing with other arguments like vm, stash, cache_level
* and flags
* @pages: The pages sg-table.
* @page_sizes: Page sizes of the pages.
* @pages_rsgt: Refcounted sg-table when delayed object destruction
* is supported. May be NULL.
* @readonly: Whether the vma should be bound read-only.
* @lmem: Whether the vma points to lmem.
*/
struct i915_vma_bindinfo {
struct sg_table *pages;
struct i915_page_sizes page_sizes;
struct i915_refct_sgt *pages_rsgt;
bool readonly:1;
bool lmem:1;
};
/**
* struct i915_vma_resource - Snapshotted unbind information.
* @unbind_fence: Fence to mark unbinding complete. Note that this fence
* is not considered published until unbind is scheduled, and as such it
* is 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, which 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.
* @wakeref: wakeref.
* @vm: non-refcounted pointer to the vm. This is for internal use only and
* this member is cleared after vm_resource unbind.
* @mr: The memory region of the object pointed to by the vma.
* @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
*
* The lifetime of a struct i915_vma_resource is from a binding request to
* the actual possible asynchronous unbind has completed.
*/
struct i915_vma_resource {
struct dma_fence unbind_fence;
/* See above for description of the lock. */
spinlock_t lock;
refcount_t hold_count;
struct work_struct work;
struct i915_sw_fence chain;
struct rb_node rb;
u64 __subtree_last;
Annotation
- Immediate include surface: `linux/dma-fence.h`, `linux/refcount.h`, `i915_gem.h`, `i915_scatterlist.h`, `i915_sw_fence.h`, `intel_runtime_pm.h`.
- Detected declarations: `struct intel_memory_region`, `struct i915_page_sizes`, `struct i915_vma_bindinfo`, `struct i915_vma_resource`, `function i915_vma_resource_put`, `function i915_vma_resource_alloc`, `function i915_vma_resource_fini`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.