drivers/gpu/drm/amd/include/kgd_kfd_interface.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/include/kgd_kfd_interface.h- Extension
.h- Size
- 11714 bytes
- Lines
- 345
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/bitmap.hlinux/dma-fence.hamdgpu_irq.hamdgpu_gfx.hamdgpu_ptl.h
Detected Declarations
struct pci_devstruct amdgpu_devicestruct kfd_devstruct kgd_memstruct kfd_vm_fault_infostruct kfd_local_mem_infostruct kfd_cu_occupancystruct kgd2kfd_shared_resourcesstruct tile_configstruct kfd2kgd_callsenum kfd_preempt_typeenum kgd_memory_poolenum kfd_sched_policy
Annotated Snippet
struct kfd_vm_fault_info {
uint64_t page_addr;
uint32_t vmid;
uint32_t mc_id;
uint32_t status;
bool prot_valid;
bool prot_read;
bool prot_write;
bool prot_exec;
};
/* For getting GPU local memory information from KGD */
struct kfd_local_mem_info {
uint64_t local_mem_size_private;
uint64_t local_mem_size_public;
uint32_t vram_width;
uint32_t mem_clk_max;
};
enum kgd_memory_pool {
KGD_POOL_SYSTEM_CACHEABLE = 1,
KGD_POOL_SYSTEM_WRITECOMBINE = 2,
KGD_POOL_FRAMEBUFFER = 3,
};
struct kfd_cu_occupancy {
u32 wave_cnt;
u32 doorbell_off;
};
/**
* enum kfd_sched_policy
*
* @KFD_SCHED_POLICY_HWS: H/W scheduling policy known as command processor (cp)
* scheduling. In this scheduling mode we're using the firmware code to
* schedule the user mode queues and kernel queues such as HIQ and DIQ.
* the HIQ queue is used as a special queue that dispatches the configuration
* to the cp and the user mode queues list that are currently running.
* the DIQ queue is a debugging queue that dispatches debugging commands to the
* firmware.
* in this scheduling mode user mode queues over subscription feature is
* enabled.
*
* @KFD_SCHED_POLICY_HWS_NO_OVERSUBSCRIPTION: The same as above but the over
* subscription feature disabled.
*
* @KFD_SCHED_POLICY_NO_HWS: no H/W scheduling policy is a mode which directly
* set the command processor registers and sets the queues "manually". This
* mode is used *ONLY* for debugging proposes.
*
*/
enum kfd_sched_policy {
KFD_SCHED_POLICY_HWS = 0,
KFD_SCHED_POLICY_HWS_NO_OVERSUBSCRIPTION,
KFD_SCHED_POLICY_NO_HWS
};
struct kgd2kfd_shared_resources {
/* Bit n == 1 means VMID n is available for KFD. */
unsigned int compute_vmid_bitmap;
/* number of pipes per mec */
uint32_t num_pipe_per_mec;
/* number of queues per pipe */
uint32_t num_queue_per_pipe;
/* Bit n == 1 means Queue n is available for KFD */
DECLARE_BITMAP(cp_queue_bitmap, AMDGPU_MAX_QUEUES);
/* SDMA doorbell assignments (SOC15 and later chips only). Only
* specific doorbells are routed to each SDMA engine. Others
* are routed to IH and VCN. They are not usable by the CP.
*/
uint32_t *sdma_doorbell_idx;
/* From SOC15 onward, the doorbell index range not usable for CP
* queues.
*/
uint32_t non_cp_doorbells_start;
uint32_t non_cp_doorbells_end;
/* Base address of doorbell aperture. */
phys_addr_t doorbell_physical_address;
/* Size in bytes of doorbell aperture. */
size_t doorbell_aperture_size;
/* Number of bytes at start of aperture reserved for KGD. */
size_t doorbell_start_offset;
Annotation
- Immediate include surface: `linux/types.h`, `linux/bitmap.h`, `linux/dma-fence.h`, `amdgpu_irq.h`, `amdgpu_gfx.h`, `amdgpu_ptl.h`.
- Detected declarations: `struct pci_dev`, `struct amdgpu_device`, `struct kfd_dev`, `struct kgd_mem`, `struct kfd_vm_fault_info`, `struct kfd_local_mem_info`, `struct kfd_cu_occupancy`, `struct kgd2kfd_shared_resources`, `struct tile_config`, `struct kfd2kgd_calls`.
- 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.