if (plane_state->uapi.visible)
intel_plane_disable_noatomic(crtc, plane);
}
state = drm_atomic_state_alloc(display->drm); if (!state) {
drm_dbg_kms(display->drm, "failed to disable [CRTC:%d:%s], out of memory",
crtc->base.base.id, crtc->base.name); return;
}
/* * Return all the pipes using a transcoder in @transcoder_mask. * For joiner configs return only the joiner primary.
*/ static u8 get_transcoder_pipes(struct intel_display *display,
u8 transcoder_mask)
{ struct intel_crtc *temp_crtc;
u8 pipes = 0;
if (DISPLAY_INFO(display)->color.degamma_lut_size) { /* assume 1:1 mapping */
drm_property_replace_blob(&crtc_state->hw.degamma_lut,
crtc_state->pre_csc_lut);
drm_property_replace_blob(&crtc_state->hw.gamma_lut,
crtc_state->post_csc_lut);
} else { /* * ilk/snb hw may be configured for either pre_csc_lut * or post_csc_lut, but we don't advertise degamma_lut as * being available in the uapi since there is only one * hardware LUT. Always assign the result of the readout * to gamma_lut as that is the only valid source of LUTs * in the uapi.
*/
drm_WARN_ON(display->drm, crtc_state->post_csc_lut &&
crtc_state->pre_csc_lut);
/* * We start out with underrun reporting disabled on active * pipes to avoid races. * * Also on gmch platforms we dont have any hardware bits to * disable the underrun reporting. Which means we need to start * out with underrun reporting disabled also on inactive pipes, * since otherwise we'll complain about the garbage we read when * e.g. coming up after runtime pm. * * No protection against concurrent access is required - at * worst a fifo underrun happens which also sets this to false.
*/
intel_init_fifo_underrun_reporting(display, crtc,
!crtc_state->hw.active &&
!HAS_GMCH(display));
}
/* * Adjust the state of the output pipe according to whether we have * active connectors/encoders.
*/ if (!needs_link_reset && intel_crtc_has_encoders(crtc)) returnfalse;
intel_crtc_disable_noatomic(crtc, ctx);
/* * The HPD state on other active/disconnected TC ports may be stuck in * the connected state until this port is disabled and a ~10ms delay has * passed, wait here for that so that sanitizing other CRTCs will see the * up-to-date HPD state.
*/ if (needs_link_reset)
msleep(20);
/* * An active and disconnected TypeC port prevents the HPD live state * to get updated on other active/disconnected TypeC ports, so after * a port gets disabled the CRTCs using other TypeC ports must be * rechecked wrt. their link status.
*/ for (;;) {
u32 old_mask = crtcs_forced_off;
/* * Some SNB BIOSen (eg. ASUS K53SV) are known to misprogram * the hardware when a high res displays plugged in. DPLL P * divider is zero, and the pipe timings are bonkers. We'll * try to disable everything in that case. * * FIXME would be nice to be able to sanitize this state * without several WARNs, but for now let's take the easy * road.
*/ return display->platform.sandybridge &&
crtc_state->hw.active &&
crtc_state->intel_dpll &&
crtc_state->port_clock == 0;
}
/* * We need to check both for a crtc link (meaning that the encoder is * active and trying to read from a pipe) and the pipe itself being * active.
*/ bool has_active_crtc = crtc_state &&
crtc_state->hw.active;
if (crtc_state && has_bogus_dpll_config(crtc_state)) {
drm_dbg_kms(display->drm, "BIOS has misprogrammed the hardware. Disabling pipe %c\n",
pipe_name(crtc->pipe));
has_active_crtc = false;
}
connector = intel_encoder_find_connector(encoder); if (connector && !has_active_crtc) {
drm_dbg_kms(display->drm, "[ENCODER:%d:%s] has active connectors but no active pipe!\n",
encoder->base.base.id,
encoder->base.name);
/* Clear the corresponding bit in pmdemand active phys mask */
intel_pmdemand_update_phys_mask(display, encoder,
pmdemand_state, false);
/* * Connector is active, but has no active pipe. This is fallout * from our resume register restoring. Disable the encoder * manually again.
*/ if (crtc_state) { struct drm_encoder *best_encoder;
/* * Inconsistent output/port/pipe state happens presumably due to * a bug in one of the get_hw_state functions. Or someplace else * in our code, like the register restore mess on resume. Clamp * things to off as a safer default.
*/
connector->base.dpms = DRM_MODE_DPMS_OFF;
connector->base.encoder = NULL;
}
/* notify opregion of the sanitized encoder state */
intel_opregion_notify_encoder(encoder, connector && has_active_crtc);
if (HAS_DDI(display))
intel_ddi_sanitize_encoder_pll_mapping(encoder);
}
/* FIXME read out full plane state for all planes */ staticvoid readout_plane_state(struct intel_display *display)
{ struct intel_plane *plane; struct intel_crtc *crtc;
if (crtc_state && crtc_state->hw.active) { /* * This has to be done during hardware readout * because anything calling .crtc_disable may * rely on the connector_mask being accurate.
*/
crtc_state->uapi.connector_mask |=
drm_connector_mask(&connector->base);
crtc_state->uapi.encoder_mask |=
drm_encoder_mask(&encoder->base);
}
} else {
connector->base.dpms = DRM_MODE_DPMS_OFF;
connector->base.encoder = NULL;
}
if (connector->sync_state)
connector->sync_state(connector, crtc_state);
/* * The initial mode needs to be set in order to keep * the atomic core happy. It wants a valid mode if the * crtc's enabled, so we do the above call. * * But we don't set all the derived state fully, hence * set a flag to indicate that a full recalculation is * needed on the next commit.
*/
crtc_state->inherited = true;
if (crtc_state->hw.active) {
intel_crtc_update_active_timings(crtc_state,
crtc_state->vrr.enable);
/* * MST-primary and inactive encoders don't have a crtc state * and neither of these require any power domain references.
*/ if (!encoder->base.crtc) continue;
staticvoid intel_early_display_was(struct intel_display *display)
{ /* * Display WA #1185 WaDisableDARBFClkGating:glk,icl,ehl,tgl * Also known as Wa_14010480278.
*/ if (IS_DISPLAY_VER(display, 10, 12))
intel_de_rmw(display, GEN9_CLKGATE_DIS_0, 0, DARBF_GATING_DIS);
/* * WaRsPkgCStateDisplayPMReq:hsw * System hang if this isn't done before disabling all planes!
*/ if (display->platform.haswell)
intel_de_rmw(display, CHICKEN_PAR1_1, 0, FORCE_ARB_IDLE_PLANES);
/* HW state is read out, now we need to sanitize this mess. */
get_encoder_power_domains(display);
intel_pch_sanitize(display);
intel_cmtg_sanitize(display);
/* * intel_sanitize_plane_mapping() may need to do vblank * waits, so we need vblank interrupts restored beforehand.
*/
for_each_intel_crtc(display->drm, crtc) { struct intel_crtc_state *crtc_state =
to_intel_crtc_state(crtc->base.state);
/* * Sanitizing CRTCs needs their connector atomic state to be * up-to-date, so ensure that already here.
*/
intel_modeset_update_connector_atomic_state(display);
intel_sanitize_all_crtcs(display, ctx);
intel_dpll_sanitize_state(display);
/* TODO move earlier on all platforms */ if (DISPLAY_VER(display) < 9)
intel_wm_get_hw_state(display);
intel_wm_sanitize(display);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.