drivers/gpu/drm/radeon/radeon_pm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/radeon_pm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/radeon_pm.c- Extension
.c- Size
- 58698 bytes
- Lines
- 1964
- 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
linux/debugfs.hlinux/hwmon-sysfs.hlinux/hwmon.hlinux/pci.hlinux/power_supply.hdrm/drm_vblank.hatom.havivod.hr600_dpm.hradeon.hradeon_pm.h
Detected Declarations
struct radeon_dpm_quirkfunction radeon_pm_get_type_indexfunction radeon_pm_acpi_event_handlerfunction radeon_pm_update_profilefunction radeon_unmap_vram_bosfunction list_for_each_entry_safefunction radeon_sync_with_vblankfunction radeon_set_power_statefunction radeon_pm_set_clocksfunction drm_for_each_crtcfunction drm_for_each_crtcfunction radeon_pm_print_statesfunction radeon_get_pm_profilefunction radeon_set_pm_profilefunction radeon_get_pm_methodfunction radeon_set_pm_methodfunction radeon_get_dpm_statefunction radeon_set_dpm_statefunction radeon_get_dpm_forced_performance_levelfunction radeon_set_dpm_forced_performance_levelfunction radeon_hwmon_get_pwm1_enablefunction radeon_hwmon_set_pwm1_enablefunction radeon_hwmon_get_pwm1_minfunction radeon_hwmon_get_pwm1_maxfunction radeon_hwmon_set_pwm1function radeon_hwmon_get_pwm1function radeon_hwmon_show_tempfunction radeon_hwmon_show_temp_threshfunction radeon_hwmon_show_sclkfunction radeon_hwmon_show_vddcfunction hwmon_attributes_visiblefunction radeon_hwmon_initfunction radeon_hwmon_finifunction radeon_dpm_thermal_work_handlerfunction radeon_dpm_single_displayfunction radeon_dpm_change_power_state_lockedfunction radeon_dpm_enable_uvdfunction radeon_dpm_enable_vcefunction radeon_pm_suspend_oldfunction radeon_pm_suspend_dpmfunction radeon_pm_suspendfunction radeon_pm_resume_oldfunction radeon_pm_resume_dpmfunction radeon_pm_resumefunction radeon_pm_init_oldfunction radeon_dpm_print_power_statesfunction radeon_pm_init_dpmfunction radeon_pm_init
Annotated Snippet
struct radeon_dpm_quirk {
u32 chip_vendor;
u32 chip_device;
u32 subsys_vendor;
u32 subsys_device;
};
/* cards with dpm stability problems */
static struct radeon_dpm_quirk radeon_dpm_quirk_list[] = {
/* TURKS - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1386534 */
{ PCI_VENDOR_ID_ATI, 0x6759, 0x1682, 0x3195 },
/* TURKS - https://bugzilla.kernel.org/show_bug.cgi?id=83731 */
{ PCI_VENDOR_ID_ATI, 0x6840, 0x1179, 0xfb81 },
{ 0, 0, 0, 0 },
};
int radeon_pm_init(struct radeon_device *rdev)
{
struct radeon_dpm_quirk *p = radeon_dpm_quirk_list;
bool disable_dpm = false;
/* Apply dpm quirks */
while (p && p->chip_device != 0) {
if (rdev->pdev->vendor == p->chip_vendor &&
rdev->pdev->device == p->chip_device &&
rdev->pdev->subsystem_vendor == p->subsys_vendor &&
rdev->pdev->subsystem_device == p->subsys_device) {
disable_dpm = true;
break;
}
++p;
}
/* enable dpm on rv6xx+ */
switch (rdev->family) {
case CHIP_RV610:
case CHIP_RV630:
case CHIP_RV620:
case CHIP_RV635:
case CHIP_RV670:
case CHIP_RS780:
case CHIP_RS880:
case CHIP_RV770:
/* DPM requires the RLC, RV770+ dGPU requires SMC */
if (!rdev->rlc_fw)
rdev->pm.pm_method = PM_METHOD_PROFILE;
else if ((rdev->family >= CHIP_RV770) &&
(!(rdev->flags & RADEON_IS_IGP)) &&
(!rdev->smc_fw))
rdev->pm.pm_method = PM_METHOD_PROFILE;
else if (radeon_dpm == 1)
rdev->pm.pm_method = PM_METHOD_DPM;
else
rdev->pm.pm_method = PM_METHOD_PROFILE;
break;
case CHIP_RV730:
case CHIP_RV710:
case CHIP_RV740:
case CHIP_CEDAR:
case CHIP_REDWOOD:
case CHIP_JUNIPER:
case CHIP_CYPRESS:
case CHIP_HEMLOCK:
case CHIP_PALM:
case CHIP_SUMO:
case CHIP_SUMO2:
case CHIP_BARTS:
case CHIP_TURKS:
case CHIP_CAICOS:
case CHIP_CAYMAN:
case CHIP_ARUBA:
case CHIP_TAHITI:
case CHIP_PITCAIRN:
case CHIP_VERDE:
case CHIP_OLAND:
case CHIP_HAINAN:
case CHIP_BONAIRE:
case CHIP_KABINI:
case CHIP_KAVERI:
case CHIP_HAWAII:
case CHIP_MULLINS:
/* DPM requires the RLC, RV770+ dGPU requires SMC */
if (!rdev->rlc_fw)
rdev->pm.pm_method = PM_METHOD_PROFILE;
else if ((rdev->family >= CHIP_RV770) &&
(!(rdev->flags & RADEON_IS_IGP)) &&
(!rdev->smc_fw))
rdev->pm.pm_method = PM_METHOD_PROFILE;
else if (disable_dpm && (radeon_dpm == -1))
rdev->pm.pm_method = PM_METHOD_PROFILE;
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/hwmon-sysfs.h`, `linux/hwmon.h`, `linux/pci.h`, `linux/power_supply.h`, `drm/drm_vblank.h`, `atom.h`, `avivod.h`.
- Detected declarations: `struct radeon_dpm_quirk`, `function radeon_pm_get_type_index`, `function radeon_pm_acpi_event_handler`, `function radeon_pm_update_profile`, `function radeon_unmap_vram_bos`, `function list_for_each_entry_safe`, `function radeon_sync_with_vblank`, `function radeon_set_power_state`, `function radeon_pm_set_clocks`, `function drm_for_each_crtc`.
- 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.