drivers/gpu/drm/i915/display/intel_sprite.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_sprite.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_sprite.c- Extension
.c- Size
- 48400 bytes
- Lines
- 1737
- 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/string_helpers.hdrm/drm_atomic_helper.hdrm/drm_blend.hdrm/drm_color_mgmt.hdrm/drm_fourcc.hdrm/drm_print.hdrm/drm_rect.hi9xx_plane.hintel_de.hintel_display_types.hintel_display_utils.hintel_fb.hintel_frontbuffer.hintel_plane.hintel_sprite.hintel_sprite_regs.h
Detected Declarations
function sprite_namefunction i9xx_plane_linear_gammafunction chv_sprite_update_cscfunction vlv_sprite_update_clrcfunction vlv_plane_ratiofunction vlv_plane_min_cdclkfunction vlv_sprite_ctl_crtcfunction vlv_sprite_ctlfunction vlv_sprite_update_gammafunction vlv_sprite_update_noarmfunction vlv_sprite_update_armfunction vlv_sprite_disable_armfunction vlv_sprite_capture_errorfunction vlv_sprite_get_hw_statefunction ivb_plane_ratiofunction ivb_plane_ratio_scalingfunction ivb_plane_min_cdclkfunction ivb_sprite_min_cdclkfunction hsw_plane_ratiofunction hsw_plane_min_cdclkfunction ivb_sprite_ctl_crtcfunction ivb_need_sprite_gammafunction ivb_sprite_ctlfunction ivb_sprite_linear_gammafunction ivb_sprite_update_gammafunction ivb_sprite_update_noarmfunction ivb_sprite_update_armfunction ivb_sprite_disable_armfunction ivb_sprite_capture_errorfunction ivb_sprite_get_hw_statefunction g4x_sprite_min_cdclkfunction g4x_sprite_max_stridefunction hsw_sprite_max_stridefunction g4x_sprite_min_alignmentfunction g4x_sprite_ctl_crtcfunction g4x_sprite_ctlfunction g4x_sprite_update_gammafunction ilk_sprite_linear_gammafunction ilk_sprite_update_gammafunction g4x_sprite_update_noarmfunction g4x_sprite_update_armfunction g4x_sprite_disable_armfunction g4x_sprite_capture_errorfunction g4x_sprite_get_hw_statefunction g4x_fb_scalablefunction g4x_sprite_check_scalingfunction g4x_sprite_checkfunction chv_plane_check_rotation
Annotated Snippet
switch (cpp) {
case 8:
*num = 11;
*den = 8;
break;
case 4:
*num = 18;
*den = 16;
break;
default:
*num = 1;
*den = 1;
break;
}
} else if (hweight8(active_planes) == 2) {
switch (cpp) {
case 8:
*num = 10;
*den = 8;
break;
case 4:
*num = 17;
*den = 16;
break;
default:
*num = 1;
*den = 1;
break;
}
} else {
switch (cpp) {
case 8:
*num = 10;
*den = 8;
break;
default:
*num = 1;
*den = 1;
break;
}
}
}
int vlv_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{
unsigned int pixel_rate;
unsigned int num, den;
/*
* Note that crtc_state->pixel_rate accounts for both
* horizontal and vertical panel fitter downscaling factors.
* Pre-HSW bspec tells us to only consider the horizontal
* downscaling factor here. We ignore that and just consider
* both for simplicity.
*/
pixel_rate = crtc_state->pixel_rate;
vlv_plane_ratio(crtc_state, plane_state, &num, &den);
return DIV_ROUND_UP(pixel_rate * num, den);
}
static u32 vlv_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
{
u32 sprctl = 0;
if (crtc_state->gamma_enable)
sprctl |= SP_PIPE_GAMMA_ENABLE;
return sprctl;
}
static u32 vlv_sprite_ctl(const struct intel_plane_state *plane_state)
{
const struct drm_framebuffer *fb = plane_state->hw.fb;
unsigned int rotation = plane_state->hw.rotation;
const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
u32 sprctl;
sprctl = SP_ENABLE;
switch (fb->format->format) {
case DRM_FORMAT_YUYV:
sprctl |= SP_FORMAT_YUV422 | SP_YUV_ORDER_YUYV;
break;
case DRM_FORMAT_YVYU:
sprctl |= SP_FORMAT_YUV422 | SP_YUV_ORDER_YVYU;
break;
case DRM_FORMAT_UYVY:
Annotation
- Immediate include surface: `linux/string_helpers.h`, `drm/drm_atomic_helper.h`, `drm/drm_blend.h`, `drm/drm_color_mgmt.h`, `drm/drm_fourcc.h`, `drm/drm_print.h`, `drm/drm_rect.h`, `i9xx_plane.h`.
- Detected declarations: `function sprite_name`, `function i9xx_plane_linear_gamma`, `function chv_sprite_update_csc`, `function vlv_sprite_update_clrc`, `function vlv_plane_ratio`, `function vlv_plane_min_cdclk`, `function vlv_sprite_ctl_crtc`, `function vlv_sprite_ctl`, `function vlv_sprite_update_gamma`, `function vlv_sprite_update_noarm`.
- 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.