drivers/gpu/drm/xe/xe_vm_types.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_vm_types.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_vm_types.h- Extension
.h- Size
- 16488 bytes
- Lines
- 557
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/drm_gpusvm.hdrm/drm_gpuvm.hdrm/drm_pagemap_util.hlinux/dma-resv.hlinux/kref.hlinux/mmu_notifier.hlinux/scatterlist.hxe_device_types.hxe_pt_types.hxe_range_fence.hxe_tlb_inval_types.hxe_userptr.h
Detected Declarations
struct drm_pagemapstruct xe_bostruct xe_pagefaultstruct xe_svm_rangestruct xe_sync_entrystruct xe_user_fencestruct xe_vmstruct xe_vm_pgtable_update_opstruct xe_vma_mem_attrstruct xe_vma_preferred_locstruct xe_vmastruct xe_userptr_vmastruct xe_devicestruct xe_vm_fault_entrystruct xe_vmstruct xe_vma_op_mapstruct xe_vma_op_remapstruct xe_vma_op_prefetchstruct xe_vma_op_map_rangestruct xe_vma_op_unmap_rangestruct xe_vma_op_prefetch_rangestruct xe_vma_opstruct xe_vma_opsenum xe_vma_op_flagsenum xe_vma_subop
Annotated Snippet
struct xe_vma_mem_attr {
/** @preferred_loc: preferred memory_location */
struct xe_vma_preferred_loc {
/** @preferred_loc.migration_policy: Pages migration policy */
u32 migration_policy;
/**
* @preferred_loc.devmem_fd: used for determining pagemap_fd
* requested by user DRM_XE_PREFERRED_LOC_DEFAULT_SYSTEM and
* DRM_XE_PREFERRED_LOC_DEFAULT_DEVICE mean system memory or
* closest device memory respectively.
*/
u32 devmem_fd;
/**
* @preferred_loc.dpagemap: Reference-counted pointer to the drm_pagemap preferred
* for migration on a SVM page-fault. The pointer is protected by the
* vm lock, and is %NULL if @devmem_fd should be consulted for special
* values.
*/
struct drm_pagemap *dpagemap;
} preferred_loc;
/**
* @atomic_access: The atomic access type for the vma
* See %DRM_XE_VMA_ATOMIC_UNDEFINED, %DRM_XE_VMA_ATOMIC_DEVICE,
* %DRM_XE_VMA_ATOMIC_GLOBAL, and %DRM_XE_VMA_ATOMIC_CPU for possible
* values. These are defined in uapi/drm/xe_drm.h.
*/
u32 atomic_access;
/**
* @default_pat_index: The pat index for VMA set during first bind by user.
*/
u16 default_pat_index;
/**
* @pat_index: The pat index to use when encoding the PTEs for this vma.
* same as default_pat_index unless overwritten by madvise.
*/
u16 pat_index;
/**
* @purgeable_state: Purgeable hint for this VMA mapping
*
* Per-VMA purgeable state from madvise. Valid states are WILLNEED (0)
* or DONTNEED (1). Shared BOs require all VMAs to be DONTNEED before
* the BO can be purged. PURGED state exists only at BO level.
*
* Protected by BO dma-resv lock. Set via DRM_IOCTL_XE_MADVISE.
*/
u32 purgeable_state;
};
struct xe_vma {
/** @gpuva: Base GPUVA object */
struct drm_gpuva gpuva;
/**
* @combined_links: links into lists which are mutually exclusive.
* Locking: vm lock in write mode OR vm lock in read mode and the vm's
* resv.
*/
union {
/** @rebind: link into VM if this VMA needs rebinding. */
struct list_head rebind;
/** @destroy: link to contested list when VM is being closed. */
struct list_head destroy;
} combined_links;
union {
/** @destroy_cb: callback to destroy VMA when unbind job is done */
struct dma_fence_cb destroy_cb;
/** @destroy_work: worker to destroy this BO */
struct work_struct destroy_work;
};
/**
* @tile_invalidated: Tile mask of binding are invalidated for this VMA.
* protected by BO's resv and for userptrs, vm->svm.gpusvm.notifier_lock in
* write mode for writing or vm->svm.gpusvm.notifier_lock in read mode and
* the vm->resv. For stable reading, BO's resv or userptr
* vm->svm.gpusvm.notifier_lock in read mode is required. Can be
* opportunistically read with READ_ONCE outside of locks.
*/
u8 tile_invalidated;
/** @tile_mask: Tile mask of where to create binding for this VMA */
u8 tile_mask;
/**
Annotation
- Immediate include surface: `drm/drm_gpusvm.h`, `drm/drm_gpuvm.h`, `drm/drm_pagemap_util.h`, `linux/dma-resv.h`, `linux/kref.h`, `linux/mmu_notifier.h`, `linux/scatterlist.h`, `xe_device_types.h`.
- Detected declarations: `struct drm_pagemap`, `struct xe_bo`, `struct xe_pagefault`, `struct xe_svm_range`, `struct xe_sync_entry`, `struct xe_user_fence`, `struct xe_vm`, `struct xe_vm_pgtable_update_op`, `struct xe_vma_mem_attr`, `struct xe_vma_preferred_loc`.
- 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.