drivers/gpu/drm/i915/display/intel_drrs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_drrs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_drrs.c- Extension
.c- Size
- 11671 bytes
- Lines
- 422
- 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
linux/debugfs.hdrm/drm_print.hintel_atomic.hintel_de.hintel_display_regs.hintel_display_types.hintel_drrs.hintel_frontbuffer.hintel_panel.h
Detected Declarations
function Switchingfunction intel_cpu_transcoder_has_drrsfunction intel_drrs_set_refresh_rate_pipeconffunction intel_drrs_set_refresh_rate_m_nfunction intel_drrs_is_activefunction intel_drrs_set_statefunction intel_drrs_schedule_workfunction intel_drrs_frontbuffer_bitsfunction intel_drrs_activatefunction intel_drrs_deactivatefunction intel_drrs_downclock_workfunction intel_drrs_frontbuffer_updatefunction for_each_intel_crtcfunction intel_drrs_invalidatefunction intel_drrs_flushfunction intel_drrs_crtc_initfunction intel_drrs_debugfs_status_showfunction intel_drrs_debugfs_ctl_setfunction intel_drrs_crtc_debugfs_addfunction intel_drrs_debugfs_type_showfunction intel_drrs_connector_debugfs_add
Annotated Snippet
if (!frontbuffer_bits) {
mutex_unlock(&crtc->drrs.mutex);
continue;
}
if (invalidate)
crtc->drrs.busy_frontbuffer_bits |= frontbuffer_bits;
else
crtc->drrs.busy_frontbuffer_bits &= ~frontbuffer_bits;
/* flush/invalidate means busy screen hence upclock */
intel_drrs_set_state(crtc, DRRS_REFRESH_RATE_HIGH);
/*
* flush also means no more activity hence schedule downclock, if all
* other fbs are quiescent too
*/
if (!crtc->drrs.busy_frontbuffer_bits)
intel_drrs_schedule_work(crtc);
else
cancel_delayed_work(&crtc->drrs.work);
mutex_unlock(&crtc->drrs.mutex);
}
}
/**
* intel_drrs_invalidate - Disable Idleness DRRS
* @display: display device
* @frontbuffer_bits: frontbuffer plane tracking bits
*
* This function gets called everytime rendering on the given planes start.
* Hence DRRS needs to be Upclocked, i.e. (LOW_RR -> HIGH_RR).
*
* Dirty frontbuffers relevant to DRRS are tracked in busy_frontbuffer_bits.
*/
void intel_drrs_invalidate(struct intel_display *display,
unsigned int frontbuffer_bits)
{
intel_drrs_frontbuffer_update(display, frontbuffer_bits, true);
}
/**
* intel_drrs_flush - Restart Idleness DRRS
* @display: display device
* @frontbuffer_bits: frontbuffer plane tracking bits
*
* This function gets called every time rendering on the given planes has
* completed or flip on a crtc is completed. So DRRS should be upclocked
* (LOW_RR -> HIGH_RR). And also Idleness detection should be started again,
* if no other planes are dirty.
*
* Dirty frontbuffers relevant to DRRS are tracked in busy_frontbuffer_bits.
*/
void intel_drrs_flush(struct intel_display *display,
unsigned int frontbuffer_bits)
{
intel_drrs_frontbuffer_update(display, frontbuffer_bits, false);
}
/**
* intel_drrs_crtc_init - Init DRRS for CRTC
* @crtc: crtc
*
* This function is called only once at driver load to initialize basic
* DRRS stuff.
*
*/
void intel_drrs_crtc_init(struct intel_crtc *crtc)
{
INIT_DELAYED_WORK(&crtc->drrs.work, intel_drrs_downclock_work);
mutex_init(&crtc->drrs.mutex);
crtc->drrs.cpu_transcoder = INVALID_TRANSCODER;
}
static int intel_drrs_debugfs_status_show(struct seq_file *m, void *unused)
{
struct intel_crtc *crtc = m->private;
struct intel_display *display = to_intel_display(crtc);
const struct intel_crtc_state *crtc_state;
int ret;
ret = drm_modeset_lock_single_interruptible(&crtc->base.mutex);
if (ret)
return ret;
crtc_state = to_intel_crtc_state(crtc->base.state);
mutex_lock(&crtc->drrs.mutex);
Annotation
- Immediate include surface: `linux/debugfs.h`, `drm/drm_print.h`, `intel_atomic.h`, `intel_de.h`, `intel_display_regs.h`, `intel_display_types.h`, `intel_drrs.h`, `intel_frontbuffer.h`.
- Detected declarations: `function Switching`, `function intel_cpu_transcoder_has_drrs`, `function intel_drrs_set_refresh_rate_pipeconf`, `function intel_drrs_set_refresh_rate_m_n`, `function intel_drrs_is_active`, `function intel_drrs_set_state`, `function intel_drrs_schedule_work`, `function intel_drrs_frontbuffer_bits`, `function intel_drrs_activate`, `function intel_drrs_deactivate`.
- 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.