drivers/gpu/drm/i915/gt/intel_gt_pm_irq.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/intel_gt_pm_irq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/intel_gt_pm_irq.c- Extension
.c- Size
- 2431 bytes
- Lines
- 110
- 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
i915_drv.hi915_reg.hintel_gt.hintel_gt_irq.hintel_gt_pm_irq.hintel_gt_regs.h
Detected Declarations
function write_pm_imrfunction gen6_gt_pm_update_irqfunction gen6_gt_pm_unmask_irqfunction gen6_gt_pm_mask_irqfunction gen6_gt_pm_reset_iirfunction write_pm_ierfunction gen6_gt_pm_enable_irqfunction gen6_gt_pm_disable_irq
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2019 Intel Corporation
*/
#include "i915_drv.h"
#include "i915_reg.h"
#include "intel_gt.h"
#include "intel_gt_irq.h"
#include "intel_gt_pm_irq.h"
#include "intel_gt_regs.h"
static void write_pm_imr(struct intel_gt *gt)
{
struct drm_i915_private *i915 = gt->i915;
struct intel_uncore *uncore = gt->uncore;
u32 mask = gt->pm_imr;
i915_reg_t reg;
if (GRAPHICS_VER(i915) >= 11) {
reg = GEN11_GPM_WGBOXPERF_INTR_MASK;
mask <<= 16; /* pm is in upper half */
} else if (GRAPHICS_VER(i915) >= 8) {
reg = GEN8_GT_IMR(2);
} else {
reg = GEN6_PMIMR;
}
intel_uncore_write(uncore, reg, mask);
}
static void gen6_gt_pm_update_irq(struct intel_gt *gt,
u32 interrupt_mask,
u32 enabled_irq_mask)
{
u32 new_val;
WARN_ON(enabled_irq_mask & ~interrupt_mask);
lockdep_assert_held(gt->irq_lock);
new_val = gt->pm_imr;
new_val &= ~interrupt_mask;
new_val |= ~enabled_irq_mask & interrupt_mask;
if (new_val != gt->pm_imr) {
gt->pm_imr = new_val;
write_pm_imr(gt);
}
}
void gen6_gt_pm_unmask_irq(struct intel_gt *gt, u32 mask)
{
gen6_gt_pm_update_irq(gt, mask, mask);
}
void gen6_gt_pm_mask_irq(struct intel_gt *gt, u32 mask)
{
gen6_gt_pm_update_irq(gt, mask, 0);
}
void gen6_gt_pm_reset_iir(struct intel_gt *gt, u32 reset_mask)
{
struct intel_uncore *uncore = gt->uncore;
i915_reg_t reg = GRAPHICS_VER(gt->i915) >= 8 ? GEN8_GT_IIR(2) : GEN6_PMIIR;
lockdep_assert_held(gt->irq_lock);
intel_uncore_write(uncore, reg, reset_mask);
intel_uncore_write(uncore, reg, reset_mask);
intel_uncore_posting_read(uncore, reg);
}
static void write_pm_ier(struct intel_gt *gt)
{
struct drm_i915_private *i915 = gt->i915;
struct intel_uncore *uncore = gt->uncore;
u32 mask = gt->pm_ier;
i915_reg_t reg;
if (GRAPHICS_VER(i915) >= 11) {
reg = GEN11_GPM_WGBOXPERF_INTR_ENABLE;
mask <<= 16; /* pm is in upper half */
} else if (GRAPHICS_VER(i915) >= 8) {
reg = GEN8_GT_IER(2);
} else {
reg = GEN6_PMIER;
}
intel_uncore_write(uncore, reg, mask);
Annotation
- Immediate include surface: `i915_drv.h`, `i915_reg.h`, `intel_gt.h`, `intel_gt_irq.h`, `intel_gt_pm_irq.h`, `intel_gt_regs.h`.
- Detected declarations: `function write_pm_imr`, `function gen6_gt_pm_update_irq`, `function gen6_gt_pm_unmask_irq`, `function gen6_gt_pm_mask_irq`, `function gen6_gt_pm_reset_iir`, `function write_pm_ier`, `function gen6_gt_pm_enable_irq`, `function gen6_gt_pm_disable_irq`.
- 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.