drivers/gpu/drm/i915/display/intel_frontbuffer.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_frontbuffer.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_frontbuffer.c- Extension
.c- Size
- 8675 bytes
- Lines
- 242
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/drm_gem.hdrm/drm_print.hintel_display_trace.hintel_display_types.hintel_dp.hintel_drrs.hintel_fbc.hintel_frontbuffer.hintel_parent.hintel_psr.hintel_tdf.h
Detected Declarations
function filesfunction intel_frontbuffer_flipfunction __intel_frontbuffer_invalidatefunction __intel_frontbuffer_flushfunction intel_frontbuffer_flush_workfunction intel_frontbuffer_queue_flushfunction intel_frontbuffer_initfunction intel_frontbuffer_finifunction intel_frontbuffer_track
Annotated Snippet
#include <drm/drm_gem.h>
#include <drm/drm_print.h>
#include "intel_display_trace.h"
#include "intel_display_types.h"
#include "intel_dp.h"
#include "intel_drrs.h"
#include "intel_fbc.h"
#include "intel_frontbuffer.h"
#include "intel_parent.h"
#include "intel_psr.h"
#include "intel_tdf.h"
/**
* frontbuffer_flush - flush frontbuffer
* @display: display device
* @frontbuffer_bits: frontbuffer plane tracking bits
* @origin: which operation caused the flush
*
* This function gets called every time rendering on the given planes has
* completed and frontbuffer caching can be started again. Flushes will get
* delayed if they're blocked by some outstanding asynchronous rendering.
*
* Can be called without any locks held.
*/
static void frontbuffer_flush(struct intel_display *display,
unsigned int frontbuffer_bits,
enum fb_op_origin origin)
{
/* Delay flushing when rings are still busy.*/
spin_lock(&display->fb_tracking.lock);
frontbuffer_bits &= ~display->fb_tracking.busy_bits;
spin_unlock(&display->fb_tracking.lock);
if (!frontbuffer_bits)
return;
trace_intel_frontbuffer_flush(display, frontbuffer_bits, origin);
might_sleep();
intel_td_flush(display);
intel_drrs_flush(display, frontbuffer_bits);
intel_psr_flush(display, frontbuffer_bits, origin);
intel_fbc_flush(display, frontbuffer_bits, origin);
}
/**
* intel_frontbuffer_flip - synchronous frontbuffer flip
* @display: display device
* @frontbuffer_bits: frontbuffer plane tracking bits
*
* This function gets called after scheduling a flip on @obj. This is for
* synchronous plane updates which will happen on the next vblank and which will
* not get delayed by pending gpu rendering.
*
* Can be called without any locks held.
*/
void intel_frontbuffer_flip(struct intel_display *display,
unsigned frontbuffer_bits)
{
spin_lock(&display->fb_tracking.lock);
/* Remove stale busy bits due to the old buffer. */
display->fb_tracking.busy_bits &= ~frontbuffer_bits;
spin_unlock(&display->fb_tracking.lock);
frontbuffer_flush(display, frontbuffer_bits, ORIGIN_FLIP);
}
void __intel_frontbuffer_invalidate(struct intel_frontbuffer *front,
enum fb_op_origin origin,
unsigned int frontbuffer_bits)
{
struct intel_display *display = front->display;
if (origin == ORIGIN_CS) {
spin_lock(&display->fb_tracking.lock);
display->fb_tracking.busy_bits |= frontbuffer_bits;
spin_unlock(&display->fb_tracking.lock);
}
trace_intel_frontbuffer_invalidate(display, frontbuffer_bits, origin);
might_sleep();
intel_psr_invalidate(display, frontbuffer_bits, origin);
intel_drrs_invalidate(display, frontbuffer_bits);
intel_fbc_invalidate(display, frontbuffer_bits, origin);
}
void __intel_frontbuffer_flush(struct intel_frontbuffer *front,
enum fb_op_origin origin,
Annotation
- Immediate include surface: `drm/drm_gem.h`, `drm/drm_print.h`, `intel_display_trace.h`, `intel_display_types.h`, `intel_dp.h`, `intel_drrs.h`, `intel_fbc.h`, `intel_frontbuffer.h`.
- Detected declarations: `function files`, `function intel_frontbuffer_flip`, `function __intel_frontbuffer_invalidate`, `function __intel_frontbuffer_flush`, `function intel_frontbuffer_flush_work`, `function intel_frontbuffer_queue_flush`, `function intel_frontbuffer_init`, `function intel_frontbuffer_fini`, `function intel_frontbuffer_track`.
- 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.