drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h- Extension
.h- Size
- 23078 bytes
- Lines
- 701
- 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
clearstate_defs.hamdgpu_ring.hamdgpu_rlc.hamdgpu_imu.hsoc15.hamdgpu_ras.hamdgpu_ring_mux.hamdgpu_xcp.h
Detected Declarations
struct amdgpu_mecstruct amdgpu_mec_bitmapstruct kiq_pm4_funcsstruct amdgpu_kiqstruct amdgpu_rb_configstruct gb_addr_configstruct amdgpu_gfx_configstruct amdgpu_cu_infostruct amdgpu_gfx_rasstruct amdgpu_gfx_shadow_infostruct amdgpu_gfx_funcsstruct sq_workstruct amdgpu_pfpstruct amdgpu_cestruct amdgpu_mestruct amdgpu_isolation_workstruct amdgpu_gfxstruct amdgpu_gfx_ras_reg_entrystruct amdgpu_gfx_ras_mem_id_entryenum amdgpu_gfx_pipe_priorityenum amdgpu_gfx_partitionenum amdgpu_gfx_partition_mem_alloc_modeenum amdgpu_gfx_ras_mem_id_typeenum amdgpu_unmap_queues_actionfunction amdgpu_gfx_create_bitmask
Annotated Snippet
struct amdgpu_mec {
struct amdgpu_bo *hpd_eop_obj;
u64 hpd_eop_gpu_addr;
struct amdgpu_bo *mec_fw_obj;
u64 mec_fw_gpu_addr;
struct amdgpu_bo *mec_fw_data_obj;
u64 mec_fw_data_gpu_addr;
u32 num_mec;
u32 num_pipe_per_mec;
u32 num_queue_per_pipe;
void *mqd_backup[AMDGPU_MAX_COMPUTE_RINGS * AMDGPU_MAX_GC_INSTANCES];
};
struct amdgpu_mec_bitmap {
/* These are the resources for which amdgpu takes ownership */
DECLARE_BITMAP(queue_bitmap, AMDGPU_MAX_COMPUTE_QUEUES);
};
enum amdgpu_unmap_queues_action {
PREEMPT_QUEUES = 0,
RESET_QUEUES,
DISABLE_PROCESS_QUEUES,
PREEMPT_QUEUES_NO_UNMAP,
};
struct kiq_pm4_funcs {
/* Support ASIC-specific kiq pm4 packets*/
void (*kiq_set_resources)(struct amdgpu_ring *kiq_ring,
uint64_t queue_mask);
void (*kiq_map_queues)(struct amdgpu_ring *kiq_ring,
struct amdgpu_ring *ring);
void (*kiq_unmap_queues)(struct amdgpu_ring *kiq_ring,
struct amdgpu_ring *ring,
enum amdgpu_unmap_queues_action action,
u64 gpu_addr, u64 seq);
void (*kiq_query_status)(struct amdgpu_ring *kiq_ring,
struct amdgpu_ring *ring,
u64 addr,
u64 seq);
void (*kiq_invalidate_tlbs)(struct amdgpu_ring *kiq_ring,
uint16_t pasid, uint32_t flush_type,
bool all_hub);
void (*kiq_reset_hw_queue)(struct amdgpu_ring *kiq_ring,
uint32_t queue_type, uint32_t me_id,
uint32_t pipe_id, uint32_t queue_id,
uint32_t xcc_id, uint32_t vmid);
/* Packet sizes */
int set_resources_size;
int map_queues_size;
int unmap_queues_size;
int query_status_size;
int invalidate_tlbs_size;
};
struct amdgpu_kiq {
u64 eop_gpu_addr;
struct amdgpu_bo *eop_obj;
spinlock_t ring_lock;
struct amdgpu_ring ring;
struct amdgpu_irq_src irq;
const struct kiq_pm4_funcs *pmf;
void *mqd_backup;
};
/*
* GFX configurations
*/
#define AMDGPU_GFX_MAX_SE 4
#define AMDGPU_GFX_MAX_SH_PER_SE 2
/**
* amdgpu_rb_config - Configure a single Render Backend (RB)
*
* Bad RBs are fused off and there is a harvest register the driver reads to
* determine which RB(s) are fused off so that the driver can configure the
* hardware state so that nothing gets sent to them. There are also user
* harvest registers that the driver can program to disable additional RBs,
* etc., for testing purposes.
*/
struct amdgpu_rb_config {
/**
* @rb_backend_disable:
*
* The value captured from register RB_BACKEND_DISABLE indicates if the
* RB backend is disabled or not.
*/
uint32_t rb_backend_disable;
/**
Annotation
- Immediate include surface: `clearstate_defs.h`, `amdgpu_ring.h`, `amdgpu_rlc.h`, `amdgpu_imu.h`, `soc15.h`, `amdgpu_ras.h`, `amdgpu_ring_mux.h`, `amdgpu_xcp.h`.
- Detected declarations: `struct amdgpu_mec`, `struct amdgpu_mec_bitmap`, `struct kiq_pm4_funcs`, `struct amdgpu_kiq`, `struct amdgpu_rb_config`, `struct gb_addr_config`, `struct amdgpu_gfx_config`, `struct amdgpu_cu_info`, `struct amdgpu_gfx_ras`, `struct amdgpu_gfx_shadow_info`.
- 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.