drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c- Extension
.c- Size
- 3351 bytes
- Lines
- 96
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
amdgpu.hamdgpu_display.hhwmgr.hamdgpu_smu.hamdgpu_dpm_internal.h
Detected Declarations
function files
Annotated Snippet
list_for_each_entry(crtc, &ddev->mode_config.crtc_list, head) {
amdgpu_crtc = to_amdgpu_crtc(crtc);
/* The array should only contain active displays. */
if (!amdgpu_crtc->enabled)
continue;
conn = to_amdgpu_connector(amdgpu_crtc->connector);
display_cfg = &adev->pm.pm_display_cfg.displays[num_crtcs++];
if (amdgpu_crtc->hw_mode.clock) {
vrefresh = drm_mode_vrefresh(&amdgpu_crtc->hw_mode);
vblank_in_pixels =
amdgpu_crtc->hw_mode.crtc_htotal *
(amdgpu_crtc->hw_mode.crtc_vblank_end -
amdgpu_crtc->hw_mode.crtc_vdisplay +
(amdgpu_crtc->v_border * 2));
vblank_time_us =
vblank_in_pixels * 1000 / amdgpu_crtc->hw_mode.clock;
/* The legacy (non-DC) code has issues with mclk switching
* with refresh rates over 120 Hz. Disable mclk switching.
*/
if (vrefresh > 120)
vblank_time_us = 0;
/* Find minimum vblank time. */
if (vblank_time_us < cfg->min_vblank_time)
cfg->min_vblank_time = vblank_time_us;
/* Find vertical refresh rate of first active display. */
if (!cfg->vrefresh)
cfg->vrefresh = vrefresh;
}
if (amdgpu_crtc->crtc_id < cfg->crtc_index) {
/* Find first active CRTC and its line time. */
cfg->crtc_index = amdgpu_crtc->crtc_id;
cfg->line_time_in_us = amdgpu_crtc->line_time;
}
display_cfg->controller_id = amdgpu_crtc->crtc_id;
display_cfg->pixel_clock = conn->pixelclock_for_modeset;
}
}
cfg->display_clk = adev->clock.default_dispclk;
cfg->num_display = num_crtcs;
}
Annotation
- Immediate include surface: `amdgpu.h`, `amdgpu_display.h`, `hwmgr.h`, `amdgpu_smu.h`, `amdgpu_dpm_internal.h`.
- Detected declarations: `function files`.
- 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.