drivers/gpu/drm/i915/vlv_suspend.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/vlv_suspend.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/vlv_suspend.c- Extension
.c- Size
- 14742 bytes
- Lines
- 483
- 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.
- 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/string_helpers.hlinux/kernel.hdrm/drm_print.hdrm/intel/intel_gmd_interrupt_regs.hgt/intel_gt_regs.hi915_drv.hi915_reg.hi915_trace.hi915_utils.hi915_wait_util.hintel_clock_gating.hintel_uncore_trace.hvlv_suspend.h
Detected Declarations
struct vlv_s0ix_statefunction vlv_save_gunit_s0ix_statefunction vlv_restore_gunit_s0ix_statefunction vlv_wait_for_pw_statusfunction vlv_force_gfx_clockfunction vlv_allow_gt_wakefunction vlv_wait_for_gt_wellsfunction vlv_check_no_gt_accessfunction vlv_suspend_completefunction vlv_resume_preparefunction vlv_suspend_initfunction vlv_suspend_cleanup
Annotated Snippet
struct vlv_s0ix_state {
/* GAM */
u32 wr_watermark;
u32 gfx_prio_ctrl;
u32 arb_mode;
u32 gfx_pend_tlb0;
u32 gfx_pend_tlb1;
u32 lra_limits[GEN7_LRA_LIMITS_REG_NUM];
u32 media_max_req_count;
u32 gfx_max_req_count;
u32 render_hwsp;
u32 ecochk;
u32 bsd_hwsp;
u32 blt_hwsp;
u32 tlb_rd_addr;
/* MBC */
u32 g3dctl;
u32 gsckgctl;
u32 mbctl;
/* GCP */
u32 ucgctl1;
u32 ucgctl3;
u32 rcgctl1;
u32 rcgctl2;
u32 rstctl;
u32 misccpctl;
/* GPM */
u32 gfxpause;
u32 rpdeuhwtc;
u32 rpdeuc;
u32 ecobus;
u32 pwrdwnupctl;
u32 rp_down_timeout;
u32 rp_deucsw;
u32 rcubmabdtmr;
u32 rcedata;
u32 spare2gh;
/* Display 1 CZ domain */
u32 gt_imr;
u32 gt_ier;
u32 pm_imr;
u32 pm_ier;
u32 gt_scratch[GEN7_GT_SCRATCH_REG_NUM];
/* GT SA CZ domain */
u32 tilectl;
u32 gt_fifoctl;
u32 gtlc_wake_ctrl;
u32 gtlc_survive;
u32 pmwgicz;
/* Display 2 CZ domain */
u32 gu_ctl0;
u32 gu_ctl1;
u32 pcbr;
u32 clock_gate_dis2;
};
/*
* Save all Gunit registers that may be lost after a D3 and a subsequent
* S0i[R123] transition. The list of registers needing a save/restore is
* defined in the VLV2_S0IXRegs document. This documents marks all Gunit
* registers in the following way:
* - Driver: saved/restored by the driver
* - Punit : saved/restored by the Punit firmware
* - No, w/o marking: no need to save/restore, since the register is R/O or
* used internally by the HW in a way that doesn't depend
* keeping the content across a suspend/resume.
* - Debug : used for debugging
*
* We save/restore all registers marked with 'Driver', with the following
* exceptions:
* - Registers out of use, including also registers marked with 'Debug'.
* These have no effect on the driver's operation, so we don't save/restore
* them to reduce the overhead.
* - Registers that are fully setup by an initialization function called from
* the resume path. For example many clock gating and RPS/RC6 registers.
* - Registers that provide the right functionality with their reset defaults.
*
* TODO: Except for registers that based on the above 3 criteria can be safely
* ignored, we save/restore all others, practically treating the HW context as
* a black-box for the driver. Further investigation is needed to reduce the
* saved/restored registers even further, by following the same 3 criteria.
*/
static void vlv_save_gunit_s0ix_state(struct drm_i915_private *i915)
{
Annotation
- Immediate include surface: `linux/string_helpers.h`, `linux/kernel.h`, `drm/drm_print.h`, `drm/intel/intel_gmd_interrupt_regs.h`, `gt/intel_gt_regs.h`, `i915_drv.h`, `i915_reg.h`, `i915_trace.h`.
- Detected declarations: `struct vlv_s0ix_state`, `function vlv_save_gunit_s0ix_state`, `function vlv_restore_gunit_s0ix_state`, `function vlv_wait_for_pw_status`, `function vlv_force_gfx_clock`, `function vlv_allow_gt_wake`, `function vlv_wait_for_gt_wells`, `function vlv_check_no_gt_access`, `function vlv_suspend_complete`, `function vlv_resume_prepare`.
- 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.