drivers/gpu/drm/i915/display/intel_pfit.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_pfit.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_pfit.c- Extension
.c- Size
- 23577 bytes
- Lines
- 754
- 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
drm/drm_print.hintel_de.hintel_display_core.hintel_display_driver.hintel_display_regs.hintel_display_types.hintel_display_utils.hintel_lvds_regs.hintel_pfit.hintel_pfit_regs.hskl_scaler.h
Detected Declarations
function intel_pch_pfit_check_dst_windowfunction intel_pch_pfit_check_src_sizefunction intel_pch_pfit_check_scalingfunction intel_pch_pfit_check_timingsfunction intel_pch_pfit_check_cloningfunction pch_panel_fittingfunction centre_horizontallyfunction centre_verticallyfunction panel_fitter_scalingfunction i965_scale_aspectfunction i9xx_scale_aspectfunction intel_gmch_pfit_check_timingsfunction gmch_panel_fittingfunction intel_crtc_compute_pixel_ratefunction intel_pfit_mode_validfunction intel_pfit_compute_configfunction ilk_pfit_enablefunction ilk_pfit_disablefunction ilk_pfit_get_configfunction i9xx_pfit_enablefunction i9xx_pfit_disablefunction i9xx_has_pfitfunction i9xx_pfit_get_config
Annotated Snippet
if (scaled_width > scaled_height) { /* pillar */
width = scaled_height / pipe_src_h;
if (width & 1)
width++;
x = (adjusted_mode->crtc_hdisplay - width + 1) / 2;
y = 0;
height = adjusted_mode->crtc_vdisplay;
} else if (scaled_width < scaled_height) { /* letter */
height = scaled_width / pipe_src_w;
if (height & 1)
height++;
y = (adjusted_mode->crtc_vdisplay - height + 1) / 2;
x = 0;
width = adjusted_mode->crtc_hdisplay;
} else {
x = y = 0;
width = adjusted_mode->crtc_hdisplay;
height = adjusted_mode->crtc_vdisplay;
}
}
break;
case DRM_MODE_SCALE_NONE:
WARN_ON(adjusted_mode->crtc_hdisplay != pipe_src_w);
WARN_ON(adjusted_mode->crtc_vdisplay != pipe_src_h);
fallthrough;
case DRM_MODE_SCALE_FULLSCREEN:
x = y = 0;
width = adjusted_mode->crtc_hdisplay;
height = adjusted_mode->crtc_vdisplay;
break;
default:
MISSING_CASE(conn_state->scaling_mode);
return -EINVAL;
}
if (crtc_state->hw.sharpness_strength &&
(width != pipe_src_w || height != pipe_src_h ||
crtc_state->hw.scaling_filter != DRM_SCALING_FILTER_DEFAULT ||
crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB)) {
drm_dbg_kms(display->drm,
"[CRTC:%d:%s] no scaling/YCbCr output with sharpness filter\n",
crtc->base.base.id, crtc->base.name);
return -EINVAL;
}
drm_rect_init(&crtc_state->pch_pfit.dst,
x, y, width, height);
crtc_state->pch_pfit.enabled = true;
/*
* SKL+ have unified scalers for pipes/planes so the
* checks are done in a single place for all scalers.
*/
if (DISPLAY_VER(display) >= 9)
return 0;
ret = intel_pch_pfit_check_dst_window(crtc_state);
if (ret)
return ret;
ret = intel_pch_pfit_check_src_size(crtc_state);
if (ret)
return ret;
ret = intel_pch_pfit_check_scaling(crtc_state);
if (ret)
return ret;
ret = intel_pch_pfit_check_timings(crtc_state);
if (ret)
return ret;
ret = intel_pch_pfit_check_cloning(crtc_state);
if (ret)
return ret;
return 0;
}
static void
centre_horizontally(struct drm_display_mode *adjusted_mode,
int width)
{
u32 border, sync_pos, blank_width, sync_width;
/* keep the hsync and hblank widths constant */
sync_width = adjusted_mode->crtc_hsync_end - adjusted_mode->crtc_hsync_start;
blank_width = adjusted_mode->crtc_hblank_end - adjusted_mode->crtc_hblank_start;
Annotation
- Immediate include surface: `drm/drm_print.h`, `intel_de.h`, `intel_display_core.h`, `intel_display_driver.h`, `intel_display_regs.h`, `intel_display_types.h`, `intel_display_utils.h`, `intel_lvds_regs.h`.
- Detected declarations: `function intel_pch_pfit_check_dst_window`, `function intel_pch_pfit_check_src_size`, `function intel_pch_pfit_check_scaling`, `function intel_pch_pfit_check_timings`, `function intel_pch_pfit_check_cloning`, `function pch_panel_fitting`, `function centre_horizontally`, `function centre_vertically`, `function panel_fitter_scaling`, `function i965_scale_aspect`.
- 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.