drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c- Extension
.c- Size
- 56863 bytes
- Lines
- 2346
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/kthread.hlinux/pci.hlinux/uaccess.hlinux/pm_runtime.hamdgpu.hamdgpu_pm.hamdgpu_dm_debugfs.hamdgpu_ras.hamdgpu_rap.hamdgpu_securedisplay.hamdgpu_fw_attestation.hamdgpu_umr.hamdgpu_reset.hamdgpu_psp_ta.hamdgpu_userq.h
Detected Declarations
function filesfunction amdgpu_debugfs_regs_readfunction amdgpu_debugfs_regs_writefunction amdgpu_debugfs_regs2_openfunction amdgpu_debugfs_regs2_releasefunction amdgpu_debugfs_regs2_opfunction amdgpu_debugfs_regs2_ioctlfunction amdgpu_debugfs_regs2_readfunction amdgpu_debugfs_regs2_writefunction amdgpu_debugfs_gprwave_openfunction amdgpu_debugfs_gprwave_releasefunction amdgpu_debugfs_gprwave_readfunction amdgpu_debugfs_gprwave_ioctlfunction amdgpu_debugfs_regs_pcie_readfunction amdgpu_debugfs_regs_pcie_writefunction amdgpu_debugfs_regs_pcie64_readfunction amdgpu_debugfs_regs_pcie64_writefunction amdgpu_debugfs_regs_didt_readfunction amdgpu_debugfs_regs_didt_writefunction amdgpu_debugfs_regs_smc_readfunction amdgpu_debugfs_regs_smc_writefunction amdgpu_debugfs_gca_config_readfunction amdgpu_debugfs_sensor_readfunction amdgpu_debugfs_wave_readfunction amdgpu_debugfs_gpr_readfunction amdgpu_debugfs_gfxoff_residency_readfunction amdgpu_debugfs_gfxoff_residency_writefunction amdgpu_debugfs_gfxoff_count_readfunction amdgpu_debugfs_gfxoff_writefunction amdgpu_debugfs_gfxoff_readfunction amdgpu_debugfs_gfxoff_status_readfunction amdgpu_debugfs_regs_initfunction amdgpu_debugfs_test_ib_showfunction amdgpu_debugfs_evict_vramfunction amdgpu_debugfs_evict_gttfunction amdgpu_debugfs_benchmarkfunction amdgpu_debugfs_vm_info_showfunction list_for_each_entryfunction amdgpu_ib_preempt_fences_swapfunction amdgpu_ib_preempt_signal_fencesfunction amdgpu_ib_preempt_job_recoveryfunction amdgpu_ib_preempt_mark_partial_jobfunction amdgpu_debugfs_ib_preemptfunction amdgpu_debugfs_sclk_setfunction amdgpu_debugfs_initfunction amdgpu_pt_info_readfunction amdgpu_pt_info_openfunction amdgpu_mqd_info_read
Annotated Snippet
static const struct file_operations amdgpu_debugfs_regs2_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = amdgpu_debugfs_regs2_ioctl,
.read = amdgpu_debugfs_regs2_read,
.write = amdgpu_debugfs_regs2_write,
.open = amdgpu_debugfs_regs2_open,
.release = amdgpu_debugfs_regs2_release,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_gprwave_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = amdgpu_debugfs_gprwave_ioctl,
.read = amdgpu_debugfs_gprwave_read,
.open = amdgpu_debugfs_gprwave_open,
.release = amdgpu_debugfs_gprwave_release,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_regs_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_regs_read,
.write = amdgpu_debugfs_regs_write,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_regs_didt_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_regs_didt_read,
.write = amdgpu_debugfs_regs_didt_write,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_regs_pcie_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_regs_pcie_read,
.write = amdgpu_debugfs_regs_pcie_write,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_regs_pcie64_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_regs_pcie64_read,
.write = amdgpu_debugfs_regs_pcie64_write,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_regs_smc_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_regs_smc_read,
.write = amdgpu_debugfs_regs_smc_write,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_gca_config_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_gca_config_read,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_sensors_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_sensor_read,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_wave_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_wave_read,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_gpr_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_gpr_read,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_gfxoff_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_gfxoff_read,
.write = amdgpu_debugfs_gfxoff_write,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_gfxoff_status_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_gfxoff_status_read,
.llseek = default_llseek
};
static const struct file_operations amdgpu_debugfs_gfxoff_count_fops = {
.owner = THIS_MODULE,
.read = amdgpu_debugfs_gfxoff_count_read,
.llseek = default_llseek
Annotation
- Immediate include surface: `linux/kthread.h`, `linux/pci.h`, `linux/uaccess.h`, `linux/pm_runtime.h`, `amdgpu.h`, `amdgpu_pm.h`, `amdgpu_dm_debugfs.h`, `amdgpu_ras.h`.
- Detected declarations: `function files`, `function amdgpu_debugfs_regs_read`, `function amdgpu_debugfs_regs_write`, `function amdgpu_debugfs_regs2_open`, `function amdgpu_debugfs_regs2_release`, `function amdgpu_debugfs_regs2_op`, `function amdgpu_debugfs_regs2_ioctl`, `function amdgpu_debugfs_regs2_read`, `function amdgpu_debugfs_regs2_write`, `function amdgpu_debugfs_gprwave_open`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.