drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h- Extension
.h- Size
- 11182 bytes
- Lines
- 359
- 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
drm/amdgpu_drm.hamdgpu.hamdgpu_res_cursor.hlinux/mmu_notifier.h
Detected Declarations
struct amdgpu_bo_paramstruct amdgpu_bo_va_mappingstruct amdgpu_bo_vastruct amdgpu_bostruct amdgpu_bo_userstruct amdgpu_bo_vmfunction amdgpu_mem_type_to_domainfunction amdgpu_bo_reservefunction amdgpu_bo_unreservefunction amdgpu_bo_sizefunction amdgpu_bo_ngpu_pagesfunction amdgpu_bo_gpu_page_alignmentfunction amdgpu_bo_mmap_offsetfunction amdgpu_bo_explicit_syncfunction amdgpu_bo_encryptedfunction to_amdgpu_sa_managerfunction amdgpu_sa_bo_gpu_addr
Annotated Snippet
struct amdgpu_bo_param {
unsigned long size;
int byte_align;
u32 bo_ptr_size;
u32 domain;
u32 preferred_domain;
u64 flags;
enum ttm_bo_type type;
bool no_wait_gpu;
struct dma_resv *resv;
void (*destroy)(struct ttm_buffer_object *bo);
/* xcp partition number plus 1, 0 means any partition */
int8_t xcp_id_plus1;
};
/* bo virtual addresses in a vm */
struct amdgpu_bo_va_mapping {
struct amdgpu_bo_va *bo_va;
struct list_head list;
struct rb_node rb;
uint64_t start;
uint64_t last;
uint64_t __subtree_last;
uint64_t offset;
uint32_t flags;
};
/* User space allocated BO in a VM */
struct amdgpu_bo_va {
struct amdgpu_vm_bo_base base;
/* protected by bo being reserved */
unsigned ref_count;
/* all other members protected by the VM PD being reserved */
struct dma_fence *last_pt_update;
/* mappings for this bo_va */
struct list_head invalids;
struct list_head valids;
/* If the mappings are cleared or filled */
bool cleared;
bool is_xgmi;
/*
* protected by vm reservation lock
* if non-zero, cannot unmap from GPU because user queues may still access it
*/
unsigned int queue_refcount;
/* Indicates if this buffer is mapped for any user queue. Once set, never reset. */
bool userq_va_mapped;
};
struct amdgpu_bo {
/* Protected by tbo.reserved */
u32 preferred_domains;
u32 allowed_domains;
struct ttm_place placements[AMDGPU_BO_MAX_PLACEMENTS];
struct ttm_placement placement;
struct ttm_buffer_object tbo;
struct ttm_bo_kmap_obj kmap;
u64 flags;
/* per VM structure for page tables and with virtual addresses */
struct amdgpu_vm_bo_base *vm_bo;
/* Constant after initialization */
struct amdgpu_bo *parent;
#ifdef CONFIG_MMU_NOTIFIER
struct mmu_interval_notifier notifier;
#endif
struct kgd_mem *kfd_bo;
/*
* For GPUs with spatial partitioning, xcp partition number, -1 means
* any partition. For other ASICs without spatial partition, always 0
* for memory accounting.
*/
int8_t xcp_id;
};
struct amdgpu_bo_user {
struct amdgpu_bo bo;
u64 tiling_flags;
u64 metadata_flags;
void *metadata;
u32 metadata_size;
};
Annotation
- Immediate include surface: `drm/amdgpu_drm.h`, `amdgpu.h`, `amdgpu_res_cursor.h`, `linux/mmu_notifier.h`.
- Detected declarations: `struct amdgpu_bo_param`, `struct amdgpu_bo_va_mapping`, `struct amdgpu_bo_va`, `struct amdgpu_bo`, `struct amdgpu_bo_user`, `struct amdgpu_bo_vm`, `function amdgpu_mem_type_to_domain`, `function amdgpu_bo_reserve`, `function amdgpu_bo_unreserve`, `function amdgpu_bo_size`.
- 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.