diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
| -rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 3cddd508d110..080f6fd4e839 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -5815,7 +5815,7 @@ static void intel_set_pipe_csc(struct drm_crtc *crtc) | |||
| 5815 | uint16_t postoff = 0; | 5815 | uint16_t postoff = 0; |
| 5816 | 5816 | ||
| 5817 | if (intel_crtc->config.limited_color_range) | 5817 | if (intel_crtc->config.limited_color_range) |
| 5818 | postoff = (16 * (1 << 13) / 255) & 0x1fff; | 5818 | postoff = (16 * (1 << 12) / 255) & 0x1fff; |
| 5819 | 5819 | ||
| 5820 | I915_WRITE(PIPE_CSC_POSTOFF_HI(pipe), postoff); | 5820 | I915_WRITE(PIPE_CSC_POSTOFF_HI(pipe), postoff); |
| 5821 | I915_WRITE(PIPE_CSC_POSTOFF_ME(pipe), postoff); | 5821 | I915_WRITE(PIPE_CSC_POSTOFF_ME(pipe), postoff); |
| @@ -6402,7 +6402,7 @@ static void hsw_restore_lcpll(struct drm_i915_private *dev_priv) | |||
| 6402 | 6402 | ||
| 6403 | /* Make sure we're not on PC8 state before disabling PC8, otherwise | 6403 | /* Make sure we're not on PC8 state before disabling PC8, otherwise |
| 6404 | * we'll hang the machine! */ | 6404 | * we'll hang the machine! */ |
| 6405 | dev_priv->uncore.funcs.force_wake_get(dev_priv); | 6405 | gen6_gt_force_wake_get(dev_priv); |
| 6406 | 6406 | ||
| 6407 | if (val & LCPLL_POWER_DOWN_ALLOW) { | 6407 | if (val & LCPLL_POWER_DOWN_ALLOW) { |
| 6408 | val &= ~LCPLL_POWER_DOWN_ALLOW; | 6408 | val &= ~LCPLL_POWER_DOWN_ALLOW; |
| @@ -6436,7 +6436,7 @@ static void hsw_restore_lcpll(struct drm_i915_private *dev_priv) | |||
| 6436 | DRM_ERROR("Switching back to LCPLL failed\n"); | 6436 | DRM_ERROR("Switching back to LCPLL failed\n"); |
| 6437 | } | 6437 | } |
| 6438 | 6438 | ||
| 6439 | dev_priv->uncore.funcs.force_wake_put(dev_priv); | 6439 | gen6_gt_force_wake_put(dev_priv); |
| 6440 | } | 6440 | } |
| 6441 | 6441 | ||
| 6442 | void hsw_enable_pc8_work(struct work_struct *__work) | 6442 | void hsw_enable_pc8_work(struct work_struct *__work) |
| @@ -6518,6 +6518,9 @@ static void __hsw_disable_package_c8(struct drm_i915_private *dev_priv) | |||
| 6518 | 6518 | ||
| 6519 | void hsw_enable_package_c8(struct drm_i915_private *dev_priv) | 6519 | void hsw_enable_package_c8(struct drm_i915_private *dev_priv) |
| 6520 | { | 6520 | { |
| 6521 | if (!HAS_PC8(dev_priv->dev)) | ||
| 6522 | return; | ||
| 6523 | |||
| 6521 | mutex_lock(&dev_priv->pc8.lock); | 6524 | mutex_lock(&dev_priv->pc8.lock); |
| 6522 | __hsw_enable_package_c8(dev_priv); | 6525 | __hsw_enable_package_c8(dev_priv); |
| 6523 | mutex_unlock(&dev_priv->pc8.lock); | 6526 | mutex_unlock(&dev_priv->pc8.lock); |
| @@ -6525,6 +6528,9 @@ void hsw_enable_package_c8(struct drm_i915_private *dev_priv) | |||
| 6525 | 6528 | ||
| 6526 | void hsw_disable_package_c8(struct drm_i915_private *dev_priv) | 6529 | void hsw_disable_package_c8(struct drm_i915_private *dev_priv) |
| 6527 | { | 6530 | { |
| 6531 | if (!HAS_PC8(dev_priv->dev)) | ||
| 6532 | return; | ||
| 6533 | |||
| 6528 | mutex_lock(&dev_priv->pc8.lock); | 6534 | mutex_lock(&dev_priv->pc8.lock); |
| 6529 | __hsw_disable_package_c8(dev_priv); | 6535 | __hsw_disable_package_c8(dev_priv); |
| 6530 | mutex_unlock(&dev_priv->pc8.lock); | 6536 | mutex_unlock(&dev_priv->pc8.lock); |
| @@ -6562,6 +6568,9 @@ static void hsw_update_package_c8(struct drm_device *dev) | |||
| 6562 | struct drm_i915_private *dev_priv = dev->dev_private; | 6568 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 6563 | bool allow; | 6569 | bool allow; |
| 6564 | 6570 | ||
| 6571 | if (!HAS_PC8(dev_priv->dev)) | ||
| 6572 | return; | ||
| 6573 | |||
| 6565 | if (!i915_enable_pc8) | 6574 | if (!i915_enable_pc8) |
| 6566 | return; | 6575 | return; |
| 6567 | 6576 | ||
| @@ -6585,18 +6594,28 @@ done: | |||
| 6585 | 6594 | ||
| 6586 | static void hsw_package_c8_gpu_idle(struct drm_i915_private *dev_priv) | 6595 | static void hsw_package_c8_gpu_idle(struct drm_i915_private *dev_priv) |
| 6587 | { | 6596 | { |
| 6597 | if (!HAS_PC8(dev_priv->dev)) | ||
| 6598 | return; | ||
| 6599 | |||
| 6600 | mutex_lock(&dev_priv->pc8.lock); | ||
| 6588 | if (!dev_priv->pc8.gpu_idle) { | 6601 | if (!dev_priv->pc8.gpu_idle) { |
| 6589 | dev_priv->pc8.gpu_idle = true; | 6602 | dev_priv->pc8.gpu_idle = true; |
| 6590 | hsw_enable_package_c8(dev_priv); | 6603 | __hsw_enable_package_c8(dev_priv); |
| 6591 | } | 6604 | } |
| 6605 | mutex_unlock(&dev_priv->pc8.lock); | ||
| 6592 | } | 6606 | } |
| 6593 | 6607 | ||
| 6594 | static void hsw_package_c8_gpu_busy(struct drm_i915_private *dev_priv) | 6608 | static void hsw_package_c8_gpu_busy(struct drm_i915_private *dev_priv) |
| 6595 | { | 6609 | { |
| 6610 | if (!HAS_PC8(dev_priv->dev)) | ||
| 6611 | return; | ||
| 6612 | |||
| 6613 | mutex_lock(&dev_priv->pc8.lock); | ||
| 6596 | if (dev_priv->pc8.gpu_idle) { | 6614 | if (dev_priv->pc8.gpu_idle) { |
| 6597 | dev_priv->pc8.gpu_idle = false; | 6615 | dev_priv->pc8.gpu_idle = false; |
| 6598 | hsw_disable_package_c8(dev_priv); | 6616 | __hsw_disable_package_c8(dev_priv); |
| 6599 | } | 6617 | } |
| 6618 | mutex_unlock(&dev_priv->pc8.lock); | ||
| 6600 | } | 6619 | } |
| 6601 | 6620 | ||
| 6602 | #define for_each_power_domain(domain, mask) \ | 6621 | #define for_each_power_domain(domain, mask) \ |
| @@ -7184,7 +7203,9 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base) | |||
| 7184 | intel_crtc->cursor_visible = visible; | 7203 | intel_crtc->cursor_visible = visible; |
| 7185 | } | 7204 | } |
| 7186 | /* and commit changes on next vblank */ | 7205 | /* and commit changes on next vblank */ |
| 7206 | POSTING_READ(CURCNTR(pipe)); | ||
| 7187 | I915_WRITE(CURBASE(pipe), base); | 7207 | I915_WRITE(CURBASE(pipe), base); |
| 7208 | POSTING_READ(CURBASE(pipe)); | ||
| 7188 | } | 7209 | } |
| 7189 | 7210 | ||
| 7190 | static void ivb_update_cursor(struct drm_crtc *crtc, u32 base) | 7211 | static void ivb_update_cursor(struct drm_crtc *crtc, u32 base) |
| @@ -7213,7 +7234,9 @@ static void ivb_update_cursor(struct drm_crtc *crtc, u32 base) | |||
| 7213 | intel_crtc->cursor_visible = visible; | 7234 | intel_crtc->cursor_visible = visible; |
| 7214 | } | 7235 | } |
| 7215 | /* and commit changes on next vblank */ | 7236 | /* and commit changes on next vblank */ |
| 7237 | POSTING_READ(CURCNTR_IVB(pipe)); | ||
| 7216 | I915_WRITE(CURBASE_IVB(pipe), base); | 7238 | I915_WRITE(CURBASE_IVB(pipe), base); |
| 7239 | POSTING_READ(CURBASE_IVB(pipe)); | ||
| 7217 | } | 7240 | } |
| 7218 | 7241 | ||
| 7219 | /* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */ | 7242 | /* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */ |
| @@ -8331,7 +8354,8 @@ static int intel_gen7_queue_flip(struct drm_device *dev, | |||
| 8331 | intel_ring_emit(ring, ~(DERRMR_PIPEA_PRI_FLIP_DONE | | 8354 | intel_ring_emit(ring, ~(DERRMR_PIPEA_PRI_FLIP_DONE | |
| 8332 | DERRMR_PIPEB_PRI_FLIP_DONE | | 8355 | DERRMR_PIPEB_PRI_FLIP_DONE | |
| 8333 | DERRMR_PIPEC_PRI_FLIP_DONE)); | 8356 | DERRMR_PIPEC_PRI_FLIP_DONE)); |
| 8334 | intel_ring_emit(ring, MI_STORE_REGISTER_MEM(1)); | 8357 | intel_ring_emit(ring, MI_STORE_REGISTER_MEM(1) | |
| 8358 | MI_SRM_LRM_GLOBAL_GTT); | ||
| 8335 | intel_ring_emit(ring, DERRMR); | 8359 | intel_ring_emit(ring, DERRMR); |
| 8336 | intel_ring_emit(ring, ring->scratch.gtt_offset + 256); | 8360 | intel_ring_emit(ring, ring->scratch.gtt_offset + 256); |
| 8337 | } | 8361 | } |
| @@ -9248,8 +9272,7 @@ check_crtc_state(struct drm_device *dev) | |||
| 9248 | enum pipe pipe; | 9272 | enum pipe pipe; |
| 9249 | if (encoder->base.crtc != &crtc->base) | 9273 | if (encoder->base.crtc != &crtc->base) |
| 9250 | continue; | 9274 | continue; |
| 9251 | if (encoder->get_config && | 9275 | if (encoder->get_hw_state(encoder, &pipe)) |
| 9252 | encoder->get_hw_state(encoder, &pipe)) | ||
| 9253 | encoder->get_config(encoder, &pipe_config); | 9276 | encoder->get_config(encoder, &pipe_config); |
| 9254 | } | 9277 | } |
| 9255 | 9278 | ||
| @@ -10027,7 +10050,7 @@ static void intel_setup_outputs(struct drm_device *dev) | |||
| 10027 | intel_ddi_init(dev, PORT_D); | 10050 | intel_ddi_init(dev, PORT_D); |
| 10028 | } else if (HAS_PCH_SPLIT(dev)) { | 10051 | } else if (HAS_PCH_SPLIT(dev)) { |
| 10029 | int found; | 10052 | int found; |
| 10030 | dpd_is_edp = intel_dpd_is_edp(dev); | 10053 | dpd_is_edp = intel_dp_is_edp(dev, PORT_D); |
| 10031 | 10054 | ||
| 10032 | if (has_edp_a(dev)) | 10055 | if (has_edp_a(dev)) |
| 10033 | intel_dp_init(dev, DP_A, PORT_A); | 10056 | intel_dp_init(dev, DP_A, PORT_A); |
| @@ -10064,8 +10087,7 @@ static void intel_setup_outputs(struct drm_device *dev) | |||
| 10064 | intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIC, | 10087 | intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIC, |
| 10065 | PORT_C); | 10088 | PORT_C); |
| 10066 | if (I915_READ(VLV_DISPLAY_BASE + DP_C) & DP_DETECTED) | 10089 | if (I915_READ(VLV_DISPLAY_BASE + DP_C) & DP_DETECTED) |
| 10067 | intel_dp_init(dev, VLV_DISPLAY_BASE + DP_C, | 10090 | intel_dp_init(dev, VLV_DISPLAY_BASE + DP_C, PORT_C); |
| 10068 | PORT_C); | ||
| 10069 | } | 10091 | } |
| 10070 | 10092 | ||
| 10071 | intel_dsi_init(dev); | 10093 | intel_dsi_init(dev); |
| @@ -10909,8 +10931,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) | |||
| 10909 | if (encoder->get_hw_state(encoder, &pipe)) { | 10931 | if (encoder->get_hw_state(encoder, &pipe)) { |
| 10910 | crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); | 10932 | crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); |
| 10911 | encoder->base.crtc = &crtc->base; | 10933 | encoder->base.crtc = &crtc->base; |
| 10912 | if (encoder->get_config) | 10934 | encoder->get_config(encoder, &crtc->config); |
| 10913 | encoder->get_config(encoder, &crtc->config); | ||
| 10914 | } else { | 10935 | } else { |
| 10915 | encoder->base.crtc = NULL; | 10936 | encoder->base.crtc = NULL; |
| 10916 | } | 10937 | } |
