Commit 851855d8 authored by Paulo Zanoni's avatar Paulo Zanoni Committed by Daniel Vetter

drm/i915: add wait_for_vblank argument to intel_enable_pipe

Depending on the HW gen and the connector type, the pipe won't start
running right after we call intel_enable_pipe, so that
intel_wait_for_vblank call we currently have will just sit there for
the full 50ms timeout. So this patch adds an argument that will allow
us to avoid the vblank wait in case we want. Currently all the callers
still request for the vblank wait, so the behavior should still be the
same.

We also added a POSTING_READ on the register: previously
intel_wait_for_vblank was acting as a POSTING_READ, but now if
wait_for_vblank is false we'll stkip it, so we need an explicit
POSTING_READ.
Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 4b6ed685
...@@ -1759,7 +1759,7 @@ static void lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv) ...@@ -1759,7 +1759,7 @@ static void lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv)
* returning. * returning.
*/ */
static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,
bool pch_port, bool dsi) bool pch_port, bool dsi, bool wait_for_vblank)
{ {
enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv, enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
pipe); pipe);
...@@ -1802,6 +1802,8 @@ static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, ...@@ -1802,6 +1802,8 @@ static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,
return; return;
I915_WRITE(reg, val | PIPECONF_ENABLE); I915_WRITE(reg, val | PIPECONF_ENABLE);
POSTING_READ(reg);
if (wait_for_vblank)
intel_wait_for_vblank(dev_priv->dev, pipe); intel_wait_for_vblank(dev_priv->dev, pipe);
} }
...@@ -3599,7 +3601,7 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) ...@@ -3599,7 +3601,7 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
intel_update_watermarks(crtc); intel_update_watermarks(crtc);
intel_enable_pipe(dev_priv, pipe, intel_enable_pipe(dev_priv, pipe,
intel_crtc->config.has_pch_encoder, false); intel_crtc->config.has_pch_encoder, false, true);
intel_enable_primary_plane(dev_priv, plane, pipe); intel_enable_primary_plane(dev_priv, plane, pipe);
intel_enable_planes(crtc); intel_enable_planes(crtc);
intel_crtc_update_cursor(crtc, true); intel_crtc_update_cursor(crtc, true);
...@@ -3745,7 +3747,7 @@ static void haswell_crtc_enable(struct drm_crtc *crtc) ...@@ -3745,7 +3747,7 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
intel_update_watermarks(crtc); intel_update_watermarks(crtc);
intel_enable_pipe(dev_priv, pipe, intel_enable_pipe(dev_priv, pipe,
intel_crtc->config.has_pch_encoder, false); intel_crtc->config.has_pch_encoder, false, true);
if (intel_crtc->config.has_pch_encoder) if (intel_crtc->config.has_pch_encoder)
lpt_pch_enable(crtc); lpt_pch_enable(crtc);
...@@ -4180,7 +4182,7 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc) ...@@ -4180,7 +4182,7 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)
intel_crtc_load_lut(crtc); intel_crtc_load_lut(crtc);
intel_update_watermarks(crtc); intel_update_watermarks(crtc);
intel_enable_pipe(dev_priv, pipe, false, is_dsi); intel_enable_pipe(dev_priv, pipe, false, is_dsi, true);
intel_set_cpu_fifo_underrun_reporting(dev, pipe, true); intel_set_cpu_fifo_underrun_reporting(dev, pipe, true);
intel_enable_primary_plane(dev_priv, plane, pipe); intel_enable_primary_plane(dev_priv, plane, pipe);
intel_enable_planes(crtc); intel_enable_planes(crtc);
...@@ -4219,7 +4221,7 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc) ...@@ -4219,7 +4221,7 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc)
intel_crtc_load_lut(crtc); intel_crtc_load_lut(crtc);
intel_update_watermarks(crtc); intel_update_watermarks(crtc);
intel_enable_pipe(dev_priv, pipe, false, false); intel_enable_pipe(dev_priv, pipe, false, false, true);
intel_set_cpu_fifo_underrun_reporting(dev, pipe, true); intel_set_cpu_fifo_underrun_reporting(dev, pipe, true);
intel_enable_primary_plane(dev_priv, plane, pipe); intel_enable_primary_plane(dev_priv, plane, pipe);
intel_enable_planes(crtc); intel_enable_planes(crtc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment