drivers/gpu/drm/i915/display/intel_display_rps.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_display_rps.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_display_rps.c- Extension
.c- Size
- 2511 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/dma-fence.hdrm/drm_crtc.hdrm/drm_vblank.hintel_display_core.hintel_display_regs.hintel_display_irq.hintel_display_rps.hintel_display_types.hintel_parent.h
Detected Declarations
struct wait_rps_boostfunction do_rps_boostfunction intel_display_rps_boost_after_vblankfunction intel_display_rps_mark_interactivefunction ilk_display_rps_enablefunction ilk_display_rps_disablefunction ilk_display_rps_irq_handler
Annotated Snippet
struct wait_rps_boost {
struct wait_queue_entry wait;
struct drm_crtc *crtc;
struct dma_fence *fence;
};
static int do_rps_boost(struct wait_queue_entry *_wait,
unsigned mode, int sync, void *key)
{
struct wait_rps_boost *wait = container_of(_wait, typeof(*wait), wait);
struct intel_display *display = to_intel_display(wait->crtc->dev);
/*
* If we missed the vblank, but the request is already running it
* is reasonable to assume that it will complete before the next
* vblank without our intervention, so leave RPS alone if not started.
*/
intel_parent_rps_boost_if_not_started(display, wait->fence);
dma_fence_put(wait->fence);
drm_crtc_vblank_put(wait->crtc);
list_del(&wait->wait.entry);
kfree(wait);
return 1;
}
void intel_display_rps_boost_after_vblank(struct drm_crtc *crtc,
struct dma_fence *fence)
{
struct intel_display *display = to_intel_display(crtc->dev);
struct wait_rps_boost *wait;
if (!intel_parent_rps_available(display))
return;
if (DISPLAY_VER(display) < 6)
return;
if (drm_crtc_vblank_get(crtc))
return;
wait = kmalloc_obj(*wait);
if (!wait) {
drm_crtc_vblank_put(crtc);
return;
}
wait->fence = dma_fence_get(fence);
wait->crtc = crtc;
wait->wait.func = do_rps_boost;
wait->wait.flags = 0;
add_wait_queue(drm_crtc_vblank_waitqueue(crtc), &wait->wait);
}
void intel_display_rps_mark_interactive(struct intel_display *display,
struct intel_atomic_state *state,
bool interactive)
{
if (!intel_parent_rps_available(display))
return;
if (state->rps_interactive == interactive)
return;
intel_parent_rps_mark_interactive(display, interactive);
state->rps_interactive = interactive;
}
void ilk_display_rps_enable(struct intel_display *display)
{
spin_lock(&display->irq.lock);
ilk_enable_display_irq(display, DE_PCU_EVENT);
spin_unlock(&display->irq.lock);
}
void ilk_display_rps_disable(struct intel_display *display)
{
spin_lock(&display->irq.lock);
ilk_disable_display_irq(display, DE_PCU_EVENT);
spin_unlock(&display->irq.lock);
}
void ilk_display_rps_irq_handler(struct intel_display *display)
{
Annotation
- Immediate include surface: `linux/dma-fence.h`, `drm/drm_crtc.h`, `drm/drm_vblank.h`, `intel_display_core.h`, `intel_display_regs.h`, `intel_display_irq.h`, `intel_display_rps.h`, `intel_display_types.h`.
- Detected declarations: `struct wait_rps_boost`, `function do_rps_boost`, `function intel_display_rps_boost_after_vblank`, `function intel_display_rps_mark_interactive`, `function ilk_display_rps_enable`, `function ilk_display_rps_disable`, `function ilk_display_rps_irq_handler`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.