Commit 22606a18 authored by Damien Lespiau's avatar Damien Lespiau Committed by Daniel Vetter

drm/i915: Consolidate DDI clock reading out in a single function

2 pieces of code need to read out the DDI clock: the DDI encoder and the
MST encoder .get_config() vfuncs.

Until now the SKL read out code was only in the former, so let's move
the pre and post SKL logic in intel_ddi_clock_get() and this this one
everywhere.
Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 371abae8
...@@ -834,7 +834,12 @@ static void hsw_ddi_clock_get(struct intel_encoder *encoder, ...@@ -834,7 +834,12 @@ static void hsw_ddi_clock_get(struct intel_encoder *encoder,
void intel_ddi_clock_get(struct intel_encoder *encoder, void intel_ddi_clock_get(struct intel_encoder *encoder,
struct intel_crtc_config *pipe_config) struct intel_crtc_config *pipe_config)
{ {
hsw_ddi_clock_get(encoder, pipe_config); struct drm_device *dev = encoder->base.dev;
if (INTEL_INFO(dev)->gen <= 8)
hsw_ddi_clock_get(encoder, pipe_config);
else
skl_ddi_clock_get(encoder, pipe_config);
} }
static void static void
...@@ -2029,7 +2034,6 @@ void intel_ddi_get_config(struct intel_encoder *encoder, ...@@ -2029,7 +2034,6 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
enum transcoder cpu_transcoder = intel_crtc->config.cpu_transcoder; enum transcoder cpu_transcoder = intel_crtc->config.cpu_transcoder;
struct intel_hdmi *intel_hdmi; struct intel_hdmi *intel_hdmi;
u32 temp, flags = 0; u32 temp, flags = 0;
struct drm_device *dev = dev_priv->dev;
temp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder)); temp = I915_READ(TRANS_DDI_FUNC_CTL(cpu_transcoder));
if (temp & TRANS_DDI_PHSYNC) if (temp & TRANS_DDI_PHSYNC)
...@@ -2106,10 +2110,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder, ...@@ -2106,10 +2110,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
dev_priv->vbt.edp_bpp = pipe_config->pipe_bpp; dev_priv->vbt.edp_bpp = pipe_config->pipe_bpp;
} }
if (INTEL_INFO(dev)->gen <= 8) intel_ddi_clock_get(encoder, pipe_config);
hsw_ddi_clock_get(encoder, pipe_config);
else
skl_ddi_clock_get(encoder, pipe_config);
} }
static void intel_ddi_destroy(struct drm_encoder *encoder) static void intel_ddi_destroy(struct drm_encoder *encoder)
......
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