Lines Matching +full:needs +full:- +full:hpd
2 * Copyright © 2006-2007 Intel Corporation
102 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_crt_get_hw_state()
108 encoder->power_domain); in intel_crt_get_hw_state()
112 ret = intel_crt_port_enabled(dev_priv, crt->adpa_reg, pipe); in intel_crt_get_hw_state()
114 intel_display_power_put(dev_priv, encoder->power_domain, wakeref); in intel_crt_get_hw_state()
121 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_crt_get_flags()
125 tmp = intel_de_read(dev_priv, crt->adpa_reg); in intel_crt_get_flags()
143 pipe_config->output_types |= BIT(INTEL_OUTPUT_ANALOG); in intel_crt_get_config()
145 pipe_config->hw.adjusted_mode.flags |= intel_crt_get_flags(encoder); in intel_crt_get_config()
147 pipe_config->hw.adjusted_mode.crtc_clock = pipe_config->port_clock; in intel_crt_get_config()
157 pipe_config->hw.adjusted_mode.flags &= ~(DRM_MODE_FLAG_PHSYNC | in hsw_crt_get_config()
161 pipe_config->hw.adjusted_mode.flags |= intel_crt_get_flags(encoder); in hsw_crt_get_config()
170 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_crt_set_dpms()
172 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in intel_crt_set_dpms()
173 const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; in intel_crt_set_dpms()
181 if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) in intel_crt_set_dpms()
183 if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) in intel_crt_set_dpms()
190 adpa |= ADPA_PIPE_SEL_CPT(crtc->pipe); in intel_crt_set_dpms()
192 adpa |= ADPA_PIPE_SEL(crtc->pipe); in intel_crt_set_dpms()
195 intel_de_write(dev_priv, BCLRPAT(crtc->pipe), 0); in intel_crt_set_dpms()
212 intel_de_write(dev_priv, crt->adpa_reg, adpa); in intel_crt_set_dpms()
243 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in hsw_disable_crt()
245 drm_WARN_ON(&dev_priv->drm, !old_crtc_state->has_pch_encoder); in hsw_disable_crt()
255 struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc); in hsw_post_disable_crt()
256 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in hsw_post_disable_crt()
274 drm_WARN_ON(&dev_priv->drm, !old_crtc_state->has_pch_encoder); in hsw_post_disable_crt()
284 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in hsw_pre_pll_enable_crt()
286 drm_WARN_ON(&dev_priv->drm, !crtc_state->has_pch_encoder); in hsw_pre_pll_enable_crt()
296 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in hsw_pre_enable_crt()
297 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in hsw_pre_enable_crt()
298 enum pipe pipe = crtc->pipe; in hsw_pre_enable_crt()
300 drm_WARN_ON(&dev_priv->drm, !crtc_state->has_pch_encoder); in hsw_pre_enable_crt()
314 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in hsw_enable_crt()
315 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); in hsw_enable_crt()
316 enum pipe pipe = crtc->pipe; in hsw_enable_crt()
318 drm_WARN_ON(&dev_priv->drm, !crtc_state->has_pch_encoder); in hsw_enable_crt()
348 struct drm_device *dev = connector->dev; in intel_crt_mode_valid()
350 int max_dotclk = dev_priv->max_dotclk_freq; in intel_crt_mode_valid()
358 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) in intel_crt_mode_valid()
361 if (mode->clock < 25000) in intel_crt_mode_valid()
376 if (mode->clock > max_clock) in intel_crt_mode_valid()
379 if (mode->clock > max_dotclk) in intel_crt_mode_valid()
384 ilk_get_lanes_required(mode->clock, 270000, 24) > 2) in intel_crt_mode_valid()
388 if (mode->hdisplay > 4096) in intel_crt_mode_valid()
399 &pipe_config->hw.adjusted_mode; in intel_crt_compute_config()
401 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) in intel_crt_compute_config()
402 return -EINVAL; in intel_crt_compute_config()
404 pipe_config->sink_format = INTEL_OUTPUT_FORMAT_RGB; in intel_crt_compute_config()
405 pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; in intel_crt_compute_config()
415 &pipe_config->hw.adjusted_mode; in pch_crt_compute_config()
417 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) in pch_crt_compute_config()
418 return -EINVAL; in pch_crt_compute_config()
420 pipe_config->has_pch_encoder = true; in pch_crt_compute_config()
422 return -EINVAL; in pch_crt_compute_config()
424 pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; in pch_crt_compute_config()
433 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in hsw_crt_compute_config()
435 &pipe_config->hw.adjusted_mode; in hsw_crt_compute_config()
437 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) in hsw_crt_compute_config()
438 return -EINVAL; in hsw_crt_compute_config()
441 if (adjusted_mode->crtc_hdisplay > 4096 || in hsw_crt_compute_config()
442 adjusted_mode->crtc_hblank_start > 4096) in hsw_crt_compute_config()
443 return -EINVAL; in hsw_crt_compute_config()
445 pipe_config->has_pch_encoder = true; in hsw_crt_compute_config()
447 return -EINVAL; in hsw_crt_compute_config()
449 pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; in hsw_crt_compute_config()
453 /* TODO: Check crtc_state->max_link_bpp_x16 instead of bw_constrained */ in hsw_crt_compute_config()
454 if (pipe_config->bw_constrained && pipe_config->pipe_bpp < 24) { in hsw_crt_compute_config()
455 drm_dbg_kms(&dev_priv->drm, in hsw_crt_compute_config()
457 return -EINVAL; in hsw_crt_compute_config()
460 pipe_config->pipe_bpp = 24; in hsw_crt_compute_config()
464 pipe_config->port_clock = 135000 * 2; in hsw_crt_compute_config()
466 pipe_config->enhanced_framing = true; in hsw_crt_compute_config()
468 adjusted_mode->crtc_clock = lpt_iclkip(pipe_config); in hsw_crt_compute_config()
475 struct drm_device *dev = connector->dev; in ilk_crt_detect_hotplug()
482 if (crt->force_hotplug_required) { in ilk_crt_detect_hotplug()
486 crt->force_hotplug_required = false; in ilk_crt_detect_hotplug()
488 save_adpa = adpa = intel_de_read(dev_priv, crt->adpa_reg); in ilk_crt_detect_hotplug()
489 drm_dbg_kms(&dev_priv->drm, in ilk_crt_detect_hotplug()
496 intel_de_write(dev_priv, crt->adpa_reg, adpa); in ilk_crt_detect_hotplug()
499 crt->adpa_reg, in ilk_crt_detect_hotplug()
502 drm_dbg_kms(&dev_priv->drm, in ilk_crt_detect_hotplug()
506 intel_de_write(dev_priv, crt->adpa_reg, save_adpa); in ilk_crt_detect_hotplug()
507 intel_de_posting_read(dev_priv, crt->adpa_reg); in ilk_crt_detect_hotplug()
512 adpa = intel_de_read(dev_priv, crt->adpa_reg); in ilk_crt_detect_hotplug()
517 drm_dbg_kms(&dev_priv->drm, "ironlake hotplug adpa=0x%x, result %d\n", in ilk_crt_detect_hotplug()
525 struct drm_device *dev = connector->dev; in valleyview_crt_detect_hotplug()
534 * Doing a force trigger causes a hpd interrupt to get sent, which can in valleyview_crt_detect_hotplug()
536 * - We enable power wells and reset the ADPA in valleyview_crt_detect_hotplug()
537 * - output_poll_exec does force probe on VGA, triggering a hpd in valleyview_crt_detect_hotplug()
538 * - HPD handler waits for poll to unlock dev->mode_config.mutex in valleyview_crt_detect_hotplug()
539 * - output_poll_exec shuts off the ADPA, unlocks in valleyview_crt_detect_hotplug()
540 * dev->mode_config.mutex in valleyview_crt_detect_hotplug()
541 * - HPD handler runs, resets ADPA and brings us back to the start in valleyview_crt_detect_hotplug()
543 * Just disable HPD interrupts here to prevent this in valleyview_crt_detect_hotplug()
545 reenable_hpd = intel_hpd_disable(dev_priv, crt->base.hpd_pin); in valleyview_crt_detect_hotplug()
547 save_adpa = adpa = intel_de_read(dev_priv, crt->adpa_reg); in valleyview_crt_detect_hotplug()
548 drm_dbg_kms(&dev_priv->drm, in valleyview_crt_detect_hotplug()
553 intel_de_write(dev_priv, crt->adpa_reg, adpa); in valleyview_crt_detect_hotplug()
555 if (intel_de_wait_for_clear(dev_priv, crt->adpa_reg, in valleyview_crt_detect_hotplug()
557 drm_dbg_kms(&dev_priv->drm, in valleyview_crt_detect_hotplug()
559 intel_de_write(dev_priv, crt->adpa_reg, save_adpa); in valleyview_crt_detect_hotplug()
563 adpa = intel_de_read(dev_priv, crt->adpa_reg); in valleyview_crt_detect_hotplug()
569 drm_dbg_kms(&dev_priv->drm, in valleyview_crt_detect_hotplug()
573 intel_hpd_enable(dev_priv, crt->base.hpd_pin); in valleyview_crt_detect_hotplug()
580 struct drm_device *dev = connector->dev; in intel_crt_detect_hotplug()
610 drm_dbg_kms(&dev_priv->drm, in intel_crt_detect_hotplug()
634 drm_dbg_kms(connector->dev, in intel_crt_get_edid()
635 "CRT GMBUS EDID read failed, retry using GPIO bit-banging\n"); in intel_crt_get_edid()
665 struct drm_i915_private *dev_priv = to_i915(crt->base.base.dev); in intel_crt_detect_ddc()
669 drm_edid = intel_crt_get_edid(connector, connector->ddc); in intel_crt_detect_ddc()
673 * This may be a DVI-I connector with a shared DDC in intel_crt_detect_ddc()
678 drm_dbg_kms(&dev_priv->drm, in intel_crt_detect_ddc()
681 drm_dbg_kms(&dev_priv->drm, in intel_crt_detect_ddc()
686 drm_dbg_kms(&dev_priv->drm, in intel_crt_detect_ddc()
698 struct drm_device *dev = crt->base.base.dev; in intel_crt_load_detect()
710 drm_dbg_kms(&dev_priv->drm, "starting load-detect on CRT\n"); in intel_crt_load_detect()
754 VBLANK_START(vblank_start - 1) | in intel_crt_load_detect()
755 VBLANK_END(vblank_end - 1)); in intel_crt_load_detect()
759 if (vblank_start - vactive >= vtotal - vblank_end) in intel_crt_load_detect()
806 DRM_DEBUG_DRIVER("Skipping CRT detection for %s\n", id->ident); in intel_spurious_crt_detect_dmi_callback()
821 .ident = "Intel DZ77BH-55K",
824 DMI_MATCH(DMI_BOARD_NAME, "DZ77BH-55K"),
835 struct drm_i915_private *dev_priv = to_i915(connector->dev); in intel_crt_detect()
837 struct intel_encoder *intel_encoder = &crt->base; in intel_crt_detect()
842 drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s] force=%d\n", in intel_crt_detect()
843 connector->base.id, connector->name, in intel_crt_detect()
849 if (dev_priv->display.params.load_detect_test) { in intel_crt_detect()
851 intel_encoder->power_domain); in intel_crt_detect()
860 intel_encoder->power_domain); in intel_crt_detect()
863 /* We can not rely on the HPD pin always being correctly wired in intel_crt_detect()
868 drm_dbg_kms(&dev_priv->drm, in intel_crt_detect()
873 drm_dbg_kms(&dev_priv->drm, in intel_crt_detect()
882 /* Load detection is broken on HPD capable machines. Whoever wants a in intel_crt_detect()
884 * to have the right resistors for HP detection) needs to fix this up. in intel_crt_detect()
893 status = connector->status; in intel_crt_detect()
897 /* for pre-945g platforms use load detect */ in intel_crt_detect()
908 to_intel_crtc(connector->state->crtc)->pipe); in intel_crt_detect()
909 else if (dev_priv->display.params.load_detect_test) in intel_crt_detect()
917 intel_display_power_put(dev_priv, intel_encoder->power_domain, wakeref); in intel_crt_detect()
924 struct drm_device *dev = connector->dev; in intel_crt_get_modes()
927 struct intel_encoder *intel_encoder = &crt->base; in intel_crt_get_modes()
933 intel_encoder->power_domain); in intel_crt_get_modes()
935 ret = intel_crt_ddc_get_modes(connector, connector->ddc); in intel_crt_get_modes()
939 /* Try to probe digital port for output in DVI-I -> VGA mode. */ in intel_crt_get_modes()
944 intel_display_power_put(dev_priv, intel_encoder->power_domain, wakeref); in intel_crt_get_modes()
951 struct drm_i915_private *dev_priv = to_i915(encoder->dev); in intel_crt_reset()
957 adpa = intel_de_read(dev_priv, crt->adpa_reg); in intel_crt_reset()
960 intel_de_write(dev_priv, crt->adpa_reg, adpa); in intel_crt_reset()
961 intel_de_posting_read(dev_priv, crt->adpa_reg); in intel_crt_reset()
963 drm_dbg_kms(&dev_priv->drm, "crt adpa set to 0x%x\n", adpa); in intel_crt_reset()
964 crt->force_hotplug_required = true; in intel_crt_reset()
1036 ddc_pin = dev_priv->display.vbt.crt_ddc_pin; in intel_crt_init()
1038 connector = &intel_connector->base; in intel_crt_init()
1039 crt->connector = intel_connector; in intel_crt_init()
1040 drm_connector_init_with_ddc(&dev_priv->drm, connector, in intel_crt_init()
1045 drm_encoder_init(&dev_priv->drm, &crt->base.base, &intel_crt_enc_funcs, in intel_crt_init()
1048 intel_connector_attach_encoder(intel_connector, &crt->base); in intel_crt_init()
1050 crt->base.type = INTEL_OUTPUT_ANALOG; in intel_crt_init()
1051 crt->base.cloneable = BIT(INTEL_OUTPUT_DVO) | BIT(INTEL_OUTPUT_HDMI); in intel_crt_init()
1053 crt->base.pipe_mask = BIT(PIPE_A); in intel_crt_init()
1055 crt->base.pipe_mask = ~0; in intel_crt_init()
1058 connector->interlace_allowed = true; in intel_crt_init()
1060 crt->adpa_reg = adpa_reg; in intel_crt_init()
1062 crt->base.power_domain = POWER_DOMAIN_PORT_CRT; in intel_crt_init()
1066 crt->base.hpd_pin = HPD_CRT; in intel_crt_init()
1067 crt->base.hotplug = intel_encoder_hotplug; in intel_crt_init()
1068 intel_connector->polled = DRM_CONNECTOR_POLL_HPD; in intel_crt_init()
1070 intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT; in intel_crt_init()
1076 crt->base.port = PORT_E; in intel_crt_init()
1077 crt->base.get_config = hsw_crt_get_config; in intel_crt_init()
1078 crt->base.get_hw_state = intel_ddi_get_hw_state; in intel_crt_init()
1079 crt->base.compute_config = hsw_crt_compute_config; in intel_crt_init()
1080 crt->base.pre_pll_enable = hsw_pre_pll_enable_crt; in intel_crt_init()
1081 crt->base.pre_enable = hsw_pre_enable_crt; in intel_crt_init()
1082 crt->base.enable = hsw_enable_crt; in intel_crt_init()
1083 crt->base.disable = hsw_disable_crt; in intel_crt_init()
1084 crt->base.post_disable = hsw_post_disable_crt; in intel_crt_init()
1085 crt->base.enable_clock = hsw_ddi_enable_clock; in intel_crt_init()
1086 crt->base.disable_clock = hsw_ddi_disable_clock; in intel_crt_init()
1087 crt->base.is_clock_enabled = hsw_ddi_is_clock_enabled; in intel_crt_init()
1089 intel_ddi_buf_trans_init(&crt->base); in intel_crt_init()
1092 crt->base.compute_config = pch_crt_compute_config; in intel_crt_init()
1093 crt->base.disable = pch_disable_crt; in intel_crt_init()
1094 crt->base.post_disable = pch_post_disable_crt; in intel_crt_init()
1096 crt->base.compute_config = intel_crt_compute_config; in intel_crt_init()
1097 crt->base.disable = intel_disable_crt; in intel_crt_init()
1099 crt->base.port = PORT_NONE; in intel_crt_init()
1100 crt->base.get_config = intel_crt_get_config; in intel_crt_init()
1101 crt->base.get_hw_state = intel_crt_get_hw_state; in intel_crt_init()
1102 crt->base.enable = intel_enable_crt; in intel_crt_init()
1104 intel_connector->get_hw_state = intel_connector_get_hw_state; in intel_crt_init()
1117 dev_priv->display.fdi.rx_config = intel_de_read(dev_priv, in intel_crt_init()
1121 intel_crt_reset(&crt->base.base); in intel_crt_init()