Commit 2b3bc165 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Clean up jsl/ehl buf trans functions

The jsl/ehl buf trans functions are needlessly complicated.
Simplify them.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210608073603.2408-16-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 019d8146
...@@ -1377,42 +1377,16 @@ icl_get_mg_buf_trans(struct intel_encoder *encoder, ...@@ -1377,42 +1377,16 @@ icl_get_mg_buf_trans(struct intel_encoder *encoder,
return icl_get_mg_buf_trans_dp(encoder, crtc_state, n_entries); return icl_get_mg_buf_trans_dp(encoder, crtc_state, n_entries);
} }
static const struct intel_ddi_buf_trans *
ehl_get_combo_buf_trans_hdmi(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
int *n_entries)
{
return intel_get_buf_trans(&icl_combo_phy_ddi_translations_hdmi,
n_entries);
}
static const struct intel_ddi_buf_trans *
ehl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
int *n_entries)
{
return intel_get_buf_trans(&ehl_combo_phy_ddi_translations_dp,
n_entries);
}
static const struct intel_ddi_buf_trans * static const struct intel_ddi_buf_trans *
ehl_get_combo_buf_trans_edp(struct intel_encoder *encoder, ehl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state, const struct intel_crtc_state *crtc_state,
int *n_entries) int *n_entries)
{ {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); if (crtc_state->port_clock > 270000)
return intel_get_buf_trans(&ehl_combo_phy_ddi_translations_edp_hbr2, n_entries);
if (dev_priv->vbt.edp.low_vswing) { else
if (crtc_state->port_clock > 270000) { return intel_get_buf_trans(&icl_combo_phy_ddi_translations_edp_hbr2, n_entries);
return intel_get_buf_trans(&ehl_combo_phy_ddi_translations_edp_hbr2,
n_entries);
} else {
return intel_get_buf_trans(&icl_combo_phy_ddi_translations_edp_hbr2,
n_entries);
}
}
return ehl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
} }
static const struct intel_ddi_buf_trans * static const struct intel_ddi_buf_trans *
...@@ -1420,30 +1394,15 @@ ehl_get_combo_buf_trans(struct intel_encoder *encoder, ...@@ -1420,30 +1394,15 @@ ehl_get_combo_buf_trans(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state, const struct intel_crtc_state *crtc_state,
int *n_entries) int *n_entries)
{ {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
return ehl_get_combo_buf_trans_hdmi(encoder, crtc_state, n_entries); return intel_get_buf_trans(&icl_combo_phy_ddi_translations_hdmi, n_entries);
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP)) else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
dev_priv->vbt.edp.low_vswing)
return ehl_get_combo_buf_trans_edp(encoder, crtc_state, n_entries); return ehl_get_combo_buf_trans_edp(encoder, crtc_state, n_entries);
else else
return ehl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries); return intel_get_buf_trans(&ehl_combo_phy_ddi_translations_dp, n_entries);
}
static const struct intel_ddi_buf_trans *
jsl_get_combo_buf_trans_hdmi(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
int *n_entries)
{
return intel_get_buf_trans(&icl_combo_phy_ddi_translations_hdmi,
n_entries);
}
static const struct intel_ddi_buf_trans *
jsl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
int *n_entries)
{
return intel_get_buf_trans(&icl_combo_phy_ddi_translations_dp_hbr2_edp_hbr3,
n_entries);
} }
static const struct intel_ddi_buf_trans * static const struct intel_ddi_buf_trans *
...@@ -1451,19 +1410,10 @@ jsl_get_combo_buf_trans_edp(struct intel_encoder *encoder, ...@@ -1451,19 +1410,10 @@ jsl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state, const struct intel_crtc_state *crtc_state,
int *n_entries) int *n_entries)
{ {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); if (crtc_state->port_clock > 270000)
return intel_get_buf_trans(&jsl_combo_phy_ddi_translations_edp_hbr2, n_entries);
if (dev_priv->vbt.edp.low_vswing) { else
if (crtc_state->port_clock > 270000) { return intel_get_buf_trans(&jsl_combo_phy_ddi_translations_edp_hbr, n_entries);
return intel_get_buf_trans(&jsl_combo_phy_ddi_translations_edp_hbr2,
n_entries);
} else {
return intel_get_buf_trans(&jsl_combo_phy_ddi_translations_edp_hbr,
n_entries);
}
}
return jsl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
} }
static const struct intel_ddi_buf_trans * static const struct intel_ddi_buf_trans *
...@@ -1471,12 +1421,15 @@ jsl_get_combo_buf_trans(struct intel_encoder *encoder, ...@@ -1471,12 +1421,15 @@ jsl_get_combo_buf_trans(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state, const struct intel_crtc_state *crtc_state,
int *n_entries) int *n_entries)
{ {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
return jsl_get_combo_buf_trans_hdmi(encoder, crtc_state, n_entries); return intel_get_buf_trans(&icl_combo_phy_ddi_translations_hdmi, n_entries);
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP)) else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
dev_priv->vbt.edp.low_vswing)
return jsl_get_combo_buf_trans_edp(encoder, crtc_state, n_entries); return jsl_get_combo_buf_trans_edp(encoder, crtc_state, n_entries);
else else
return jsl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries); return intel_get_buf_trans(&icl_combo_phy_ddi_translations_dp_hbr2_edp_hbr3, n_entries);
} }
static const struct intel_ddi_buf_trans * static const struct intel_ddi_buf_trans *
......
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