aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c47
1 files changed, 29 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 507370513f3d..9cb5c95d5898 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -73,9 +73,6 @@ static const uint32_t intel_cursor_formats[] = {
73 DRM_FORMAT_ARGB8888, 73 DRM_FORMAT_ARGB8888,
74}; 74};
75 75
76#define DIV_ROUND_CLOSEST_ULL(ll, d) \
77({ unsigned long long _tmp = (ll)+(d)/2; do_div(_tmp, d); _tmp; })
78
79static void intel_increase_pllclock(struct drm_device *dev, 76static void intel_increase_pllclock(struct drm_device *dev,
80 enum pipe pipe); 77 enum pipe pipe);
81static void intel_crtc_update_cursor(struct drm_crtc *crtc, bool on); 78static void intel_crtc_update_cursor(struct drm_crtc *crtc, bool on);
@@ -4328,7 +4325,6 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
4328 ironlake_fdi_disable(crtc); 4325 ironlake_fdi_disable(crtc);
4329 4326
4330 ironlake_disable_pch_transcoder(dev_priv, pipe); 4327 ironlake_disable_pch_transcoder(dev_priv, pipe);
4331 intel_set_pch_fifo_underrun_reporting(dev, pipe, true);
4332 4328
4333 if (HAS_PCH_CPT(dev)) { 4329 if (HAS_PCH_CPT(dev)) {
4334 /* disable TRANS_DP_CTL */ 4330 /* disable TRANS_DP_CTL */
@@ -4392,7 +4388,6 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
4392 4388
4393 if (intel_crtc->config.has_pch_encoder) { 4389 if (intel_crtc->config.has_pch_encoder) {
4394 lpt_disable_pch_transcoder(dev_priv); 4390 lpt_disable_pch_transcoder(dev_priv);
4395 intel_set_pch_fifo_underrun_reporting(dev, TRANSCODER_A, true);
4396 intel_ddi_fdi_disable(crtc); 4391 intel_ddi_fdi_disable(crtc);
4397 } 4392 }
4398 4393
@@ -4588,7 +4583,7 @@ static void vlv_update_cdclk(struct drm_device *dev)
4588 * BSpec erroneously claims we should aim for 4MHz, but 4583 * BSpec erroneously claims we should aim for 4MHz, but
4589 * in fact 1MHz is the correct frequency. 4584 * in fact 1MHz is the correct frequency.
4590 */ 4585 */
4591 I915_WRITE(GMBUSFREQ_VLV, dev_priv->vlv_cdclk_freq); 4586 I915_WRITE(GMBUSFREQ_VLV, DIV_ROUND_UP(dev_priv->vlv_cdclk_freq, 1000));
4592} 4587}
4593 4588
4594/* Adjust CDclk dividers to allow high res or save power if possible */ 4589/* Adjust CDclk dividers to allow high res or save power if possible */
@@ -9411,6 +9406,10 @@ static bool page_flip_finished(struct intel_crtc *crtc)
9411 struct drm_device *dev = crtc->base.dev; 9406 struct drm_device *dev = crtc->base.dev;
9412 struct drm_i915_private *dev_priv = dev->dev_private; 9407 struct drm_i915_private *dev_priv = dev->dev_private;
9413 9408
9409 if (i915_reset_in_progress(&dev_priv->gpu_error) ||
9410 crtc->reset_counter != atomic_read(&dev_priv->gpu_error.reset_counter))
9411 return true;
9412
9414 /* 9413 /*
9415 * The relevant registers doen't exist on pre-ctg. 9414 * The relevant registers doen't exist on pre-ctg.
9416 * As the flip done interrupt doesn't trigger for mmio 9415 * As the flip done interrupt doesn't trigger for mmio
@@ -12357,27 +12356,36 @@ static void intel_setup_outputs(struct drm_device *dev)
12357 if (I915_READ(PCH_DP_D) & DP_DETECTED) 12356 if (I915_READ(PCH_DP_D) & DP_DETECTED)
12358 intel_dp_init(dev, PCH_DP_D, PORT_D); 12357 intel_dp_init(dev, PCH_DP_D, PORT_D);
12359 } else if (IS_VALLEYVIEW(dev)) { 12358 } else if (IS_VALLEYVIEW(dev)) {
12360 if (I915_READ(VLV_DISPLAY_BASE + GEN4_HDMIB) & SDVO_DETECTED) { 12359 /*
12360 * The DP_DETECTED bit is the latched state of the DDC
12361 * SDA pin at boot. However since eDP doesn't require DDC
12362 * (no way to plug in a DP->HDMI dongle) the DDC pins for
12363 * eDP ports may have been muxed to an alternate function.
12364 * Thus we can't rely on the DP_DETECTED bit alone to detect
12365 * eDP ports. Consult the VBT as well as DP_DETECTED to
12366 * detect eDP ports.
12367 */
12368 if (I915_READ(VLV_DISPLAY_BASE + GEN4_HDMIB) & SDVO_DETECTED)
12361 intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIB, 12369 intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIB,
12362 PORT_B); 12370 PORT_B);
12363 if (I915_READ(VLV_DISPLAY_BASE + DP_B) & DP_DETECTED) 12371 if (I915_READ(VLV_DISPLAY_BASE + DP_B) & DP_DETECTED ||
12364 intel_dp_init(dev, VLV_DISPLAY_BASE + DP_B, PORT_B); 12372 intel_dp_is_edp(dev, PORT_B))
12365 } 12373 intel_dp_init(dev, VLV_DISPLAY_BASE + DP_B, PORT_B);
12366 12374
12367 if (I915_READ(VLV_DISPLAY_BASE + GEN4_HDMIC) & SDVO_DETECTED) { 12375 if (I915_READ(VLV_DISPLAY_BASE + GEN4_HDMIC) & SDVO_DETECTED)
12368 intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIC, 12376 intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIC,
12369 PORT_C); 12377 PORT_C);
12370 if (I915_READ(VLV_DISPLAY_BASE + DP_C) & DP_DETECTED) 12378 if (I915_READ(VLV_DISPLAY_BASE + DP_C) & DP_DETECTED ||
12371 intel_dp_init(dev, VLV_DISPLAY_BASE + DP_C, PORT_C); 12379 intel_dp_is_edp(dev, PORT_C))
12372 } 12380 intel_dp_init(dev, VLV_DISPLAY_BASE + DP_C, PORT_C);
12373 12381
12374 if (IS_CHERRYVIEW(dev)) { 12382 if (IS_CHERRYVIEW(dev)) {
12375 if (I915_READ(VLV_DISPLAY_BASE + CHV_HDMID) & SDVO_DETECTED) { 12383 if (I915_READ(VLV_DISPLAY_BASE + CHV_HDMID) & SDVO_DETECTED)
12376 intel_hdmi_init(dev, VLV_DISPLAY_BASE + CHV_HDMID, 12384 intel_hdmi_init(dev, VLV_DISPLAY_BASE + CHV_HDMID,
12377 PORT_D); 12385 PORT_D);
12378 if (I915_READ(VLV_DISPLAY_BASE + DP_D) & DP_DETECTED) 12386 /* eDP not supported on port D, so don't check VBT */
12379 intel_dp_init(dev, VLV_DISPLAY_BASE + DP_D, PORT_D); 12387 if (I915_READ(VLV_DISPLAY_BASE + DP_D) & DP_DETECTED)
12380 } 12388 intel_dp_init(dev, VLV_DISPLAY_BASE + DP_D, PORT_D);
12381 } 12389 }
12382 12390
12383 intel_dsi_init(dev); 12391 intel_dsi_init(dev);
@@ -12879,6 +12887,9 @@ static struct intel_quirk intel_quirks[] = {
12879 /* Acer C720 Chromebook (Core i3 4005U) */ 12887 /* Acer C720 Chromebook (Core i3 4005U) */
12880 { 0x0a16, 0x1025, 0x0a11, quirk_backlight_present }, 12888 { 0x0a16, 0x1025, 0x0a11, quirk_backlight_present },
12881 12889
12890 /* Apple Macbook 2,1 (Core 2 T7400) */
12891 { 0x27a2, 0x8086, 0x7270, quirk_backlight_present },
12892
12882 /* Toshiba CB35 Chromebook (Celeron 2955U) */ 12893 /* Toshiba CB35 Chromebook (Celeron 2955U) */
12883 { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present }, 12894 { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present },
12884 12895