aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-04-04 07:28:53 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-04-29 15:56:40 -0400
commit72419203cab9acf173956f5564639b0012cd2604 (patch)
treeb6510199636965ec1280fdbc659b13d1117dd293 /drivers/gpu/drm/i915/intel_display.c
parent08a24034a84866e3abb7fdb35ed0e479b240c205 (diff)
drm/i915: hw state readout support for fdi m/n
We want to use the fdi m/n values to easily compute the adjusted mode dotclock on pch ports. Hence make sure the values stored in the pipe config are always reliable. v2: Fixup FDI TU readout. v3: Rebase on top of moved cpu_transcoder. Reviewed-by: Mika Kuoppala <mika.kuoppala@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.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2c3cbec75b4e..f442e0bc8e9f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5817,6 +5817,22 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
5817 return ret; 5817 return ret;
5818} 5818}
5819 5819
5820static void ironlake_get_fdi_m_n_config(struct intel_crtc *crtc,
5821 struct intel_crtc_config *pipe_config)
5822{
5823 struct drm_device *dev = crtc->base.dev;
5824 struct drm_i915_private *dev_priv = dev->dev_private;
5825 enum transcoder transcoder = pipe_config->cpu_transcoder;
5826
5827 pipe_config->fdi_m_n.link_m = I915_READ(PIPE_LINK_M1(transcoder));
5828 pipe_config->fdi_m_n.link_n = I915_READ(PIPE_LINK_N1(transcoder));
5829 pipe_config->fdi_m_n.gmch_m = I915_READ(PIPE_DATA_M1(transcoder))
5830 & ~TU_SIZE_MASK;
5831 pipe_config->fdi_m_n.gmch_n = I915_READ(PIPE_DATA_N1(transcoder));
5832 pipe_config->fdi_m_n.tu = ((I915_READ(PIPE_DATA_M1(transcoder))
5833 & TU_SIZE_MASK) >> TU_SIZE_SHIFT) + 1;
5834}
5835
5820static bool ironlake_get_pipe_config(struct intel_crtc *crtc, 5836static bool ironlake_get_pipe_config(struct intel_crtc *crtc,
5821 struct intel_crtc_config *pipe_config) 5837 struct intel_crtc_config *pipe_config)
5822{ 5838{
@@ -5834,6 +5850,8 @@ static bool ironlake_get_pipe_config(struct intel_crtc *crtc,
5834 tmp = I915_READ(FDI_RX_CTL(crtc->pipe)); 5850 tmp = I915_READ(FDI_RX_CTL(crtc->pipe));
5835 pipe_config->fdi_lanes = ((FDI_DP_PORT_WIDTH_MASK & tmp) >> 5851 pipe_config->fdi_lanes = ((FDI_DP_PORT_WIDTH_MASK & tmp) >>
5836 FDI_DP_PORT_WIDTH_SHIFT) + 1; 5852 FDI_DP_PORT_WIDTH_SHIFT) + 1;
5853
5854 ironlake_get_fdi_m_n_config(crtc, pipe_config);
5837 } 5855 }
5838 5856
5839 return true; 5857 return true;
@@ -5979,6 +5997,8 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
5979 tmp = I915_READ(FDI_RX_CTL(PIPE_A)); 5997 tmp = I915_READ(FDI_RX_CTL(PIPE_A));
5980 pipe_config->fdi_lanes = ((FDI_DP_PORT_WIDTH_MASK & tmp) >> 5998 pipe_config->fdi_lanes = ((FDI_DP_PORT_WIDTH_MASK & tmp) >>
5981 FDI_DP_PORT_WIDTH_SHIFT) + 1; 5999 FDI_DP_PORT_WIDTH_SHIFT) + 1;
6000
6001 ironlake_get_fdi_m_n_config(crtc, pipe_config);
5982 } 6002 }
5983 6003
5984 return true; 6004 return true;
@@ -7960,6 +7980,11 @@ intel_pipe_config_compare(struct intel_crtc_config *current_config,
7960 7980
7961 PIPE_CONF_CHECK_I(has_pch_encoder); 7981 PIPE_CONF_CHECK_I(has_pch_encoder);
7962 PIPE_CONF_CHECK_I(fdi_lanes); 7982 PIPE_CONF_CHECK_I(fdi_lanes);
7983 PIPE_CONF_CHECK_I(fdi_m_n.gmch_m);
7984 PIPE_CONF_CHECK_I(fdi_m_n.gmch_n);
7985 PIPE_CONF_CHECK_I(fdi_m_n.link_m);
7986 PIPE_CONF_CHECK_I(fdi_m_n.link_n);
7987 PIPE_CONF_CHECK_I(fdi_m_n.tu);
7963 7988
7964#undef PIPE_CONF_CHECK_I 7989#undef PIPE_CONF_CHECK_I
7965 7990