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.

Dependency Surface

Detected Declarations

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

Implementation Notes