aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2012-10-23 16:29:59 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-26 04:24:47 -0400
commit702e7a56af3780d8b3a717f698209bef44187bb0 (patch)
tree774ace049be76eda200954639b7a27033c11a587 /drivers/gpu/drm/i915/intel_display.c
parente28d54cbf97ca1f8cd49a9756e57ed614d64368d (diff)
drm/i915: convert PIPECONF to use transcoder instead of pipe
Because the PIPECONF register is actually part of the CPU transcoder, not the CPU pipe. Ideally we would also rename PIPECONF to TRANSCONF to remind people that they should use the transcoder instead of the pipe, but let's keep it like this for now since most Gens still name it PIPECONF. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index d89dda02777b..30e3937d5ffc 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1018,9 +1018,11 @@ void intel_wait_for_vblank(struct drm_device *dev, int pipe)
1018void intel_wait_for_pipe_off(struct drm_device *dev, int pipe) 1018void intel_wait_for_pipe_off(struct drm_device *dev, int pipe)
1019{ 1019{
1020 struct drm_i915_private *dev_priv = dev->dev_private; 1020 struct drm_i915_private *dev_priv = dev->dev_private;
1021 enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
1022 pipe);
1021 1023
1022 if (INTEL_INFO(dev)->gen >= 4) { 1024 if (INTEL_INFO(dev)->gen >= 4) {
1023 int reg = PIPECONF(pipe); 1025 int reg = PIPECONF(cpu_transcoder);
1024 1026
1025 /* Wait for the Pipe State to go off */ 1027 /* Wait for the Pipe State to go off */
1026 if (wait_for((I915_READ(reg) & I965_PIPECONF_ACTIVE) == 0, 1028 if (wait_for((I915_READ(reg) & I965_PIPECONF_ACTIVE) == 0,
@@ -1233,12 +1235,14 @@ void assert_pipe(struct drm_i915_private *dev_priv,
1233 int reg; 1235 int reg;
1234 u32 val; 1236 u32 val;
1235 bool cur_state; 1237 bool cur_state;
1238 enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
1239 pipe);
1236 1240
1237 /* if we need the pipe A quirk it must be always on */ 1241 /* if we need the pipe A quirk it must be always on */
1238 if (pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) 1242 if (pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE)
1239 state = true; 1243 state = true;
1240 1244
1241 reg = PIPECONF(pipe); 1245 reg = PIPECONF(cpu_transcoder);
1242 val = I915_READ(reg); 1246 val = I915_READ(reg);
1243 cur_state = !!(val & PIPECONF_ENABLE); 1247 cur_state = !!(val & PIPECONF_ENABLE);
1244 WARN(cur_state != state, 1248 WARN(cur_state != state,
@@ -1756,6 +1760,8 @@ static void intel_disable_transcoder(struct drm_i915_private *dev_priv,
1756static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, 1760static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,
1757 bool pch_port) 1761 bool pch_port)
1758{ 1762{
1763 enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
1764 pipe);
1759 int reg; 1765 int reg;
1760 u32 val; 1766 u32 val;
1761 1767
@@ -1775,7 +1781,7 @@ static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,
1775 /* FIXME: assert CPU port conditions for SNB+ */ 1781 /* FIXME: assert CPU port conditions for SNB+ */
1776 } 1782 }
1777 1783
1778 reg = PIPECONF(pipe); 1784 reg = PIPECONF(cpu_transcoder);
1779 val = I915_READ(reg); 1785 val = I915_READ(reg);
1780 if (val & PIPECONF_ENABLE) 1786 if (val & PIPECONF_ENABLE)
1781 return; 1787 return;
@@ -1799,6 +1805,8 @@ static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,
1799static void intel_disable_pipe(struct drm_i915_private *dev_priv, 1805static void intel_disable_pipe(struct drm_i915_private *dev_priv,
1800 enum pipe pipe) 1806 enum pipe pipe)
1801{ 1807{
1808 enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
1809 pipe);
1802 int reg; 1810 int reg;
1803 u32 val; 1811 u32 val;
1804 1812
@@ -1812,7 +1820,7 @@ static void intel_disable_pipe(struct drm_i915_private *dev_priv,
1812 if (pipe == PIPE_A && (dev_priv->quirks & QUIRK_PIPEA_FORCE)) 1820 if (pipe == PIPE_A && (dev_priv->quirks & QUIRK_PIPEA_FORCE))
1813 return; 1821 return;
1814 1822
1815 reg = PIPECONF(pipe); 1823 reg = PIPECONF(cpu_transcoder);
1816 val = I915_READ(reg); 1824 val = I915_READ(reg);
1817 if ((val & PIPECONF_ENABLE) == 0) 1825 if ((val & PIPECONF_ENABLE) == 0)
1818 return; 1826 return;
@@ -4898,10 +4906,10 @@ static void haswell_set_pipeconf(struct drm_crtc *crtc,
4898{ 4906{
4899 struct drm_i915_private *dev_priv = crtc->dev->dev_private; 4907 struct drm_i915_private *dev_priv = crtc->dev->dev_private;
4900 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 4908 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
4901 int pipe = intel_crtc->pipe; 4909 enum transcoder cpu_transcoder = intel_crtc->cpu_transcoder;
4902 uint32_t val; 4910 uint32_t val;
4903 4911
4904 val = I915_READ(PIPECONF(pipe)); 4912 val = I915_READ(PIPECONF(cpu_transcoder));
4905 4913
4906 val &= ~(PIPECONF_DITHER_EN | PIPECONF_DITHER_TYPE_MASK); 4914 val &= ~(PIPECONF_DITHER_EN | PIPECONF_DITHER_TYPE_MASK);
4907 if (dither) 4915 if (dither)
@@ -4913,8 +4921,8 @@ static void haswell_set_pipeconf(struct drm_crtc *crtc,
4913 else 4921 else
4914 val |= PIPECONF_PROGRESSIVE; 4922 val |= PIPECONF_PROGRESSIVE;
4915 4923
4916 I915_WRITE(PIPECONF(pipe), val); 4924 I915_WRITE(PIPECONF(cpu_transcoder), val);
4917 POSTING_READ(PIPECONF(pipe)); 4925 POSTING_READ(PIPECONF(cpu_transcoder));
4918} 4926}
4919 4927
4920static bool ironlake_compute_clocks(struct drm_crtc *crtc, 4928static bool ironlake_compute_clocks(struct drm_crtc *crtc,
@@ -5388,7 +5396,7 @@ static int haswell_crtc_mode_set(struct drm_crtc *crtc,
5388 WARN(num_connectors != 1, "%d connectors attached to pipe %c\n", 5396 WARN(num_connectors != 1, "%d connectors attached to pipe %c\n",
5389 num_connectors, pipe_name(pipe)); 5397 num_connectors, pipe_name(pipe));
5390 5398
5391 WARN_ON(I915_READ(PIPECONF(pipe)) & 5399 WARN_ON(I915_READ(PIPECONF(intel_crtc->cpu_transcoder)) &
5392 (PIPECONF_ENABLE | I965_PIPECONF_ACTIVE)); 5400 (PIPECONF_ENABLE | I965_PIPECONF_ACTIVE));
5393 5401
5394 WARN_ON(I915_READ(DSPCNTR(plane)) & DISPLAY_PLANE_ENABLE); 5402 WARN_ON(I915_READ(DSPCNTR(plane)) & DISPLAY_PLANE_ENABLE);
@@ -8562,7 +8570,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
8562 u32 reg; 8570 u32 reg;
8563 8571
8564 /* Clear any frame start delays used for debugging left by the BIOS */ 8572 /* Clear any frame start delays used for debugging left by the BIOS */
8565 reg = PIPECONF(crtc->pipe); 8573 reg = PIPECONF(crtc->cpu_transcoder);
8566 I915_WRITE(reg, I915_READ(reg) & ~PIPECONF_FRAME_START_DELAY_MASK); 8574 I915_WRITE(reg, I915_READ(reg) & ~PIPECONF_FRAME_START_DELAY_MASK);
8567 8575
8568 /* We need to sanitize the plane -> pipe mapping first because this will 8576 /* We need to sanitize the plane -> pipe mapping first because this will
@@ -8718,7 +8726,7 @@ void intel_modeset_setup_hw_state(struct drm_device *dev)
8718 for_each_pipe(pipe) { 8726 for_each_pipe(pipe) {
8719 crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); 8727 crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
8720 8728
8721 tmp = I915_READ(PIPECONF(pipe)); 8729 tmp = I915_READ(PIPECONF(crtc->cpu_transcoder));
8722 if (tmp & PIPECONF_ENABLE) 8730 if (tmp & PIPECONF_ENABLE)
8723 crtc->active = true; 8731 crtc->active = true;
8724 else 8732 else
@@ -8912,6 +8920,7 @@ intel_display_capture_error_state(struct drm_device *dev)
8912{ 8920{
8913 drm_i915_private_t *dev_priv = dev->dev_private; 8921 drm_i915_private_t *dev_priv = dev->dev_private;
8914 struct intel_display_error_state *error; 8922 struct intel_display_error_state *error;
8923 enum transcoder cpu_transcoder;
8915 int i; 8924 int i;
8916 8925
8917 error = kmalloc(sizeof(*error), GFP_ATOMIC); 8926 error = kmalloc(sizeof(*error), GFP_ATOMIC);
@@ -8919,6 +8928,8 @@ intel_display_capture_error_state(struct drm_device *dev)
8919 return NULL; 8928 return NULL;
8920 8929
8921 for_each_pipe(i) { 8930 for_each_pipe(i) {
8931 cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv, i);
8932
8922 error->cursor[i].control = I915_READ(CURCNTR(i)); 8933 error->cursor[i].control = I915_READ(CURCNTR(i));
8923 error->cursor[i].position = I915_READ(CURPOS(i)); 8934 error->cursor[i].position = I915_READ(CURPOS(i));
8924 error->cursor[i].base = I915_READ(CURBASE(i)); 8935 error->cursor[i].base = I915_READ(CURBASE(i));
@@ -8933,7 +8944,7 @@ intel_display_capture_error_state(struct drm_device *dev)
8933 error->plane[i].tile_offset = I915_READ(DSPTILEOFF(i)); 8944 error->plane[i].tile_offset = I915_READ(DSPTILEOFF(i));
8934 } 8945 }
8935 8946
8936 error->pipe[i].conf = I915_READ(PIPECONF(i)); 8947 error->pipe[i].conf = I915_READ(PIPECONF(cpu_transcoder));
8937 error->pipe[i].source = I915_READ(PIPESRC(i)); 8948 error->pipe[i].source = I915_READ(PIPESRC(i));
8938 error->pipe[i].htotal = I915_READ(HTOTAL(i)); 8949 error->pipe[i].htotal = I915_READ(HTOTAL(i));
8939 error->pipe[i].hblank = I915_READ(HBLANK(i)); 8950 error->pipe[i].hblank = I915_READ(HBLANK(i));