提交 575f7ab7 编写于 作者: V Ville Syrjälä 提交者: Daniel Vetter

drm/i915: Pass intel_crtc to intel_disable_pipe() and intel_wait_for_pipe_off()

Just pass the intel_crtc around instead of dev_priv+pipe.

Also make intel_wait_for_pipe_off() static since it's only used in
intel_display.c.
Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: NThomas Richter <richter@rus.uni-stuttgart.de>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 81e7f200
...@@ -967,8 +967,7 @@ static bool pipe_dsl_stopped(struct drm_device *dev, enum pipe pipe) ...@@ -967,8 +967,7 @@ static bool pipe_dsl_stopped(struct drm_device *dev, enum pipe pipe)
/* /*
* intel_wait_for_pipe_off - wait for pipe to turn off * intel_wait_for_pipe_off - wait for pipe to turn off
* @dev: drm device * @crtc: crtc whose pipe to wait for
* @pipe: pipe to wait for
* *
* After disabling a pipe, we can't wait for vblank in the usual way, * After disabling a pipe, we can't wait for vblank in the usual way,
* spinning on the vblank interrupt status bit, since we won't actually * spinning on the vblank interrupt status bit, since we won't actually
...@@ -982,11 +981,12 @@ static bool pipe_dsl_stopped(struct drm_device *dev, enum pipe pipe) ...@@ -982,11 +981,12 @@ static bool pipe_dsl_stopped(struct drm_device *dev, enum pipe pipe)
* ends up stopping at the start of the next frame). * ends up stopping at the start of the next frame).
* *
*/ */
void intel_wait_for_pipe_off(struct drm_device *dev, int pipe) static void intel_wait_for_pipe_off(struct intel_crtc *crtc)
{ {
struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv, enum transcoder cpu_transcoder = crtc->config.cpu_transcoder;
pipe); enum pipe pipe = crtc->pipe;
if (INTEL_INFO(dev)->gen >= 4) { if (INTEL_INFO(dev)->gen >= 4) {
int reg = PIPECONF(cpu_transcoder); int reg = PIPECONF(cpu_transcoder);
...@@ -2042,21 +2042,19 @@ static void intel_enable_pipe(struct intel_crtc *crtc) ...@@ -2042,21 +2042,19 @@ static void intel_enable_pipe(struct intel_crtc *crtc)
/** /**
* intel_disable_pipe - disable a pipe, asserting requirements * intel_disable_pipe - disable a pipe, asserting requirements
* @dev_priv: i915 private structure * @crtc: crtc whose pipes is to be disabled
* @pipe: pipe to disable
* *
* Disable @pipe, making sure that various hardware specific requirements * Disable the pipe of @crtc, making sure that various hardware
* are met, if applicable, e.g. plane disabled, panel fitter off, etc. * specific requirements are met, if applicable, e.g. plane
* * disabled, panel fitter off, etc.
* @pipe should be %PIPE_A or %PIPE_B.
* *
* Will wait until the pipe has shut down before returning. * Will wait until the pipe has shut down before returning.
*/ */
static void intel_disable_pipe(struct drm_i915_private *dev_priv, static void intel_disable_pipe(struct intel_crtc *crtc)
enum pipe pipe)
{ {
enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv, struct drm_i915_private *dev_priv = crtc->base.dev->dev_private;
pipe); enum transcoder cpu_transcoder = crtc->config.cpu_transcoder;
enum pipe pipe = crtc->pipe;
int reg; int reg;
u32 val; u32 val;
...@@ -2078,7 +2076,7 @@ static void intel_disable_pipe(struct drm_i915_private *dev_priv, ...@@ -2078,7 +2076,7 @@ static void intel_disable_pipe(struct drm_i915_private *dev_priv,
return; return;
I915_WRITE(reg, val & ~PIPECONF_ENABLE); I915_WRITE(reg, val & ~PIPECONF_ENABLE);
intel_wait_for_pipe_off(dev_priv->dev, pipe); intel_wait_for_pipe_off(crtc);
} }
/* /*
...@@ -4211,7 +4209,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) ...@@ -4211,7 +4209,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
if (intel_crtc->config.has_pch_encoder) if (intel_crtc->config.has_pch_encoder)
intel_set_pch_fifo_underrun_reporting(dev, pipe, false); intel_set_pch_fifo_underrun_reporting(dev, pipe, false);
intel_disable_pipe(dev_priv, pipe); intel_disable_pipe(intel_crtc);
if (intel_crtc->config.dp_encoder_is_mst) if (intel_crtc->config.dp_encoder_is_mst)
intel_ddi_set_vc_payload_alloc(crtc, false); intel_ddi_set_vc_payload_alloc(crtc, false);
...@@ -4263,7 +4261,6 @@ static void haswell_crtc_disable(struct drm_crtc *crtc) ...@@ -4263,7 +4261,6 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct intel_encoder *encoder; struct intel_encoder *encoder;
int pipe = intel_crtc->pipe;
enum transcoder cpu_transcoder = intel_crtc->config.cpu_transcoder; enum transcoder cpu_transcoder = intel_crtc->config.cpu_transcoder;
if (!intel_crtc->active) if (!intel_crtc->active)
...@@ -4278,7 +4275,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc) ...@@ -4278,7 +4275,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
if (intel_crtc->config.has_pch_encoder) if (intel_crtc->config.has_pch_encoder)
intel_set_pch_fifo_underrun_reporting(dev, TRANSCODER_A, false); intel_set_pch_fifo_underrun_reporting(dev, TRANSCODER_A, false);
intel_disable_pipe(dev_priv, pipe); intel_disable_pipe(intel_crtc);
intel_ddi_disable_transcoder_func(dev_priv, cpu_transcoder); intel_ddi_disable_transcoder_func(dev_priv, cpu_transcoder);
...@@ -4865,7 +4862,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc) ...@@ -4865,7 +4862,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
*/ */
intel_wait_for_vblank(dev, pipe); intel_wait_for_vblank(dev, pipe);
intel_disable_pipe(dev_priv, pipe); intel_disable_pipe(intel_crtc);
i9xx_pfit_disable(intel_crtc); i9xx_pfit_disable(intel_crtc);
......
...@@ -831,7 +831,6 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, ...@@ -831,7 +831,6 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv, enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
enum pipe pipe); enum pipe pipe);
void intel_wait_for_vblank(struct drm_device *dev, int pipe); void intel_wait_for_vblank(struct drm_device *dev, int pipe);
void intel_wait_for_pipe_off(struct drm_device *dev, int pipe);
int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp); int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp);
void vlv_wait_port_ready(struct drm_i915_private *dev_priv, void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
struct intel_digital_port *dport); struct intel_digital_port *dport);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册