drivers/gpu/drm/i915/display/intel_overlay.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_overlay.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_overlay.c- Extension
.c- Size
- 28420 bytes
- Lines
- 1073
- 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.
- 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
drm/drm_fourcc.hdrm/drm_gem.hdrm/drm_print.hintel_color_regs.hintel_de.hintel_display_regs.hintel_display_types.hintel_frontbuffer.hintel_overlay.hintel_parent.hintel_pfit_regs.h
Detected Declarations
struct overlay_registersstruct intel_overlayfunction intel_overlay_resetfunction packed_depth_bytesfunction packed_width_bytesfunction uv_hsubsamplingfunction uv_vsubsamplingfunction calc_swidthswfunction update_polyphase_filterfunction update_scaling_factorsfunction update_colorkeyfunction overlay_cmd_regfunction intel_overlay_do_put_imagefunction intel_overlay_switch_offfunction check_overlay_possible_on_crtcfunction update_pfit_vscale_ratiofunction check_overlay_dstfunction check_overlay_scalingfunction check_overlay_srcfunction intel_overlay_put_image_ioctlfunction update_reg_attrsfunction check_gamma_boundsfunction check_gamma5_erratafunction check_gammafunction intel_overlay_attrs_ioctlfunction intel_overlay_setupfunction intel_overlay_availablefunction intel_overlay_cleanup
Annotated Snippet
struct overlay_registers {
u32 OBUF_0Y;
u32 OBUF_1Y;
u32 OBUF_0U;
u32 OBUF_0V;
u32 OBUF_1U;
u32 OBUF_1V;
u32 OSTRIDE;
u32 YRGB_VPH;
u32 UV_VPH;
u32 HORZ_PH;
u32 INIT_PHS;
u32 DWINPOS;
u32 DWINSZ;
u32 SWIDTH;
u32 SWIDTHSW;
u32 SHEIGHT;
u32 YRGBSCALE;
u32 UVSCALE;
u32 OCLRC0;
u32 OCLRC1;
u32 DCLRKV;
u32 DCLRKM;
u32 SCLRKVH;
u32 SCLRKVL;
u32 SCLRKEN;
u32 OCONFIG;
u32 OCMD;
u32 RESERVED1; /* 0x6C */
u32 OSTART_0Y;
u32 OSTART_1Y;
u32 OSTART_0U;
u32 OSTART_0V;
u32 OSTART_1U;
u32 OSTART_1V;
u32 OTILEOFF_0Y;
u32 OTILEOFF_1Y;
u32 OTILEOFF_0U;
u32 OTILEOFF_0V;
u32 OTILEOFF_1U;
u32 OTILEOFF_1V;
u32 FASTHSCALE; /* 0xA0 */
u32 UVSCALEV; /* 0xA4 */
u32 RESERVEDC[(0x200 - 0xA8) / 4]; /* 0xA8 - 0x1FC */
u16 Y_VCOEFS[N_VERT_Y_TAPS * N_PHASES]; /* 0x200 */
u16 RESERVEDD[0x100 / 2 - N_VERT_Y_TAPS * N_PHASES];
u16 Y_HCOEFS[N_HORIZ_Y_TAPS * N_PHASES]; /* 0x300 */
u16 RESERVEDE[0x200 / 2 - N_HORIZ_Y_TAPS * N_PHASES];
u16 UV_VCOEFS[N_VERT_UV_TAPS * N_PHASES]; /* 0x500 */
u16 RESERVEDF[0x100 / 2 - N_VERT_UV_TAPS * N_PHASES];
u16 UV_HCOEFS[N_HORIZ_UV_TAPS * N_PHASES]; /* 0x600 */
u16 RESERVEDG[0x100 / 2 - N_HORIZ_UV_TAPS * N_PHASES];
};
struct intel_overlay {
struct intel_display *display;
struct intel_crtc *crtc;
bool pfit_active;
u32 pfit_vscale_ratio; /* shifted-point number, (1<<12) == 1.0 */
u32 color_key:24;
u32 color_key_enabled:1;
u32 brightness, contrast, saturation;
u32 old_xscale, old_yscale;
struct overlay_registers __iomem *regs;
};
void intel_overlay_reset(struct intel_display *display)
{
struct intel_overlay *overlay = display->overlay;
if (!overlay)
return;
overlay->old_xscale = 0;
overlay->old_yscale = 0;
overlay->crtc = NULL;
intel_parent_overlay_reset(display);
}
static int packed_depth_bytes(u32 format)
{
switch (format & I915_OVERLAY_DEPTH_MASK) {
case I915_OVERLAY_YUV422:
return 4;
case I915_OVERLAY_YUV411:
/* return 6; not implemented */
default:
return -EINVAL;
}
Annotation
- Immediate include surface: `drm/drm_fourcc.h`, `drm/drm_gem.h`, `drm/drm_print.h`, `intel_color_regs.h`, `intel_de.h`, `intel_display_regs.h`, `intel_display_types.h`, `intel_frontbuffer.h`.
- Detected declarations: `struct overlay_registers`, `struct intel_overlay`, `function intel_overlay_reset`, `function packed_depth_bytes`, `function packed_width_bytes`, `function uv_hsubsampling`, `function uv_vsubsampling`, `function calc_swidthsw`, `function update_polyphase_filter`, `function update_scaling_factors`.
- 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.