drivers/gpu/drm/i915/i915_pmu.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/i915_pmu.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/i915_pmu.h- Extension
.h- Size
- 4080 bytes
- Lines
- 163
- 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
linux/hrtimer.hlinux/perf_event.hlinux/spinlock_types.huapi/drm/i915_drm.h
Detected Declarations
struct drm_i915_privatestruct intel_gtstruct i915_pmu_samplestruct i915_pmuenum i915_pmu_tracked_eventsfunction i915_pmu_register
Annotated Snippet
struct i915_pmu_sample {
u64 cur;
};
struct i915_pmu {
/**
* @base: PMU base.
*/
struct pmu base;
/**
* @registered: PMU is registered and not in the unregistering process.
*/
bool registered;
/**
* @name: Name as registered with perf core.
*/
const char *name;
/**
* @lock: Lock protecting enable mask and ref count handling.
*/
spinlock_t lock;
/**
* @unparked: GT unparked mask.
*/
unsigned int unparked;
/**
* @timer: Timer for internal i915 PMU sampling.
*/
struct hrtimer timer;
/**
* @enable: Bitmask of specific enabled events.
*
* For some events we need to track their state and do some internal
* house keeping.
*
* Each engine event sampler type and event listed in enum
* i915_pmu_tracked_events gets a bit in this field.
*
* Low bits are engine samplers and other events continue from there.
*/
u32 enable;
/**
* @timer_last:
*
* Timestamp of the previous timer invocation.
*/
ktime_t timer_last;
/**
* @enable_count: Reference counts for the enabled events.
*
* Array indices are mapped in the same way as bits in the @enable field
* and they are used to control sampling on/off when multiple clients
* are using the PMU API.
*/
unsigned int enable_count[I915_PMU_MASK_BITS];
/**
* @timer_enabled: Should the internal sampling timer be running.
*/
bool timer_enabled;
/**
* @sample: Current and previous (raw) counters for sampling events.
*
* These counters are updated from the i915 PMU sampling timer.
*
* Only global counters are held here, while the per-engine ones are in
* struct intel_engine_cs.
*/
struct i915_pmu_sample sample[I915_PMU_MAX_GT][__I915_NUM_PMU_SAMPLERS];
/**
* @sleep_last: Last time GT parked for RC6 estimation.
*/
ktime_t sleep_last[I915_PMU_MAX_GT];
/**
* @irq_count: Number of interrupts
*
* Intentionally unsigned long to avoid atomics or heuristics on 32bit.
* 4e9 interrupts are a lot and postprocessing can really deal with an
* occasional wraparound easily. It's 32bit after all.
*/
unsigned long irq_count;
/**
* @events_attr_group: Device events attribute group.
*/
struct attribute_group events_attr_group;
/**
* @i915_attr: Memory block holding device attributes.
*/
void *i915_attr;
Annotation
- Immediate include surface: `linux/hrtimer.h`, `linux/perf_event.h`, `linux/spinlock_types.h`, `uapi/drm/i915_drm.h`.
- Detected declarations: `struct drm_i915_private`, `struct intel_gt`, `struct i915_pmu_sample`, `struct i915_pmu`, `enum i915_pmu_tracked_events`, `function i915_pmu_register`.
- 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.