drivers/gpu/drm/amd/pm/amdgpu_pm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/amdgpu_pm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/amdgpu_pm.c- Extension
.c- Size
- 148034 bytes
- Lines
- 5146
- 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.
- 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
amdgpu.hamdgpu_drv.hamdgpu_pm.hamdgpu_dpm.hatom.hlinux/pci.hlinux/hwmon.hlinux/hwmon-sysfs.hlinux/nospec.hlinux/pm_runtime.hlinux/string_choices.hasm/processor.h
Detected Declarations
struct od_attributestruct od_kobjstruct od_feature_opsstruct od_feature_itemstruct od_feature_containerstruct od_feature_setstruct amdgpu_pm_policy_attrfunction amdgpu_pm_dev_state_checkfunction amdgpu_pm_get_accessfunction amdgpu_pm_get_access_if_activefunction amdgpu_pm_put_accessfunction amdgpu_get_power_dpm_statefunction amdgpu_set_power_dpm_statefunction clocksfunction amdgpu_set_power_dpm_force_performance_levelfunction amdgpu_get_pp_num_statesfunction amdgpu_get_pp_cur_statefunction amdgpu_get_pp_force_statefunction amdgpu_set_pp_force_statefunction amdgpu_get_pp_tablefunction amdgpu_set_pp_tablefunction amdgpu_set_pp_od_clk_voltagefunction amdgpu_get_pp_od_clk_voltagefunction statusfunction amdgpu_get_pp_featuresfunction amdgpu_get_pp_dpm_clockfunction linefunction amdgpu_set_pp_dpm_clockfunction amdgpu_get_pp_dpm_sclkfunction amdgpu_set_pp_dpm_sclkfunction amdgpu_get_pp_dpm_mclkfunction amdgpu_set_pp_dpm_mclkfunction amdgpu_get_pp_dpm_socclkfunction amdgpu_set_pp_dpm_socclkfunction amdgpu_get_pp_dpm_fclkfunction amdgpu_set_pp_dpm_fclkfunction amdgpu_get_pp_dpm_vclkfunction amdgpu_set_pp_dpm_vclkfunction amdgpu_get_pp_dpm_vclk1function amdgpu_set_pp_dpm_vclk1function amdgpu_get_pp_dpm_dclkfunction amdgpu_set_pp_dpm_dclkfunction amdgpu_get_pp_dpm_dclk1function amdgpu_set_pp_dpm_dclk1function amdgpu_get_pp_dpm_dcefclkfunction amdgpu_set_pp_dpm_dcefclkfunction amdgpu_get_pp_dpm_pciefunction amdgpu_set_pp_dpm_pcie
Annotated Snippet
static const struct file_operations amdgpu_debugfs_pm_prv_buffer_fops = {
.owner = THIS_MODULE,
.open = simple_open,
.read = amdgpu_pm_prv_buffer_read,
.llseek = default_llseek,
};
#endif
void amdgpu_debugfs_pm_init(struct amdgpu_device *adev)
{
#if defined(CONFIG_DEBUG_FS)
struct drm_minor *minor = adev_to_drm(adev)->primary;
struct dentry *root = minor->debugfs_root;
if (!adev->pm.dpm_enabled)
return;
debugfs_create_file("amdgpu_pm_info", 0444, root, adev,
&amdgpu_debugfs_pm_info_fops);
if (adev->pm.smu_prv_buffer_size > 0)
debugfs_create_file_size("amdgpu_pm_prv_buffer", 0444, root,
adev,
&amdgpu_debugfs_pm_prv_buffer_fops,
adev->pm.smu_prv_buffer_size);
amdgpu_dpm_stb_debug_fs_init(adev);
#endif
}
Annotation
- Immediate include surface: `amdgpu.h`, `amdgpu_drv.h`, `amdgpu_pm.h`, `amdgpu_dpm.h`, `atom.h`, `linux/pci.h`, `linux/hwmon.h`, `linux/hwmon-sysfs.h`.
- Detected declarations: `struct od_attribute`, `struct od_kobj`, `struct od_feature_ops`, `struct od_feature_item`, `struct od_feature_container`, `struct od_feature_set`, `struct amdgpu_pm_policy_attr`, `function amdgpu_pm_dev_state_check`, `function amdgpu_pm_get_access`, `function amdgpu_pm_get_access_if_active`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: pattern 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.