drivers/gpu/drm/i915/gt/intel_engine_stats.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/intel_engine_stats.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/intel_engine_stats.h- Extension
.h- Size
- 1327 bytes
- Lines
- 62
- 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/atomic.hlinux/ktime.hlinux/seqlock.hi915_gem.hintel_engine.h
Detected Declarations
function intel_engine_context_infunction intel_engine_context_out
Annotated Snippet
#ifndef __INTEL_ENGINE_STATS_H__
#define __INTEL_ENGINE_STATS_H__
#include <linux/atomic.h>
#include <linux/ktime.h>
#include <linux/seqlock.h>
#include "i915_gem.h" /* GEM_BUG_ON */
#include "intel_engine.h"
static inline void intel_engine_context_in(struct intel_engine_cs *engine)
{
struct intel_engine_execlists_stats *stats = &engine->stats.execlists;
unsigned long flags;
if (stats->active) {
stats->active++;
return;
}
/* The writer is serialised; but the pmu reader may be from hardirq */
local_irq_save(flags);
write_seqcount_begin(&stats->lock);
stats->start = ktime_get();
stats->active++;
write_seqcount_end(&stats->lock);
local_irq_restore(flags);
GEM_BUG_ON(!stats->active);
}
static inline void intel_engine_context_out(struct intel_engine_cs *engine)
{
struct intel_engine_execlists_stats *stats = &engine->stats.execlists;
unsigned long flags;
GEM_BUG_ON(!stats->active);
if (stats->active > 1) {
stats->active--;
return;
}
local_irq_save(flags);
write_seqcount_begin(&stats->lock);
stats->active--;
stats->total = ktime_add(stats->total,
ktime_sub(ktime_get(), stats->start));
write_seqcount_end(&stats->lock);
local_irq_restore(flags);
}
#endif /* __INTEL_ENGINE_STATS_H__ */
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/ktime.h`, `linux/seqlock.h`, `i915_gem.h`, `intel_engine.h`.
- Detected declarations: `function intel_engine_context_in`, `function intel_engine_context_out`.
- 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.