drivers/gpu/drm/xe/xe_vm.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_vm.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_vm.h- Extension
.h- Size
- 12682 bytes
- Lines
- 440
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xe_assert.hxe_bo_types.hxe_macros.hxe_map.hxe_vm_types.h
Detected Declarations
struct drm_devicestruct drm_printerstruct drm_filestruct ttm_buffer_objectstruct dma_fencestruct xe_exec_queuestruct xe_filestruct xe_pagefaultstruct xe_sync_entrystruct xe_svm_rangestruct drm_execfunction xe_vm_putfunction xe_vm_is_closedfunction xe_vm_is_bannedfunction xe_vm_is_closed_or_bannedfunction xe_vm_has_scratchfunction gpuvm_to_vmfunction xe_vma_startfunction xe_vma_sizefunction xe_vma_endfunction xe_vma_bo_offsetfunction xe_vma_read_onlyfunction xe_vma_userptrfunction xe_vma_is_nullfunction xe_vma_is_cpu_addr_mirrorfunction xe_vma_has_no_bofunction xe_vma_is_userptrfunction to_userptr_vmafunction xe_vm_in_fault_modefunction xe_vm_in_lr_modefunction xe_vm_in_preempt_fence_modefunction xe_vm_allow_vm_evictionfunction xe_vm_queue_rebind_workerfunction xe_vm_reactivate_rebindfunction xe_vm_resvfunction vm_dbgfunction xe_vm_set_validatingfunction xe_vm_clear_validatingfunction xe_vm_is_validatingfunction xe_vm_set_validation_execfunction xe_vm_validation_exec
Annotated Snippet
#ifndef _XE_VM_H_
#define _XE_VM_H_
#include "xe_assert.h"
#include "xe_bo_types.h"
#include "xe_macros.h"
#include "xe_map.h"
#include "xe_vm_types.h"
/**
* MAX_FAULTS_SAVED_PER_VM - Maximum number of faults each vm can store before future
* faults are discarded to prevent memory overuse
*/
#define MAX_FAULTS_SAVED_PER_VM 50
struct drm_device;
struct drm_printer;
struct drm_file;
struct ttm_buffer_object;
struct dma_fence;
struct xe_exec_queue;
struct xe_file;
struct xe_pagefault;
struct xe_sync_entry;
struct xe_svm_range;
struct drm_exec;
struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags, struct xe_file *xef);
struct xe_vm *xe_vm_lookup(struct xe_file *xef, u32 id);
int xe_vma_cmp_vma_cb(const void *key, const struct rb_node *node);
static inline struct xe_vm *xe_vm_get(struct xe_vm *vm)
{
drm_gpuvm_get(&vm->gpuvm);
return vm;
}
static inline void xe_vm_put(struct xe_vm *vm)
{
drm_gpuvm_put(&vm->gpuvm);
}
int xe_vm_lock(struct xe_vm *vm, bool intr);
void xe_vm_unlock(struct xe_vm *vm);
static inline bool xe_vm_is_closed(struct xe_vm *vm)
{
/* Only guaranteed not to change when vm->lock is held */
return !vm->size;
}
static inline bool xe_vm_is_banned(struct xe_vm *vm)
{
return vm->flags & XE_VM_FLAG_BANNED;
}
static inline bool xe_vm_is_closed_or_banned(struct xe_vm *vm)
{
lockdep_assert_held(&vm->lock);
return xe_vm_is_closed(vm) || xe_vm_is_banned(vm);
}
struct xe_vma *
xe_vm_find_overlapping_vma(struct xe_vm *vm, u64 start, u64 range);
bool xe_vma_has_default_mem_attrs(struct xe_vma *vma);
void xe_vm_find_cpu_addr_mirror_vma_range(struct xe_vm *vm,
u64 *start,
u64 *end);
/**
* xe_vm_has_scratch() - Whether the vm is configured for scratch PTEs
* @vm: The vm
*
* Return: whether the vm populates unmapped areas with scratch PTEs
*/
static inline bool xe_vm_has_scratch(const struct xe_vm *vm)
{
return vm->flags & XE_VM_FLAG_SCRATCH_PAGE;
}
/**
* gpuvm_to_vm() - Return the embedding xe_vm from a struct drm_gpuvm pointer
* @gpuvm: The struct drm_gpuvm pointer
*
Annotation
- Immediate include surface: `xe_assert.h`, `xe_bo_types.h`, `xe_macros.h`, `xe_map.h`, `xe_vm_types.h`.
- Detected declarations: `struct drm_device`, `struct drm_printer`, `struct drm_file`, `struct ttm_buffer_object`, `struct dma_fence`, `struct xe_exec_queue`, `struct xe_file`, `struct xe_pagefault`, `struct xe_sync_entry`, `struct xe_svm_range`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source 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.