Commit 6149cb68 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Nuke intel_dp_get_m_n()

As with intel_dp_set_m_n() let's get rid of the wrapper and just
call the relevant PCH vs. CPU transcoder functions directly.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220128103757.22461-3-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 8023d3be
...@@ -333,6 +333,18 @@ static bool intel_dp_get_hw_state(struct intel_encoder *encoder, ...@@ -333,6 +333,18 @@ static bool intel_dp_get_hw_state(struct intel_encoder *encoder,
return ret; return ret;
} }
static void g4x_dp_get_m_n(struct intel_crtc_state *crtc_state)
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
if (crtc_state->has_pch_encoder)
intel_pch_transcoder_get_m_n(crtc, &crtc_state->dp_m_n);
else
intel_cpu_transcoder_get_m_n(crtc, crtc_state->cpu_transcoder,
&crtc_state->dp_m_n,
&crtc_state->dp_m2_n2);
}
static void intel_dp_get_config(struct intel_encoder *encoder, static void intel_dp_get_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config) struct intel_crtc_state *pipe_config)
{ {
...@@ -384,7 +396,7 @@ static void intel_dp_get_config(struct intel_encoder *encoder, ...@@ -384,7 +396,7 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
pipe_config->lane_count = pipe_config->lane_count =
((tmp & DP_PORT_WIDTH_MASK) >> DP_PORT_WIDTH_SHIFT) + 1; ((tmp & DP_PORT_WIDTH_MASK) >> DP_PORT_WIDTH_SHIFT) + 1;
intel_dp_get_m_n(crtc, pipe_config); g4x_dp_get_m_n(pipe_config);
if (port == PORT_A) { if (port == PORT_A) {
if ((intel_de_read(dev_priv, DP_A) & DP_PLL_FREQ_MASK) == DP_PLL_FREQ_162MHZ) if ((intel_de_read(dev_priv, DP_A) & DP_PLL_FREQ_MASK) == DP_PLL_FREQ_162MHZ)
......
...@@ -3360,7 +3360,10 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder, ...@@ -3360,7 +3360,10 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
pipe_config->output_types |= BIT(INTEL_OUTPUT_DP); pipe_config->output_types |= BIT(INTEL_OUTPUT_DP);
pipe_config->lane_count = pipe_config->lane_count =
((temp & DDI_PORT_WIDTH_MASK) >> DDI_PORT_WIDTH_SHIFT) + 1; ((temp & DDI_PORT_WIDTH_MASK) >> DDI_PORT_WIDTH_SHIFT) + 1;
intel_dp_get_m_n(crtc, pipe_config);
intel_cpu_transcoder_get_m_n(crtc, cpu_transcoder,
&pipe_config->dp_m_n,
&pipe_config->dp_m2_n2);
if (DISPLAY_VER(dev_priv) >= 11) { if (DISPLAY_VER(dev_priv) >= 11) {
i915_reg_t dp_tp_ctl = dp_tp_ctl_reg(encoder, pipe_config); i915_reg_t dp_tp_ctl = dp_tp_ctl_reg(encoder, pipe_config);
...@@ -3397,7 +3400,9 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder, ...@@ -3397,7 +3400,9 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
pipe_config->mst_master_transcoder = pipe_config->mst_master_transcoder =
REG_FIELD_GET(TRANS_DDI_MST_TRANSPORT_SELECT_MASK, temp); REG_FIELD_GET(TRANS_DDI_MST_TRANSPORT_SELECT_MASK, temp);
intel_dp_get_m_n(crtc, pipe_config); intel_cpu_transcoder_get_m_n(crtc, cpu_transcoder,
&pipe_config->dp_m_n,
&pipe_config->dp_m2_n2);
pipe_config->infoframes.enable |= pipe_config->infoframes.enable |=
intel_hdmi_infoframes_enabled(encoder, pipe_config); intel_hdmi_infoframes_enabled(encoder, pipe_config);
......
...@@ -3856,8 +3856,8 @@ static void intel_get_m_n(struct drm_i915_private *i915, ...@@ -3856,8 +3856,8 @@ static void intel_get_m_n(struct drm_i915_private *i915,
m_n->tu = REG_FIELD_GET(TU_SIZE_MASK, intel_de_read(i915, data_m_reg)) + 1; m_n->tu = REG_FIELD_GET(TU_SIZE_MASK, intel_de_read(i915, data_m_reg)) + 1;
} }
static void intel_pch_transcoder_get_m_n(struct intel_crtc *crtc, void intel_pch_transcoder_get_m_n(struct intel_crtc *crtc,
struct intel_link_m_n *m_n) struct intel_link_m_n *m_n)
{ {
struct drm_device *dev = crtc->base.dev; struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
...@@ -3868,10 +3868,10 @@ static void intel_pch_transcoder_get_m_n(struct intel_crtc *crtc, ...@@ -3868,10 +3868,10 @@ static void intel_pch_transcoder_get_m_n(struct intel_crtc *crtc,
PCH_TRANS_LINK_M1(pipe), PCH_TRANS_LINK_N1(pipe)); PCH_TRANS_LINK_M1(pipe), PCH_TRANS_LINK_N1(pipe));
} }
static void intel_cpu_transcoder_get_m_n(struct intel_crtc *crtc, void intel_cpu_transcoder_get_m_n(struct intel_crtc *crtc,
enum transcoder transcoder, enum transcoder transcoder,
struct intel_link_m_n *m_n, struct intel_link_m_n *m_n,
struct intel_link_m_n *m2_n2) struct intel_link_m_n *m2_n2)
{ {
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
enum pipe pipe = crtc->pipe; enum pipe pipe = crtc->pipe;
...@@ -3893,17 +3893,6 @@ static void intel_cpu_transcoder_get_m_n(struct intel_crtc *crtc, ...@@ -3893,17 +3893,6 @@ static void intel_cpu_transcoder_get_m_n(struct intel_crtc *crtc,
} }
} }
void intel_dp_get_m_n(struct intel_crtc *crtc,
struct intel_crtc_state *pipe_config)
{
if (pipe_config->has_pch_encoder)
intel_pch_transcoder_get_m_n(crtc, &pipe_config->dp_m_n);
else
intel_cpu_transcoder_get_m_n(crtc, pipe_config->cpu_transcoder,
&pipe_config->dp_m_n,
&pipe_config->dp_m2_n2);
}
void ilk_get_fdi_m_n_config(struct intel_crtc *crtc, void ilk_get_fdi_m_n_config(struct intel_crtc *crtc,
struct intel_crtc_state *pipe_config) struct intel_crtc_state *pipe_config)
{ {
......
...@@ -604,11 +604,15 @@ bool intel_fuzzy_clock_check(int clock1, int clock2); ...@@ -604,11 +604,15 @@ bool intel_fuzzy_clock_check(int clock1, int clock2);
void intel_display_prepare_reset(struct drm_i915_private *dev_priv); void intel_display_prepare_reset(struct drm_i915_private *dev_priv);
void intel_display_finish_reset(struct drm_i915_private *dev_priv); void intel_display_finish_reset(struct drm_i915_private *dev_priv);
void intel_dp_get_m_n(struct intel_crtc *crtc,
struct intel_crtc_state *pipe_config);
void intel_cpu_transcoder_set_m_n(const struct intel_crtc_state *crtc_state, void intel_cpu_transcoder_set_m_n(const struct intel_crtc_state *crtc_state,
const struct intel_link_m_n *m_n, const struct intel_link_m_n *m_n,
const struct intel_link_m_n *m2_n2); const struct intel_link_m_n *m2_n2);
void intel_cpu_transcoder_get_m_n(struct intel_crtc *crtc,
enum transcoder cpu_transcoder,
struct intel_link_m_n *m_n,
struct intel_link_m_n *m2_n2);
void intel_pch_transcoder_get_m_n(struct intel_crtc *crtc,
struct intel_link_m_n *m_n);
void ilk_get_fdi_m_n_config(struct intel_crtc *crtc, void ilk_get_fdi_m_n_config(struct intel_crtc *crtc,
struct intel_crtc_state *pipe_config); struct intel_crtc_state *pipe_config);
void i9xx_crtc_clock_get(struct intel_crtc *crtc, void i9xx_crtc_clock_get(struct intel_crtc *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