drivers/gpu/drm/i915/gt/intel_gt_pm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/intel_gt_pm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/intel_gt_pm.c- Extension
.c- Size
- 10522 bytes
- Lines
- 435
- 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/string_helpers.hlinux/suspend.hdisplay/intel_display_power.hi915_drv.hi915_irq.hi915_params.hintel_context.hintel_engine_pm.hintel_gt.hintel_gt_clock_utils.hintel_gt_mcr.hintel_gt_pm.hintel_gt_print.hintel_gt_requests.hintel_llc.hintel_rc6.hintel_rps.hintel_wakeref.hpxp/intel_pxp_pm.hselftest_gt_pm.c
Detected Declarations
function user_forcewakefunction runtime_beginfunction runtime_endfunction __gt_unparkfunction __gt_parkfunction intel_gt_pm_init_earlyfunction intel_gt_pm_initfunction reset_enginesfunction gt_sanitizefunction for_each_enginefunction intel_gt_pm_finifunction intel_gt_resume_earlyfunction intel_gt_resumefunction for_each_enginefunction wait_for_suspendfunction intel_gt_suspend_preparefunction pm_suspend_targetfunction intel_gt_suspend_latefunction with_intel_runtime_pmfunction intel_gt_runtime_suspendfunction intel_gt_runtime_resumefunction __intel_gt_get_awake_timefunction intel_gt_get_awake_time
Annotated Snippet
if (err) {
gt_err(gt, "Failed to restart %s (%d)\n",
engine->name, err);
goto err_wedged;
}
}
intel_rc6_enable(>->rc6);
intel_uc_resume(>->uc);
user_forcewake(gt, false);
out_fw:
intel_uncore_forcewake_put(gt->uncore, FORCEWAKE_ALL);
intel_gt_pm_put(gt, wakeref);
intel_gt_bind_context_set_ready(gt);
return err;
err_wedged:
intel_gt_set_wedged(gt);
goto out_fw;
}
static void wait_for_suspend(struct intel_gt *gt)
{
if (!intel_gt_pm_is_awake(gt))
return;
if (intel_gt_wait_for_idle(gt, I915_GT_SUSPEND_IDLE_TIMEOUT) == -ETIME) {
/*
* Forcibly cancel outstanding work and leave
* the gpu quiet.
*/
intel_gt_set_wedged(gt);
intel_gt_retire_requests(gt);
}
intel_gt_pm_wait_for_idle(gt);
}
void intel_gt_suspend_prepare(struct intel_gt *gt)
{
intel_gt_bind_context_set_unready(gt);
user_forcewake(gt, true);
wait_for_suspend(gt);
}
static suspend_state_t pm_suspend_target(void)
{
#if IS_ENABLED(CONFIG_SUSPEND) && IS_ENABLED(CONFIG_PM_SLEEP)
return pm_suspend_target_state;
#else
return PM_SUSPEND_TO_IDLE;
#endif
}
void intel_gt_suspend_late(struct intel_gt *gt)
{
intel_wakeref_t wakeref;
/* We expect to be idle already; but also want to be independent */
wait_for_suspend(gt);
if (is_mock_gt(gt))
return;
GEM_BUG_ON(gt->awake);
intel_uc_suspend(>->uc);
/*
* On disabling the device, we want to turn off HW access to memory
* that we no longer own.
*
* However, not all suspend-states disable the device. S0 (s2idle)
* is effectively runtime-suspend, the device is left powered on
* but needs to be put into a low power state. We need to keep
* powermanagement enabled, but we also retain system state and so
* it remains safe to keep on using our allocated memory.
*/
if (pm_suspend_target() == PM_SUSPEND_TO_IDLE)
return;
with_intel_runtime_pm(gt->uncore->rpm, wakeref) {
intel_rps_disable(>->rps);
intel_rc6_disable(>->rc6);
intel_llc_disable(>->llc);
}
Annotation
- Immediate include surface: `linux/string_helpers.h`, `linux/suspend.h`, `display/intel_display_power.h`, `i915_drv.h`, `i915_irq.h`, `i915_params.h`, `intel_context.h`, `intel_engine_pm.h`.
- Detected declarations: `function user_forcewake`, `function runtime_begin`, `function runtime_end`, `function __gt_unpark`, `function __gt_park`, `function intel_gt_pm_init_early`, `function intel_gt_pm_init`, `function reset_engines`, `function gt_sanitize`, `function for_each_engine`.
- 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.