drivers/gpu/drm/i915/intel_clock_gating.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/intel_clock_gating.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/intel_clock_gating.c- Extension
.c- Size
- 18095 bytes
- Lines
- 544
- 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
drm/drm_print.hdrm/intel/intel_gmd_interrupt_regs.hdrm/intel/intel_gmd_misc_regs.hdrm/intel/mchbar_regs.hdisplay/intel_display_clock_gating.hdisplay/intel_pch.hgt/intel_engine_regs.hgt/intel_gt.hgt/intel_gt_mcr.hgt/intel_gt_regs.hi915_drv.hi915_reg.hintel_clock_gating.hvlv_iosf_sb.h
Detected Declarations
struct drm_i915_clock_gating_funcsfunction bxt_init_clock_gatingfunction glk_init_clock_gatingfunction ilk_init_clock_gatingfunction gen6_check_mch_setupfunction gen6_init_clock_gatingfunction gen8_set_l3sqc_creditsfunction dg2_init_clock_gatingfunction cfl_init_clock_gatingfunction kbl_init_clock_gatingfunction skl_init_clock_gatingfunction bdw_init_clock_gatingfunction hsw_init_clock_gatingfunction ivb_init_clock_gatingfunction vlv_init_clock_gatingfunction chv_init_clock_gatingfunction g4x_init_clock_gatingfunction i965gm_init_clock_gatingfunction i965g_init_clock_gatingfunction gen3_init_clock_gatingfunction i85x_init_clock_gatingfunction i830_init_clock_gatingfunction intel_clock_gating_initfunction nop_init_clock_gatingfunction intel_clock_gating_hooks_init
Annotated Snippet
struct drm_i915_clock_gating_funcs {
void (*init_clock_gating)(struct drm_i915_private *i915);
};
static void bxt_init_clock_gating(struct drm_i915_private *i915)
{
/* WaDisableSDEUnitClockGating:bxt */
intel_uncore_rmw(&i915->uncore, GEN8_UCGCTL6, 0, GEN8_SDEUNIT_CLOCK_GATE_DISABLE);
/*
* FIXME:
* GEN8_HDCUNIT_CLOCK_GATE_DISABLE_HDCREQ applies on 3x6 GT SKUs only.
*/
intel_uncore_rmw(&i915->uncore, GEN8_UCGCTL6, 0, GEN8_HDCUNIT_CLOCK_GATE_DISABLE_HDCREQ);
intel_display_bxt_init_clock_gating(i915->display);
}
static void glk_init_clock_gating(struct drm_i915_private *i915)
{
intel_display_glk_init_clock_gating(i915->display);
}
static void ilk_init_clock_gating(struct drm_i915_private *i915)
{
intel_uncore_write(&i915->uncore, PCH_3DCGDIS0,
MARIUNIT_CLOCK_GATE_DISABLE |
SVSMUNIT_CLOCK_GATE_DISABLE);
intel_uncore_write(&i915->uncore, PCH_3DCGDIS1,
VFMUNIT_CLOCK_GATE_DISABLE);
intel_display_ilk_init_clock_gating(i915->display);
intel_pch_init_clock_gating(i915->display);
}
static void gen6_check_mch_setup(struct drm_i915_private *i915)
{
u32 tmp;
tmp = intel_uncore_read(&i915->uncore, MCH_SSKPD);
if (REG_FIELD_GET(SSKPD_WM0_MASK_SNB, tmp) != 12)
drm_dbg_kms(&i915->drm,
"Wrong MCH_SSKPD value: 0x%08x This can cause underruns.\n",
tmp);
}
static void gen6_init_clock_gating(struct drm_i915_private *i915)
{
intel_display_gen6_init_clock_gating(i915->display);
intel_uncore_write(&i915->uncore, GEN6_UCGCTL1,
intel_uncore_read(&i915->uncore, GEN6_UCGCTL1) |
GEN6_BLBUNIT_CLOCK_GATE_DISABLE |
GEN6_CSUNIT_CLOCK_GATE_DISABLE);
/* According to the BSpec vol1g, bit 12 (RCPBUNIT) clock
* gating disable must be set. Failure to set it results in
* flickering pixels due to Z write ordering failures after
* some amount of runtime in the Mesa "fire" demo, and Unigine
* Sanctuary and Tropics, and apparently anything else with
* alpha test or pixel discard.
*
* According to the spec, bit 11 (RCCUNIT) must also be set,
* but we didn't debug actual testcases to find it out.
*
* WaDisableRCCUnitClockGating:snb
* WaDisableRCPBUnitClockGating:snb
*/
intel_uncore_write(&i915->uncore, GEN6_UCGCTL2,
GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
/*
* According to the spec the following bits should be
* set in order to enable memory self-refresh and fbc:
* The bit21 and bit22 of 0x42000
* The bit21 and bit22 of 0x42004
* The bit5 and bit7 of 0x42020
* The bit14 of 0x70180
* The bit14 of 0x71180
*
* WaFbcAsynchFlipDisableFbcQueue:snb
*/
intel_pch_init_clock_gating(i915->display);
gen6_check_mch_setup(i915);
}
static void gen8_set_l3sqc_credits(struct drm_i915_private *i915,
int general_prio_credits,
Annotation
- Immediate include surface: `drm/drm_print.h`, `drm/intel/intel_gmd_interrupt_regs.h`, `drm/intel/intel_gmd_misc_regs.h`, `drm/intel/mchbar_regs.h`, `display/intel_display_clock_gating.h`, `display/intel_pch.h`, `gt/intel_engine_regs.h`, `gt/intel_gt.h`.
- Detected declarations: `struct drm_i915_clock_gating_funcs`, `function bxt_init_clock_gating`, `function glk_init_clock_gating`, `function ilk_init_clock_gating`, `function gen6_check_mch_setup`, `function gen6_init_clock_gating`, `function gen8_set_l3sqc_credits`, `function dg2_init_clock_gating`, `function cfl_init_clock_gating`, `function kbl_init_clock_gating`.
- 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.