Lines Matching full:crtc

35 static void intel_crtc_disable_noatomic_begin(struct intel_crtc *crtc,  in intel_crtc_disable_noatomic_begin()  argument
38 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_crtc_disable_noatomic_begin()
40 to_intel_crtc_state(crtc->base.state); in intel_crtc_disable_noatomic_begin()
44 enum pipe pipe = crtc->pipe; in intel_crtc_disable_noatomic_begin()
49 for_each_intel_plane_on_crtc(&i915->drm, crtc, plane) { in intel_crtc_disable_noatomic_begin()
54 intel_plane_disable_noatomic(crtc, plane); in intel_crtc_disable_noatomic_begin()
60 "failed to disable [CRTC:%d:%s], out of memory", in intel_crtc_disable_noatomic_begin()
61 crtc->base.base.id, crtc->base.name); in intel_crtc_disable_noatomic_begin()
81 i915->display.funcs.display->crtc_disable(to_intel_atomic_state(state), crtc); in intel_crtc_disable_noatomic_begin()
86 "[CRTC:%d:%s] hw state adjusted, was enabled, now disabled\n", in intel_crtc_disable_noatomic_begin()
87 crtc->base.base.id, crtc->base.name); in intel_crtc_disable_noatomic_begin()
89 crtc->active = false; in intel_crtc_disable_noatomic_begin()
90 crtc->base.enabled = false; in intel_crtc_disable_noatomic_begin()
93 intel_unreference_shared_dpll_crtc(crtc, in intel_crtc_disable_noatomic_begin()
103 if (conn_state->crtc) in set_encoder_for_connector()
108 conn_state->crtc = encoder->base.crtc; in set_encoder_for_connector()
112 conn_state->crtc = NULL; in set_encoder_for_connector()
141 static void reset_crtc_encoder_state(struct intel_crtc *crtc) in reset_crtc_encoder_state() argument
143 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in reset_crtc_encoder_state()
146 for_each_encoder_on_crtc(&i915->drm, &crtc->base, encoder) { in reset_crtc_encoder_state()
148 encoder->base.crtc = NULL; in reset_crtc_encoder_state()
152 static void intel_crtc_disable_noatomic_complete(struct intel_crtc *crtc) in intel_crtc_disable_noatomic_complete() argument
154 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_crtc_disable_noatomic_complete()
164 to_intel_crtc_state(crtc->base.state); in intel_crtc_disable_noatomic_complete()
165 enum pipe pipe = crtc->pipe; in intel_crtc_disable_noatomic_complete()
169 intel_crtc_state_reset(crtc_state, crtc); in intel_crtc_disable_noatomic_complete()
171 reset_crtc_encoder_state(crtc); in intel_crtc_disable_noatomic_complete()
173 intel_fbc_disable(crtc); in intel_crtc_disable_noatomic_complete()
176 intel_display_power_put_all_in_set(i915, &crtc->enabled_power_domains); in intel_crtc_disable_noatomic_complete()
218 * Return the port sync master and slave pipes linked to @crtc.
221 static void get_portsync_pipes(struct intel_crtc *crtc, in get_portsync_pipes() argument
224 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in get_portsync_pipes()
226 to_intel_crtc_state(crtc->base.state); in get_portsync_pipes()
232 *master_pipe_mask = BIT(crtc->pipe); in get_portsync_pipes()
266 static void intel_crtc_disable_noatomic(struct intel_crtc *crtc, in intel_crtc_disable_noatomic() argument
269 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_crtc_disable_noatomic()
276 get_portsync_pipes(crtc, &portsync_master_mask, &portsync_slaves_mask); in intel_crtc_disable_noatomic()
316 struct intel_crtc *crtc = in intel_modeset_update_connector_atomic_state() local
317 to_intel_crtc(encoder->base.crtc); in intel_modeset_update_connector_atomic_state()
319 to_intel_crtc_state(crtc->base.state); in intel_modeset_update_connector_atomic_state()
334 drm_WARN_ON(crtc_state->uapi.crtc->dev, in intel_crtc_copy_hw_to_uapi_state()
357 struct intel_crtc *crtc; in intel_sanitize_plane_mapping() local
362 for_each_intel_crtc(&i915->drm, crtc) { in intel_sanitize_plane_mapping()
364 to_intel_plane(crtc->base.primary); in intel_sanitize_plane_mapping()
371 if (pipe == crtc->pipe) in intel_sanitize_plane_mapping()
383 static bool intel_crtc_has_encoders(struct intel_crtc *crtc) in intel_crtc_has_encoders() argument
385 struct drm_device *dev = crtc->base.dev; in intel_crtc_has_encoders()
388 for_each_encoder_on_crtc(dev, &crtc->base, encoder) in intel_crtc_has_encoders()
394 static bool intel_crtc_needs_link_reset(struct intel_crtc *crtc) in intel_crtc_needs_link_reset() argument
396 struct drm_device *dev = crtc->base.dev; in intel_crtc_needs_link_reset()
399 for_each_encoder_on_crtc(dev, &crtc->base, encoder) { in intel_crtc_needs_link_reset()
430 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in intel_sanitize_fifo_underrun_reporting() local
431 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_sanitize_fifo_underrun_reporting()
446 intel_init_fifo_underrun_reporting(i915, crtc, in intel_sanitize_fifo_underrun_reporting()
451 static bool intel_sanitize_crtc(struct intel_crtc *crtc, in intel_sanitize_crtc() argument
454 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_sanitize_crtc()
455 struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); in intel_sanitize_crtc()
462 for_each_intel_plane_on_crtc(&i915->drm, crtc, plane) { in intel_sanitize_crtc()
468 intel_plane_disable_noatomic(crtc, plane); in intel_sanitize_crtc()
480 needs_link_reset = intel_crtc_needs_link_reset(crtc); in intel_sanitize_crtc()
486 if (!needs_link_reset && intel_crtc_has_encoders(crtc)) in intel_sanitize_crtc()
489 intel_crtc_disable_noatomic(crtc, ctx); in intel_sanitize_crtc()
506 struct intel_crtc *crtc; in intel_sanitize_all_crtcs() local
518 for_each_intel_crtc(&i915->drm, crtc) { in intel_sanitize_all_crtcs()
519 u32 crtc_mask = drm_crtc_mask(&crtc->base); in intel_sanitize_all_crtcs()
524 if (intel_sanitize_crtc(crtc, ctx)) in intel_sanitize_all_crtcs()
531 for_each_intel_crtc(&i915->drm, crtc) { in intel_sanitize_all_crtcs()
533 to_intel_crtc_state(crtc->base.state); in intel_sanitize_all_crtcs()
541 struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); in has_bogus_dpll_config()
563 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); in intel_sanitize_encoder() local
564 struct intel_crtc_state *crtc_state = crtc ? in intel_sanitize_encoder()
565 to_intel_crtc_state(crtc->base.state) : NULL; in intel_sanitize_encoder()
570 * We need to check both for a crtc link (meaning that the encoder is in intel_sanitize_encoder()
580 pipe_name(crtc->pipe)); in intel_sanitize_encoder()
622 encoder->base.crtc = NULL; in intel_sanitize_encoder()
645 struct intel_crtc *crtc; in readout_plane_state() local
656 crtc = intel_crtc_for_pipe(i915, pipe); in readout_plane_state()
657 crtc_state = to_intel_crtc_state(crtc->base.state); in readout_plane_state()
667 for_each_intel_crtc(&i915->drm, crtc) { in readout_plane_state()
669 to_intel_crtc_state(crtc->base.state); in readout_plane_state()
684 struct intel_crtc *crtc; in intel_modeset_readout_hw_state() local
690 for_each_intel_crtc(&i915->drm, crtc) { in intel_modeset_readout_hw_state()
692 to_intel_crtc_state(crtc->base.state); in intel_modeset_readout_hw_state()
696 intel_crtc_state_reset(crtc_state, crtc); in intel_modeset_readout_hw_state()
702 crtc->base.enabled = crtc_state->hw.enable; in intel_modeset_readout_hw_state()
703 crtc->active = crtc_state->hw.active; in intel_modeset_readout_hw_state()
706 active_pipes |= BIT(crtc->pipe); in intel_modeset_readout_hw_state()
709 "[CRTC:%d:%s] hw state readout: %s\n", in intel_modeset_readout_hw_state()
710 crtc->base.base.id, crtc->base.name, in intel_modeset_readout_hw_state()
725 crtc = intel_crtc_for_pipe(i915, pipe); in intel_modeset_readout_hw_state()
726 crtc_state = to_intel_crtc_state(crtc->base.state); in intel_modeset_readout_hw_state()
728 encoder->base.crtc = &crtc->base; in intel_modeset_readout_hw_state()
731 /* read out to slave crtc as well for bigjoiner */ in intel_modeset_readout_hw_state()
755 encoder->base.crtc = NULL; in intel_modeset_readout_hw_state()
764 str_enabled_disabled(encoder->base.crtc), in intel_modeset_readout_hw_state()
774 struct intel_crtc *crtc; in intel_modeset_readout_hw_state() local
781 crtc = to_intel_crtc(encoder->base.crtc); in intel_modeset_readout_hw_state()
782 crtc_state = crtc ? to_intel_crtc_state(crtc->base.state) : NULL; in intel_modeset_readout_hw_state()
806 for_each_intel_crtc(&i915->drm, crtc) { in intel_modeset_readout_hw_state()
810 to_intel_crtc_state(crtc->base.state); in intel_modeset_readout_hw_state()
818 * crtc's enabled, so we do the above call. in intel_modeset_readout_hw_state()
832 for_each_intel_plane_on_crtc(&i915->drm, crtc, plane) { in intel_modeset_readout_hw_state()
867 cdclk_state->min_cdclk[crtc->pipe] = min_cdclk; in intel_modeset_readout_hw_state()
868 cdclk_state->min_voltage_level[crtc->pipe] = in intel_modeset_readout_hw_state()
892 * MST-primary and inactive encoders don't have a crtc state in get_encoder_power_domains()
895 if (!encoder->base.crtc) in get_encoder_power_domains()
898 crtc_state = to_intel_crtc_state(encoder->base.crtc->state); in get_encoder_power_domains()
933 struct intel_crtc *crtc; in intel_modeset_setup_hw_state() local
950 for_each_intel_crtc(&i915->drm, crtc) { in intel_modeset_setup_hw_state()
952 to_intel_crtc_state(crtc->base.state); in intel_modeset_setup_hw_state()
956 drm_crtc_vblank_reset(&crtc->base); in intel_modeset_setup_hw_state()
959 intel_dmc_enable_pipe(i915, crtc->pipe); in intel_modeset_setup_hw_state()
983 for_each_intel_crtc(&i915->drm, crtc) { in intel_modeset_setup_hw_state()
985 to_intel_crtc_state(crtc->base.state); in intel_modeset_setup_hw_state()
990 intel_modeset_put_crtc_power_domains(crtc, &put_domains); in intel_modeset_setup_hw_state()