drivers/gpu/drm/i915/gt/intel_gtt.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/intel_gtt.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/intel_gtt.h- Extension
.h- Size
- 21522 bytes
- Lines
- 708
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/io-mapping.hlinux/kref.hlinux/mm.hlinux/folio_batch.hlinux/scatterlist.hlinux/workqueue.hdrm/drm_mm.hgt/intel_reset.hi915_selftest.hi915_vma_resource.hi915_vma_types.hi915_params.hintel_memory_region.h
Detected Declarations
struct drm_i915_gem_objectstruct i915_fence_regstruct i915_vmastruct intel_gtstruct i915_page_tablestruct i915_page_directorystruct i915_vm_pt_stashstruct i915_vma_opsstruct i915_address_spacestruct i915_ggttstruct i915_ppgttfunction i915_vm_is_4lvlfunction i915_vm_has_scratch_64Kfunction i915_vm_min_alignmentfunction i915_vm_obj_min_alignmentfunction i915_vm_has_cache_coloringfunction i915_vm_to_ggttfunction i915_vm_to_ppgttfunction i915_vm_getfunction i915_vm_trygetfunction assert_vm_alivefunction i915_vm_putfunction i915_vm_resv_putfunction i915_pte_indexfunction i915_pte_countfunction i915_pde_indexfunction i915_pt_entryfunction i915_pd_entryfunction i915_page_dir_dma_addrfunction i915_ggtt_has_aperture
Annotated Snippet
struct i915_page_table {
struct drm_i915_gem_object *base;
union {
atomic_t used;
struct i915_page_table *stash;
};
bool is_compact;
};
struct i915_page_directory {
struct i915_page_table pt;
spinlock_t lock;
void **entry;
};
#define __px_choose_expr(x, type, expr, other) \
__builtin_choose_expr( \
__builtin_types_compatible_p(typeof(x), type) || \
__builtin_types_compatible_p(typeof(x), const type), \
({ type __x = (type)(x); expr; }), \
other)
#define px_base(px) \
__px_choose_expr(px, struct drm_i915_gem_object *, __x, \
__px_choose_expr(px, struct i915_page_table *, __x->base, \
__px_choose_expr(px, struct i915_page_directory *, __x->pt.base, \
(void)0)))
struct page *__px_page(struct drm_i915_gem_object *p);
dma_addr_t __px_dma(struct drm_i915_gem_object *p);
#define px_dma(px) (__px_dma(px_base(px)))
void *__px_vaddr(struct drm_i915_gem_object *p);
#define px_vaddr(px) (__px_vaddr(px_base(px)))
#define px_pt(px) \
__px_choose_expr(px, struct i915_page_table *, __x, \
__px_choose_expr(px, struct i915_page_directory *, &__x->pt, \
(void)0))
#define px_used(px) (&px_pt(px)->used)
struct i915_vm_pt_stash {
/* preallocated chains of page tables/directories */
struct i915_page_table *pt[2];
/*
* Optionally override the alignment/size of the physical page that
* contains each PT. If not set defaults back to the usual
* I915_GTT_PAGE_SIZE_4K. This does not influence the other paging
* structures. MUST be a power-of-two. ONLY applicable on discrete
* platforms.
*/
int pt_sz;
};
struct i915_vma_ops {
/* Map an object into an address space with the given cache flags. */
void (*bind_vma)(struct i915_address_space *vm,
struct i915_vm_pt_stash *stash,
struct i915_vma_resource *vma_res,
unsigned int pat_index,
u32 flags);
/*
* Unmap an object from an address space. This usually consists of
* setting the valid PTE entries to a reserved scratch page.
*/
void (*unbind_vma)(struct i915_address_space *vm,
struct i915_vma_resource *vma_res);
};
struct i915_address_space {
struct kref ref;
struct work_struct release_work;
struct drm_mm mm;
struct {
struct drm_i915_gem_object *obj;
struct i915_vma *vma;
} rsvd;
struct intel_gt *gt;
struct drm_i915_private *i915;
struct drm_i915_file_private *fpriv;
struct device *dma;
u64 total; /* size addr space maps (ex. 2GB for ggtt) */
u64 reserved; /* size addr space reserved */
u64 min_alignment[INTEL_MEMORY_STOLEN_LOCAL + 1];
unsigned int bind_async_flags;
struct mutex mutex; /* protects vma and our lists */
Annotation
- Immediate include surface: `linux/io-mapping.h`, `linux/kref.h`, `linux/mm.h`, `linux/folio_batch.h`, `linux/scatterlist.h`, `linux/workqueue.h`, `drm/drm_mm.h`, `gt/intel_reset.h`.
- Detected declarations: `struct drm_i915_gem_object`, `struct i915_fence_reg`, `struct i915_vma`, `struct intel_gt`, `struct i915_page_table`, `struct i915_page_directory`, `struct i915_vm_pt_stash`, `struct i915_vma_ops`, `struct i915_address_space`, `struct i915_ggtt`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.