Lines Matching full:crtc

36 static void intel_crtc_disable_noatomic_begin(struct intel_crtc *crtc,  in intel_crtc_disable_noatomic_begin()  argument
39 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_crtc_disable_noatomic_begin()
41 to_intel_crtc_state(crtc->base.state); in intel_crtc_disable_noatomic_begin()
45 enum pipe pipe = crtc->pipe; in intel_crtc_disable_noatomic_begin()
50 for_each_intel_plane_on_crtc(&i915->drm, crtc, plane) { in intel_crtc_disable_noatomic_begin()
55 intel_plane_disable_noatomic(crtc, plane); in intel_crtc_disable_noatomic_begin()
61 "failed to disable [CRTC:%d:%s], out of memory", in intel_crtc_disable_noatomic_begin()
62 crtc->base.base.id, crtc->base.name); in intel_crtc_disable_noatomic_begin()
82 i915->display.funcs.display->crtc_disable(to_intel_atomic_state(state), crtc); in intel_crtc_disable_noatomic_begin()
87 "[CRTC:%d:%s] hw state adjusted, was enabled, now disabled\n", in intel_crtc_disable_noatomic_begin()
88 crtc->base.base.id, crtc->base.name); in intel_crtc_disable_noatomic_begin()
90 crtc->active = false; in intel_crtc_disable_noatomic_begin()
91 crtc->base.enabled = false; in intel_crtc_disable_noatomic_begin()
94 intel_unreference_shared_dpll_crtc(crtc, in intel_crtc_disable_noatomic_begin()
104 if (conn_state->crtc) in set_encoder_for_connector()
109 conn_state->crtc = encoder->base.crtc; in set_encoder_for_connector()
113 conn_state->crtc = NULL; in set_encoder_for_connector()
143 static void reset_crtc_encoder_state(struct intel_crtc *crtc) in reset_crtc_encoder_state() argument
145 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in reset_crtc_encoder_state()
148 for_each_encoder_on_crtc(&i915->drm, &crtc->base, encoder) { in reset_crtc_encoder_state()
150 encoder->base.crtc = NULL; in reset_crtc_encoder_state()
154 static void intel_crtc_disable_noatomic_complete(struct intel_crtc *crtc) in intel_crtc_disable_noatomic_complete() argument
156 struct intel_display *display = to_intel_display(crtc); in intel_crtc_disable_noatomic_complete()
157 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_crtc_disable_noatomic_complete()
167 to_intel_crtc_state(crtc->base.state); in intel_crtc_disable_noatomic_complete()
168 enum pipe pipe = crtc->pipe; in intel_crtc_disable_noatomic_complete()
172 intel_crtc_state_reset(crtc_state, crtc); in intel_crtc_disable_noatomic_complete()
174 reset_crtc_encoder_state(crtc); in intel_crtc_disable_noatomic_complete()
176 intel_fbc_disable(crtc); in intel_crtc_disable_noatomic_complete()
179 intel_display_power_put_all_in_set(i915, &crtc->enabled_power_domains); in intel_crtc_disable_noatomic_complete()
221 * Return the port sync master and slave pipes linked to @crtc.
224 static void get_portsync_pipes(struct intel_crtc *crtc, in get_portsync_pipes() argument
227 struct intel_display *display = to_intel_display(crtc); in get_portsync_pipes()
228 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in get_portsync_pipes()
230 to_intel_crtc_state(crtc->base.state); in get_portsync_pipes()
236 *master_pipe_mask = BIT(crtc->pipe); in get_portsync_pipes()
270 static void intel_crtc_disable_noatomic(struct intel_crtc *crtc, in intel_crtc_disable_noatomic() argument
273 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_crtc_disable_noatomic()
280 get_portsync_pipes(crtc, &portsync_master_mask, &portsync_slaves_mask); in intel_crtc_disable_noatomic()
320 struct intel_crtc *crtc = in intel_modeset_update_connector_atomic_state() local
321 to_intel_crtc(encoder->base.crtc); in intel_modeset_update_connector_atomic_state()
323 to_intel_crtc_state(crtc->base.state); in intel_modeset_update_connector_atomic_state()
333 struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); in intel_crtc_copy_hw_to_uapi_state()
340 drm_WARN_ON(crtc_state->uapi.crtc->dev, in intel_crtc_copy_hw_to_uapi_state()
383 struct intel_crtc *crtc; in intel_sanitize_plane_mapping() local
388 for_each_intel_crtc(&i915->drm, crtc) { in intel_sanitize_plane_mapping()
390 to_intel_plane(crtc->base.primary); in intel_sanitize_plane_mapping()
397 if (pipe == crtc->pipe) in intel_sanitize_plane_mapping()
409 static bool intel_crtc_has_encoders(struct intel_crtc *crtc) in intel_crtc_has_encoders() argument
411 struct drm_device *dev = crtc->base.dev; in intel_crtc_has_encoders()
414 for_each_encoder_on_crtc(dev, &crtc->base, encoder) in intel_crtc_has_encoders()
420 static bool intel_crtc_needs_link_reset(struct intel_crtc *crtc) in intel_crtc_needs_link_reset() argument
422 struct drm_device *dev = crtc->base.dev; in intel_crtc_needs_link_reset()
425 for_each_encoder_on_crtc(dev, &crtc->base, encoder) { in intel_crtc_needs_link_reset()
456 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in intel_sanitize_fifo_underrun_reporting() local
457 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_sanitize_fifo_underrun_reporting()
472 intel_init_fifo_underrun_reporting(i915, crtc, in intel_sanitize_fifo_underrun_reporting()
477 static bool intel_sanitize_crtc(struct intel_crtc *crtc, in intel_sanitize_crtc() argument
480 struct drm_i915_private *i915 = to_i915(crtc->base.dev); in intel_sanitize_crtc()
481 struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); in intel_sanitize_crtc()
488 for_each_intel_plane_on_crtc(&i915->drm, crtc, plane) { in intel_sanitize_crtc()
494 intel_plane_disable_noatomic(crtc, plane); in intel_sanitize_crtc()
506 needs_link_reset = intel_crtc_needs_link_reset(crtc); in intel_sanitize_crtc()
512 if (!needs_link_reset && intel_crtc_has_encoders(crtc)) in intel_sanitize_crtc()
515 intel_crtc_disable_noatomic(crtc, ctx); in intel_sanitize_crtc()
532 struct intel_crtc *crtc; in intel_sanitize_all_crtcs() local
544 for_each_intel_crtc(&i915->drm, crtc) { in intel_sanitize_all_crtcs()
545 u32 crtc_mask = drm_crtc_mask(&crtc->base); in intel_sanitize_all_crtcs()
550 if (intel_sanitize_crtc(crtc, ctx)) in intel_sanitize_all_crtcs()
557 for_each_intel_crtc(&i915->drm, crtc) { in intel_sanitize_all_crtcs()
559 to_intel_crtc_state(crtc->base.state); in intel_sanitize_all_crtcs()
567 struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev); in has_bogus_dpll_config()
590 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); in intel_sanitize_encoder() local
591 struct intel_crtc_state *crtc_state = crtc ? in intel_sanitize_encoder()
592 to_intel_crtc_state(crtc->base.state) : NULL; in intel_sanitize_encoder()
597 * We need to check both for a crtc link (meaning that the encoder is in intel_sanitize_encoder()
607 pipe_name(crtc->pipe)); in intel_sanitize_encoder()
649 encoder->base.crtc = NULL; in intel_sanitize_encoder()
673 struct intel_crtc *crtc; in readout_plane_state() local
684 crtc = intel_crtc_for_pipe(display, pipe); in readout_plane_state()
685 crtc_state = to_intel_crtc_state(crtc->base.state); in readout_plane_state()
695 for_each_intel_crtc(&i915->drm, crtc) { in readout_plane_state()
697 to_intel_crtc_state(crtc->base.state); in readout_plane_state()
713 struct intel_crtc *crtc; in intel_modeset_readout_hw_state() local
719 for_each_intel_crtc(&i915->drm, crtc) { in intel_modeset_readout_hw_state()
721 to_intel_crtc_state(crtc->base.state); in intel_modeset_readout_hw_state()
725 intel_crtc_state_reset(crtc_state, crtc); in intel_modeset_readout_hw_state()
731 crtc->base.enabled = crtc_state->hw.enable; in intel_modeset_readout_hw_state()
732 crtc->active = crtc_state->hw.active; in intel_modeset_readout_hw_state()
735 active_pipes |= BIT(crtc->pipe); in intel_modeset_readout_hw_state()
738 "[CRTC:%d:%s] hw state readout: %s\n", in intel_modeset_readout_hw_state()
739 crtc->base.base.id, crtc->base.name, in intel_modeset_readout_hw_state()
754 crtc = intel_crtc_for_pipe(display, pipe); in intel_modeset_readout_hw_state()
755 crtc_state = to_intel_crtc_state(crtc->base.state); in intel_modeset_readout_hw_state()
757 encoder->base.crtc = &crtc->base; in intel_modeset_readout_hw_state()
760 /* read out to secondary crtc as well for joiner */ in intel_modeset_readout_hw_state()
784 encoder->base.crtc = NULL; in intel_modeset_readout_hw_state()
793 str_enabled_disabled(encoder->base.crtc), in intel_modeset_readout_hw_state()
804 struct intel_crtc *crtc; in intel_modeset_readout_hw_state() local
811 crtc = to_intel_crtc(encoder->base.crtc); in intel_modeset_readout_hw_state()
812 crtc_state = crtc ? to_intel_crtc_state(crtc->base.state) : NULL; in intel_modeset_readout_hw_state()
840 for_each_intel_crtc(&i915->drm, crtc) { in intel_modeset_readout_hw_state()
844 to_intel_crtc_state(crtc->base.state); in intel_modeset_readout_hw_state()
852 * crtc's enabled, so we do the above call. in intel_modeset_readout_hw_state()
866 for_each_intel_plane_on_crtc(&i915->drm, crtc, plane) { in intel_modeset_readout_hw_state()
901 cdclk_state->min_cdclk[crtc->pipe] = min_cdclk; in intel_modeset_readout_hw_state()
902 cdclk_state->min_voltage_level[crtc->pipe] = in intel_modeset_readout_hw_state()
926 * MST-primary and inactive encoders don't have a crtc state in get_encoder_power_domains()
929 if (!encoder->base.crtc) in get_encoder_power_domains()
932 crtc_state = to_intel_crtc_state(encoder->base.crtc->state); in get_encoder_power_domains()
968 struct intel_crtc *crtc; in intel_modeset_setup_hw_state() local
985 for_each_intel_crtc(&i915->drm, crtc) { in intel_modeset_setup_hw_state()
987 to_intel_crtc_state(crtc->base.state); in intel_modeset_setup_hw_state()
991 drm_crtc_vblank_reset(&crtc->base); in intel_modeset_setup_hw_state()
994 intel_dmc_enable_pipe(display, crtc->pipe); in intel_modeset_setup_hw_state()
1018 for_each_intel_crtc(&i915->drm, crtc) { in intel_modeset_setup_hw_state()
1020 to_intel_crtc_state(crtc->base.state); in intel_modeset_setup_hw_state()
1025 intel_modeset_put_crtc_power_domains(crtc, &put_domains); in intel_modeset_setup_hw_state()