[Intel-gfx] [PATCH v2 16/17] drm/i915: Nuke buf_trans hdmi functions

Jani Nikula jani.nikula at linux.intel.com
Wed Jun 23 14:14:35 UTC 2021


On Tue, 08 Jun 2021, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> All the foo_get_buf_trans_hdmi() functions just reuturn a single table.
> Remove the pointless wrappers.
>
> v2: Handle adl-p
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Less is more.

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

> ---
>  .../drm/i915/display/intel_ddi_buf_trans.c    | 51 +++----------------
>  1 file changed, 7 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> index 2bd51ce4aa2c..a456823df102 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> @@ -1294,15 +1294,6 @@ cnl_get_buf_trans(struct intel_encoder *encoder,
>  	return cnl_get_buf_trans_dp(encoder, n_entries);
>  }
>  
> -static const struct intel_ddi_buf_trans *
> -icl_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 *
>  icl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
>  			   const struct intel_crtc_state *crtc_state,
> @@ -1336,22 +1327,13 @@ icl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			int *n_entries)
>  {
>  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
> -		return icl_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))
>  		return icl_get_combo_buf_trans_edp(encoder, crtc_state, n_entries);
>  	else
>  		return icl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -static const struct intel_ddi_buf_trans *
> -icl_get_mg_buf_trans_hdmi(struct intel_encoder *encoder,
> -			  const struct intel_crtc_state *crtc_state,
> -			  int *n_entries)
> -{
> -	return intel_get_buf_trans(&icl_mg_phy_ddi_translations_hdmi,
> -				   n_entries);
> -}
> -
>  static const struct intel_ddi_buf_trans *
>  icl_get_mg_buf_trans_dp(struct intel_encoder *encoder,
>  			const struct intel_crtc_state *crtc_state,
> @@ -1372,12 +1354,11 @@ icl_get_mg_buf_trans(struct intel_encoder *encoder,
>  		     int *n_entries)
>  {
>  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
> -		return icl_get_mg_buf_trans_hdmi(encoder, crtc_state, n_entries);
> +		return intel_get_buf_trans(&icl_mg_phy_ddi_translations_hdmi, n_entries);
>  	else
>  		return icl_get_mg_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -
>  static const struct intel_ddi_buf_trans *
>  ehl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
>  			    const struct intel_crtc_state *crtc_state,
> @@ -1432,15 +1413,6 @@ jsl_get_combo_buf_trans(struct intel_encoder *encoder,
>  		return intel_get_buf_trans(&icl_combo_phy_ddi_translations_dp_hbr2_edp_hbr3, n_entries);
>  }
>  
> -static const struct intel_ddi_buf_trans *
> -tgl_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 *
>  tgl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
>  			   const struct intel_crtc_state *crtc_state,
> @@ -1490,7 +1462,7 @@ tgl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			int *n_entries)
>  {
>  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
> -		return tgl_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))
>  		return tgl_get_combo_buf_trans_edp(encoder, crtc_state, n_entries);
>  	else
> @@ -1537,7 +1509,7 @@ dg1_get_combo_buf_trans(struct intel_encoder *encoder,
>  			int *n_entries)
>  {
>  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
> -		return icl_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))
>  		return dg1_get_combo_buf_trans_edp(encoder, crtc_state, n_entries);
>  	else
> @@ -1583,22 +1555,13 @@ rkl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			int *n_entries)
>  {
>  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
> -		return tgl_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))
>  		return rkl_get_combo_buf_trans_edp(encoder, crtc_state, n_entries);
>  	else
>  		return rkl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -static const struct intel_ddi_buf_trans *
> -tgl_get_dkl_buf_trans_hdmi(struct intel_encoder *encoder,
> -			   const struct intel_crtc_state *crtc_state,
> -			   int *n_entries)
> -{
> -	return intel_get_buf_trans(&tgl_dkl_phy_ddi_translations_hdmi,
> -				   n_entries);
> -}
> -
>  static const struct intel_ddi_buf_trans *
>  tgl_get_dkl_buf_trans_dp(struct intel_encoder *encoder,
>  			 const struct intel_crtc_state *crtc_state,
> @@ -1619,7 +1582,7 @@ tgl_get_dkl_buf_trans(struct intel_encoder *encoder,
>  		      int *n_entries)
>  {
>  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
> -		return tgl_get_dkl_buf_trans_hdmi(encoder, crtc_state, n_entries);
> +		return intel_get_buf_trans(&tgl_dkl_phy_ddi_translations_hdmi, n_entries);
>  	else
>  		return tgl_get_dkl_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
> @@ -1644,7 +1607,7 @@ adlp_get_dkl_buf_trans(struct intel_encoder *encoder,
>  		       int *n_entries)
>  {
>  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
> -		return tgl_get_dkl_buf_trans_hdmi(encoder, crtc_state, n_entries);
> +		return intel_get_buf_trans(&tgl_dkl_phy_ddi_translations_hdmi, n_entries);
>  	else
>  		return adlp_get_dkl_buf_trans_dp(encoder, crtc_state, n_entries);
>  }

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list