aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_hdmi.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-07-14 23:50:58 -0400
committerDave Airlie <airlied@redhat.com>2016-07-14 23:50:58 -0400
commitff37c05a996bb96eccc21f4fb1b32ba0e24f3443 (patch)
treec09b09b37521f2f8f3f7a9bb3b0a33a2b3bde1a1 /drivers/gpu/drm/i915/intel_hdmi.c
parent6c181c82106e12dced317e93a7a396cbb8c64f75 (diff)
parent0b2c0582f1570bfc95aa9ac1cd340a215d8e8335 (diff)
Merge tag 'drm-intel-next-2016-07-11' of git://anongit.freedesktop.org/drm-intel into drm-next
- select igt testing depencies for CONFIG_DRM_I915_DEBUG (Chris) - track outputs in crtc state and clean up all our ad-hoc connector/encoder walking in modest code (Ville) - demidlayer drm_device/drm_i915_private (Chris Wilson) - thundering herd fix from Chris Wilson, with lots of help from Tvrtko Ursulin - piles of assorted clean and fallout from the thundering herd fix - documentation and more tuning for waitboosting (Chris) - pooled EU support on bxt (Arun Siluvery) - bxt support is no longer considered prelimary! - ring/engine vfunc cleanup from Tvrtko - introduce intel_wait_for_register helper (Chris) - opregion updates (Jani Nukla) - tuning and fixes for wait_for macros (Tvrkto&Imre) - more kabylake pci ids (Rodrigo) - pps cleanup and fixes for bxt (Imre) - move sink crc support over to atomic state (Maarten) - fix up async fbdev init ordering (Chris) - fbc fixes from Paulo and Chris * tag 'drm-intel-next-2016-07-11' of git://anongit.freedesktop.org/drm-intel: (223 commits) drm/i915: Update DRIVER_DATE to 20160711 drm/i915: Select DRM_VGEM for igt drm/i915: Select X86_MSR for igt drm/i915: Fill unused GGTT with scratch pages for VT-d drm/i915: Introduce Kabypoint PCH for Kabylake H/DT. drm/i915:gen9: implement WaMediaPoolStateCmdInWABB drm/i915: Check for invalid cloning earlier during modeset drm/i915: Simplify hdmi_12bpc_possible() drm/i915: Kill has_dsi_encoder drm/i915: s/INTEL_OUTPUT_DISPLAYPORT/INTEL_OUTPUT_DP/ drm/i915: Replace some open coded intel_crtc_has_dp_encoder()s drm/i915: Kill has_dp_encoder from pipe_config drm/i915: Replace manual lvds and sdvo/hdmi counting with intel_crtc_has_type() drm/i915: Unify intel_pipe_has_type() and intel_pipe_will_have_type() drm/i915: Add output_types bitmask into the crtc state drm/i915: Remove encoder type checks from MST suspend/resume drm/i915: Don't mark eDP encoders as MST capable drm/i915: avoid wait_for_atomic() in non-atomic host2guc_action() drm/i915: Group the irq breadcrumb variables into the same cacheline drm/i915: Wake up the bottom-half if we steal their interrupt ...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c72
1 files changed, 27 insertions, 45 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index fb21626ada64..4df9f384910c 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -47,7 +47,7 @@ static void
47assert_hdmi_port_disabled(struct intel_hdmi *intel_hdmi) 47assert_hdmi_port_disabled(struct intel_hdmi *intel_hdmi)
48{ 48{
49 struct drm_device *dev = intel_hdmi_to_dev(intel_hdmi); 49 struct drm_device *dev = intel_hdmi_to_dev(intel_hdmi);
50 struct drm_i915_private *dev_priv = dev->dev_private; 50 struct drm_i915_private *dev_priv = to_i915(dev);
51 uint32_t enabled_bits; 51 uint32_t enabled_bits;
52 52
53 enabled_bits = HAS_DDI(dev) ? DDI_BUF_CTL_ENABLE : SDVO_ENABLE; 53 enabled_bits = HAS_DDI(dev) ? DDI_BUF_CTL_ENABLE : SDVO_ENABLE;
@@ -138,7 +138,7 @@ static void g4x_write_infoframe(struct drm_encoder *encoder,
138{ 138{
139 const uint32_t *data = frame; 139 const uint32_t *data = frame;
140 struct drm_device *dev = encoder->dev; 140 struct drm_device *dev = encoder->dev;
141 struct drm_i915_private *dev_priv = dev->dev_private; 141 struct drm_i915_private *dev_priv = to_i915(dev);
142 u32 val = I915_READ(VIDEO_DIP_CTL); 142 u32 val = I915_READ(VIDEO_DIP_CTL);
143 int i; 143 int i;
144 144
@@ -192,7 +192,7 @@ static void ibx_write_infoframe(struct drm_encoder *encoder,
192{ 192{
193 const uint32_t *data = frame; 193 const uint32_t *data = frame;
194 struct drm_device *dev = encoder->dev; 194 struct drm_device *dev = encoder->dev;
195 struct drm_i915_private *dev_priv = dev->dev_private; 195 struct drm_i915_private *dev_priv = to_i915(dev);
196 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 196 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
197 i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe); 197 i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
198 u32 val = I915_READ(reg); 198 u32 val = I915_READ(reg);
@@ -251,7 +251,7 @@ static void cpt_write_infoframe(struct drm_encoder *encoder,
251{ 251{
252 const uint32_t *data = frame; 252 const uint32_t *data = frame;
253 struct drm_device *dev = encoder->dev; 253 struct drm_device *dev = encoder->dev;
254 struct drm_i915_private *dev_priv = dev->dev_private; 254 struct drm_i915_private *dev_priv = to_i915(dev);
255 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 255 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
256 i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe); 256 i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
257 u32 val = I915_READ(reg); 257 u32 val = I915_READ(reg);
@@ -308,7 +308,7 @@ static void vlv_write_infoframe(struct drm_encoder *encoder,
308{ 308{
309 const uint32_t *data = frame; 309 const uint32_t *data = frame;
310 struct drm_device *dev = encoder->dev; 310 struct drm_device *dev = encoder->dev;
311 struct drm_i915_private *dev_priv = dev->dev_private; 311 struct drm_i915_private *dev_priv = to_i915(dev);
312 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 312 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
313 i915_reg_t reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe); 313 i915_reg_t reg = VLV_TVIDEO_DIP_CTL(intel_crtc->pipe);
314 u32 val = I915_READ(reg); 314 u32 val = I915_READ(reg);
@@ -366,7 +366,7 @@ static void hsw_write_infoframe(struct drm_encoder *encoder,
366{ 366{
367 const uint32_t *data = frame; 367 const uint32_t *data = frame;
368 struct drm_device *dev = encoder->dev; 368 struct drm_device *dev = encoder->dev;
369 struct drm_i915_private *dev_priv = dev->dev_private; 369 struct drm_i915_private *dev_priv = to_i915(dev);
370 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 370 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
371 enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder; 371 enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;
372 i915_reg_t ctl_reg = HSW_TVIDEO_DIP_CTL(cpu_transcoder); 372 i915_reg_t ctl_reg = HSW_TVIDEO_DIP_CTL(cpu_transcoder);
@@ -508,7 +508,7 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,
508 bool enable, 508 bool enable,
509 const struct drm_display_mode *adjusted_mode) 509 const struct drm_display_mode *adjusted_mode)
510{ 510{
511 struct drm_i915_private *dev_priv = encoder->dev->dev_private; 511 struct drm_i915_private *dev_priv = to_i915(encoder->dev);
512 struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); 512 struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
513 struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi; 513 struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
514 i915_reg_t reg = VIDEO_DIP_CTL; 514 i915_reg_t reg = VIDEO_DIP_CTL;
@@ -629,7 +629,7 @@ static bool gcp_default_phase_possible(int pipe_bpp,
629 629
630static bool intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder) 630static bool intel_hdmi_set_gcp_infoframe(struct drm_encoder *encoder)
631{ 631{
632 struct drm_i915_private *dev_priv = encoder->dev->dev_private; 632 struct drm_i915_private *dev_priv = to_i915(encoder->dev);
633 struct intel_crtc *crtc = to_intel_crtc(encoder->crtc); 633 struct intel_crtc *crtc = to_intel_crtc(encoder->crtc);
634 i915_reg_t reg; 634 i915_reg_t reg;
635 u32 val = 0; 635 u32 val = 0;
@@ -661,7 +661,7 @@ static void ibx_set_infoframes(struct drm_encoder *encoder,
661 bool enable, 661 bool enable,
662 const struct drm_display_mode *adjusted_mode) 662 const struct drm_display_mode *adjusted_mode)
663{ 663{
664 struct drm_i915_private *dev_priv = encoder->dev->dev_private; 664 struct drm_i915_private *dev_priv = to_i915(encoder->dev);
665 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 665 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
666 struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); 666 struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
667 struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi; 667 struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
@@ -713,7 +713,7 @@ static void cpt_set_infoframes(struct drm_encoder *encoder,
713 bool enable, 713 bool enable,
714 const struct drm_display_mode *adjusted_mode) 714 const struct drm_display_mode *adjusted_mode)
715{ 715{
716 struct drm_i915_private *dev_priv = encoder->dev->dev_private; 716 struct drm_i915_private *dev_priv = to_i915(encoder->dev);
717 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 717 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
718 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); 718 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
719 i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe); 719 i915_reg_t reg = TVIDEO_DIP_CTL(intel_crtc->pipe);
@@ -755,7 +755,7 @@ static void vlv_set_infoframes(struct drm_encoder *encoder,
755 bool enable, 755 bool enable,
756 const struct drm_display_mode *adjusted_mode) 756 const struct drm_display_mode *adjusted_mode)
757{ 757{
758 struct drm_i915_private *dev_priv = encoder->dev->dev_private; 758 struct drm_i915_private *dev_priv = to_i915(encoder->dev);
759 struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); 759 struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
760 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 760 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
761 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); 761 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
@@ -807,7 +807,7 @@ static void hsw_set_infoframes(struct drm_encoder *encoder,
807 bool enable, 807 bool enable,
808 const struct drm_display_mode *adjusted_mode) 808 const struct drm_display_mode *adjusted_mode)
809{ 809{
810 struct drm_i915_private *dev_priv = encoder->dev->dev_private; 810 struct drm_i915_private *dev_priv = to_i915(encoder->dev);
811 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); 811 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
812 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); 812 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
813 i915_reg_t reg = HSW_TVIDEO_DIP_CTL(intel_crtc->config->cpu_transcoder); 813 i915_reg_t reg = HSW_TVIDEO_DIP_CTL(intel_crtc->config->cpu_transcoder);
@@ -855,7 +855,7 @@ void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable)
855static void intel_hdmi_prepare(struct intel_encoder *encoder) 855static void intel_hdmi_prepare(struct intel_encoder *encoder)
856{ 856{
857 struct drm_device *dev = encoder->base.dev; 857 struct drm_device *dev = encoder->base.dev;
858 struct drm_i915_private *dev_priv = dev->dev_private; 858 struct drm_i915_private *dev_priv = to_i915(dev);
859 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); 859 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
860 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); 860 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
861 const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode; 861 const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode;
@@ -894,7 +894,7 @@ static bool intel_hdmi_get_hw_state(struct intel_encoder *encoder,
894 enum pipe *pipe) 894 enum pipe *pipe)
895{ 895{
896 struct drm_device *dev = encoder->base.dev; 896 struct drm_device *dev = encoder->base.dev;
897 struct drm_i915_private *dev_priv = dev->dev_private; 897 struct drm_i915_private *dev_priv = to_i915(dev);
898 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); 898 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
899 enum intel_display_power_domain power_domain; 899 enum intel_display_power_domain power_domain;
900 u32 tmp; 900 u32 tmp;
@@ -931,7 +931,7 @@ static void intel_hdmi_get_config(struct intel_encoder *encoder,
931{ 931{
932 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); 932 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
933 struct drm_device *dev = encoder->base.dev; 933 struct drm_device *dev = encoder->base.dev;
934 struct drm_i915_private *dev_priv = dev->dev_private; 934 struct drm_i915_private *dev_priv = to_i915(dev);
935 u32 tmp, flags = 0; 935 u32 tmp, flags = 0;
936 int dotclock; 936 int dotclock;
937 937
@@ -988,7 +988,7 @@ static void intel_enable_hdmi_audio(struct intel_encoder *encoder)
988static void g4x_enable_hdmi(struct intel_encoder *encoder) 988static void g4x_enable_hdmi(struct intel_encoder *encoder)
989{ 989{
990 struct drm_device *dev = encoder->base.dev; 990 struct drm_device *dev = encoder->base.dev;
991 struct drm_i915_private *dev_priv = dev->dev_private; 991 struct drm_i915_private *dev_priv = to_i915(dev);
992 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); 992 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
993 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); 993 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
994 u32 temp; 994 u32 temp;
@@ -1009,7 +1009,7 @@ static void g4x_enable_hdmi(struct intel_encoder *encoder)
1009static void ibx_enable_hdmi(struct intel_encoder *encoder) 1009static void ibx_enable_hdmi(struct intel_encoder *encoder)
1010{ 1010{
1011 struct drm_device *dev = encoder->base.dev; 1011 struct drm_device *dev = encoder->base.dev;
1012 struct drm_i915_private *dev_priv = dev->dev_private; 1012 struct drm_i915_private *dev_priv = to_i915(dev);
1013 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); 1013 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
1014 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); 1014 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
1015 u32 temp; 1015 u32 temp;
@@ -1058,7 +1058,7 @@ static void ibx_enable_hdmi(struct intel_encoder *encoder)
1058static void cpt_enable_hdmi(struct intel_encoder *encoder) 1058static void cpt_enable_hdmi(struct intel_encoder *encoder)
1059{ 1059{
1060 struct drm_device *dev = encoder->base.dev; 1060 struct drm_device *dev = encoder->base.dev;
1061 struct drm_i915_private *dev_priv = dev->dev_private; 1061 struct drm_i915_private *dev_priv = to_i915(dev);
1062 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); 1062 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
1063 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); 1063 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
1064 enum pipe pipe = crtc->pipe; 1064 enum pipe pipe = crtc->pipe;
@@ -1115,7 +1115,7 @@ static void vlv_enable_hdmi(struct intel_encoder *encoder)
1115static void intel_disable_hdmi(struct intel_encoder *encoder) 1115static void intel_disable_hdmi(struct intel_encoder *encoder)
1116{ 1116{
1117 struct drm_device *dev = encoder->base.dev; 1117 struct drm_device *dev = encoder->base.dev;
1118 struct drm_i915_private *dev_priv = dev->dev_private; 1118 struct drm_i915_private *dev_priv = to_i915(dev);
1119 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); 1119 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
1120 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); 1120 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
1121 u32 temp; 1121 u32 temp;
@@ -1154,7 +1154,7 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
1154 I915_WRITE(intel_hdmi->hdmi_reg, temp); 1154 I915_WRITE(intel_hdmi->hdmi_reg, temp);
1155 POSTING_READ(intel_hdmi->hdmi_reg); 1155 POSTING_READ(intel_hdmi->hdmi_reg);
1156 1156
1157 intel_wait_for_vblank_if_active(dev_priv->dev, PIPE_A); 1157 intel_wait_for_vblank_if_active(&dev_priv->drm, PIPE_A);
1158 intel_set_cpu_fifo_underrun_reporting(dev_priv, PIPE_A, true); 1158 intel_set_cpu_fifo_underrun_reporting(dev_priv, PIPE_A, true);
1159 intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, true); 1159 intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, true);
1160 } 1160 }
@@ -1273,33 +1273,15 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
1273static bool hdmi_12bpc_possible(struct intel_crtc_state *crtc_state) 1273static bool hdmi_12bpc_possible(struct intel_crtc_state *crtc_state)
1274{ 1274{
1275 struct drm_device *dev = crtc_state->base.crtc->dev; 1275 struct drm_device *dev = crtc_state->base.crtc->dev;
1276 struct drm_atomic_state *state;
1277 struct intel_encoder *encoder;
1278 struct drm_connector *connector;
1279 struct drm_connector_state *connector_state;
1280 int count = 0, count_hdmi = 0;
1281 int i;
1282 1276
1283 if (HAS_GMCH_DISPLAY(dev)) 1277 if (HAS_GMCH_DISPLAY(dev))
1284 return false; 1278 return false;
1285 1279
1286 state = crtc_state->base.state;
1287
1288 for_each_connector_in_state(state, connector, connector_state, i) {
1289 if (connector_state->crtc != crtc_state->base.crtc)
1290 continue;
1291
1292 encoder = to_intel_encoder(connector_state->best_encoder);
1293
1294 count_hdmi += encoder->type == INTEL_OUTPUT_HDMI;
1295 count++;
1296 }
1297
1298 /* 1280 /*
1299 * HDMI 12bpc affects the clocks, so it's only possible 1281 * HDMI 12bpc affects the clocks, so it's only possible
1300 * when not cloning with other encoder types. 1282 * when not cloning with other encoder types.
1301 */ 1283 */
1302 return count_hdmi > 0 && count_hdmi == count; 1284 return crtc_state->output_types == 1 << INTEL_OUTPUT_HDMI;
1303} 1285}
1304 1286
1305bool intel_hdmi_compute_config(struct intel_encoder *encoder, 1287bool intel_hdmi_compute_config(struct intel_encoder *encoder,
@@ -1575,7 +1557,7 @@ intel_hdmi_set_property(struct drm_connector *connector,
1575 struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); 1557 struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
1576 struct intel_digital_port *intel_dig_port = 1558 struct intel_digital_port *intel_dig_port =
1577 hdmi_to_dig_port(intel_hdmi); 1559 hdmi_to_dig_port(intel_hdmi);
1578 struct drm_i915_private *dev_priv = connector->dev->dev_private; 1560 struct drm_i915_private *dev_priv = to_i915(connector->dev);
1579 int ret; 1561 int ret;
1580 1562
1581 ret = drm_object_property_set_value(&connector->base, property, val); 1563 ret = drm_object_property_set_value(&connector->base, property, val);
@@ -1674,7 +1656,7 @@ static void vlv_hdmi_pre_enable(struct intel_encoder *encoder)
1674 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); 1656 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
1675 struct intel_hdmi *intel_hdmi = &dport->hdmi; 1657 struct intel_hdmi *intel_hdmi = &dport->hdmi;
1676 struct drm_device *dev = encoder->base.dev; 1658 struct drm_device *dev = encoder->base.dev;
1677 struct drm_i915_private *dev_priv = dev->dev_private; 1659 struct drm_i915_private *dev_priv = to_i915(dev);
1678 struct intel_crtc *intel_crtc = 1660 struct intel_crtc *intel_crtc =
1679 to_intel_crtc(encoder->base.crtc); 1661 to_intel_crtc(encoder->base.crtc);
1680 const struct drm_display_mode *adjusted_mode = &intel_crtc->config->base.adjusted_mode; 1662 const struct drm_display_mode *adjusted_mode = &intel_crtc->config->base.adjusted_mode;
@@ -1722,7 +1704,7 @@ static void vlv_hdmi_post_disable(struct intel_encoder *encoder)
1722static void chv_hdmi_post_disable(struct intel_encoder *encoder) 1704static void chv_hdmi_post_disable(struct intel_encoder *encoder)
1723{ 1705{
1724 struct drm_device *dev = encoder->base.dev; 1706 struct drm_device *dev = encoder->base.dev;
1725 struct drm_i915_private *dev_priv = dev->dev_private; 1707 struct drm_i915_private *dev_priv = to_i915(dev);
1726 1708
1727 mutex_lock(&dev_priv->sb_lock); 1709 mutex_lock(&dev_priv->sb_lock);
1728 1710
@@ -1737,7 +1719,7 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder)
1737 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); 1719 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
1738 struct intel_hdmi *intel_hdmi = &dport->hdmi; 1720 struct intel_hdmi *intel_hdmi = &dport->hdmi;
1739 struct drm_device *dev = encoder->base.dev; 1721 struct drm_device *dev = encoder->base.dev;
1740 struct drm_i915_private *dev_priv = dev->dev_private; 1722 struct drm_i915_private *dev_priv = to_i915(dev);
1741 struct intel_crtc *intel_crtc = 1723 struct intel_crtc *intel_crtc =
1742 to_intel_crtc(encoder->base.crtc); 1724 to_intel_crtc(encoder->base.crtc);
1743 const struct drm_display_mode *adjusted_mode = &intel_crtc->config->base.adjusted_mode; 1725 const struct drm_display_mode *adjusted_mode = &intel_crtc->config->base.adjusted_mode;
@@ -1774,6 +1756,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = {
1774 .fill_modes = drm_helper_probe_single_connector_modes, 1756 .fill_modes = drm_helper_probe_single_connector_modes,
1775 .set_property = intel_hdmi_set_property, 1757 .set_property = intel_hdmi_set_property,
1776 .atomic_get_property = intel_connector_atomic_get_property, 1758 .atomic_get_property = intel_connector_atomic_get_property,
1759 .late_register = intel_connector_register,
1777 .early_unregister = intel_connector_unregister, 1760 .early_unregister = intel_connector_unregister,
1778 .destroy = intel_hdmi_destroy, 1761 .destroy = intel_hdmi_destroy,
1779 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, 1762 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
@@ -1806,7 +1789,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
1806 struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi; 1789 struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
1807 struct intel_encoder *intel_encoder = &intel_dig_port->base; 1790 struct intel_encoder *intel_encoder = &intel_dig_port->base;
1808 struct drm_device *dev = intel_encoder->base.dev; 1791 struct drm_device *dev = intel_encoder->base.dev;
1809 struct drm_i915_private *dev_priv = dev->dev_private; 1792 struct drm_i915_private *dev_priv = to_i915(dev);
1810 enum port port = intel_dig_port->port; 1793 enum port port = intel_dig_port->port;
1811 uint8_t alternate_ddc_pin; 1794 uint8_t alternate_ddc_pin;
1812 1795
@@ -1914,7 +1897,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
1914 intel_hdmi_add_properties(intel_hdmi, connector); 1897 intel_hdmi_add_properties(intel_hdmi, connector);
1915 1898
1916 intel_connector_attach_encoder(intel_connector, intel_encoder); 1899 intel_connector_attach_encoder(intel_connector, intel_encoder);
1917 drm_connector_register(connector);
1918 intel_hdmi->attached_connector = intel_connector; 1900 intel_hdmi->attached_connector = intel_connector;
1919 1901
1920 /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written 1902 /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written