drivers/gpu/drm/i915/display/skl_prefill.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/skl_prefill.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/skl_prefill.c- Extension
.c- Size
- 4712 bytes
- Lines
- 158
- 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/debugfs.hdrm/drm_print.hintel_cdclk.hintel_display_core.hintel_display_types.hintel_vblank.hintel_vdsc.hskl_prefill.hskl_scaler.hskl_watermark.h
Detected Declarations
function prefill_usecs_to_linesfunction prefill_initfunction prefill_init_nocdclk_worstfunction prefill_init_nocdclkfunction prefill_adjustfunction prefill_lines_nocdclkfunction prefill_lines_cdclkfunction prefill_lines_fullfunction skl_prefill_init_worstfunction skl_prefill_initfunction prefill_lines_with_latencyfunction skl_prefill_min_guardbandfunction prefill_guardbandfunction skl_prefill_vblank_too_shortfunction skl_prefill_min_cdclk
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2025 Intel Corporation
*/
#include <linux/debugfs.h>
#include <drm/drm_print.h>
#include "intel_cdclk.h"
#include "intel_display_core.h"
#include "intel_display_types.h"
#include "intel_vblank.h"
#include "intel_vdsc.h"
#include "skl_prefill.h"
#include "skl_scaler.h"
#include "skl_watermark.h"
static unsigned int prefill_usecs_to_lines(const struct intel_crtc_state *crtc_state,
unsigned int usecs)
{
const struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode;
return DIV_ROUND_UP_ULL(mul_u32_u32(pipe_mode->crtc_clock, usecs << 16),
pipe_mode->crtc_htotal * 1000);
}
static void prefill_init(struct skl_prefill_ctx *ctx,
const struct intel_crtc_state *crtc_state)
{
memset(ctx, 0, sizeof(*ctx));
ctx->prefill.fixed = crtc_state->framestart_delay << 16;
/* 20 usec for translation walks/etc. */
ctx->prefill.fixed += prefill_usecs_to_lines(crtc_state, 20);
ctx->prefill.dsc = intel_vdsc_prefill_lines(crtc_state);
}
static void prefill_init_nocdclk_worst(struct skl_prefill_ctx *ctx,
const struct intel_crtc_state *crtc_state)
{
prefill_init(ctx, crtc_state);
ctx->prefill.wm0 = skl_wm0_prefill_lines_worst(crtc_state);
ctx->prefill.scaler_1st = skl_scaler_1st_prefill_lines_worst(crtc_state);
ctx->prefill.scaler_2nd = skl_scaler_2nd_prefill_lines_worst(crtc_state);
ctx->adj.scaler_1st = skl_scaler_1st_prefill_adjustment_worst(crtc_state);
ctx->adj.scaler_2nd = skl_scaler_2nd_prefill_adjustment_worst(crtc_state);
}
static void prefill_init_nocdclk(struct skl_prefill_ctx *ctx,
const struct intel_crtc_state *crtc_state)
{
prefill_init(ctx, crtc_state);
ctx->prefill.wm0 = skl_wm0_prefill_lines(crtc_state);
ctx->prefill.scaler_1st = skl_scaler_1st_prefill_lines(crtc_state);
ctx->prefill.scaler_2nd = skl_scaler_2nd_prefill_lines(crtc_state);
ctx->adj.scaler_1st = skl_scaler_1st_prefill_adjustment(crtc_state);
ctx->adj.scaler_2nd = skl_scaler_2nd_prefill_adjustment(crtc_state);
}
static unsigned int prefill_adjust(unsigned int value, unsigned int factor)
{
return DIV_ROUND_UP_ULL(mul_u32_u32(value, factor), 0x10000);
}
static unsigned int prefill_lines_nocdclk(const struct skl_prefill_ctx *ctx)
{
unsigned int prefill = 0;
prefill += ctx->prefill.dsc;
prefill = prefill_adjust(prefill, ctx->adj.scaler_2nd);
prefill += ctx->prefill.scaler_2nd;
prefill = prefill_adjust(prefill, ctx->adj.scaler_1st);
prefill += ctx->prefill.scaler_1st;
prefill += ctx->prefill.wm0;
return prefill;
}
static unsigned int prefill_lines_cdclk(const struct skl_prefill_ctx *ctx)
{
return prefill_adjust(prefill_lines_nocdclk(ctx), ctx->adj.cdclk);
Annotation
- Immediate include surface: `linux/debugfs.h`, `drm/drm_print.h`, `intel_cdclk.h`, `intel_display_core.h`, `intel_display_types.h`, `intel_vblank.h`, `intel_vdsc.h`, `skl_prefill.h`.
- Detected declarations: `function prefill_usecs_to_lines`, `function prefill_init`, `function prefill_init_nocdclk_worst`, `function prefill_init_nocdclk`, `function prefill_adjust`, `function prefill_lines_nocdclk`, `function prefill_lines_cdclk`, `function prefill_lines_full`, `function skl_prefill_init_worst`, `function skl_prefill_init`.
- 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.