Commit 3e022c1f authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Nuke intel_ddi_hdmi_num_entries()

Since intel_ddi_level() now looks at the buf_trans table there's
no point in having intel_ddi_hdmi_num_entries() around. Just
roll the necessary bits of locic into
intel_ddi_hdmi_level()/intel_ddi_level().
Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211001130107.1746-8-ville.syrjala@linux.intel.com
parent 2c63e0f9
...@@ -74,20 +74,13 @@ static const u8 index_to_dp_signal_levels[] = { ...@@ -74,20 +74,13 @@ static const u8 index_to_dp_signal_levels[] = {
}; };
static int intel_ddi_hdmi_level(struct intel_encoder *encoder, static int intel_ddi_hdmi_level(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state) const struct intel_ddi_buf_trans *trans)
{ {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); int level;
int n_entries, level, default_entry;
n_entries = intel_ddi_hdmi_num_entries(encoder, crtc_state, &default_entry);
if (n_entries == 0)
return 0;
level = intel_bios_hdmi_level_shift(encoder); level = intel_bios_hdmi_level_shift(encoder);
if (level < 0) if (level < 0)
level = default_entry; level = trans->hdmi_default_entry;
if (drm_WARN_ON_ONCE(&dev_priv->drm, level >= n_entries))
level = n_entries - 1;
return level; return level;
} }
...@@ -142,7 +135,7 @@ static void hsw_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder, ...@@ -142,7 +135,7 @@ static void hsw_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state) const struct intel_crtc_state *crtc_state)
{ {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
int level = intel_ddi_hdmi_level(encoder, crtc_state); int level = intel_ddi_level(encoder, crtc_state);
u32 iboost_bit = 0; u32 iboost_bit = 0;
int n_entries; int n_entries;
enum port port = encoder->port; enum port port = encoder->port;
...@@ -1366,7 +1359,7 @@ int intel_ddi_level(struct intel_encoder *encoder, ...@@ -1366,7 +1359,7 @@ int intel_ddi_level(struct intel_encoder *encoder,
return 0; return 0;
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
level = intel_ddi_hdmi_level(encoder, crtc_state); level = intel_ddi_hdmi_level(encoder, trans);
else else
level = intel_ddi_dp_level(enc_to_intel_dp(encoder)); level = intel_ddi_dp_level(enc_to_intel_dp(encoder));
......
...@@ -1617,26 +1617,6 @@ dg2_get_snps_buf_trans(struct intel_encoder *encoder, ...@@ -1617,26 +1617,6 @@ dg2_get_snps_buf_trans(struct intel_encoder *encoder,
return intel_get_buf_trans(&dg2_snps_trans, n_entries); return intel_get_buf_trans(&dg2_snps_trans, n_entries);
} }
int intel_ddi_hdmi_num_entries(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
int *default_entry)
{
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
const struct intel_ddi_buf_trans *trans;
int n_entries;
trans = encoder->get_buf_trans(encoder, crtc_state, &n_entries);
if (drm_WARN_ON(&dev_priv->drm, !trans)) {
*default_entry = 0;
return 0;
}
*default_entry = trans->hdmi_default_entry;
return n_entries;
}
void intel_ddi_buf_trans_init(struct intel_encoder *encoder) void intel_ddi_buf_trans_init(struct intel_encoder *encoder)
{ {
struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct drm_i915_private *i915 = to_i915(encoder->base.dev);
......
...@@ -68,10 +68,6 @@ struct intel_ddi_buf_trans { ...@@ -68,10 +68,6 @@ struct intel_ddi_buf_trans {
bool is_hobl_buf_trans(const struct intel_ddi_buf_trans *table); bool is_hobl_buf_trans(const struct intel_ddi_buf_trans *table);
int intel_ddi_hdmi_num_entries(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state,
int *default_entry);
void intel_ddi_buf_trans_init(struct intel_encoder *encoder); void intel_ddi_buf_trans_init(struct intel_encoder *encoder);
#endif #endif
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