[Intel-gfx] [PATCH v2 07/17] drm/i915; Return the whole buf_trans struct from get_buf_trans()

Jani Nikula jani.nikula at intel.com
Fri Jun 18 12:11:47 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>
>
> Raise the abstraction level of the get_buf_trans() functions
> a bit more by returning the whole wrapper intel_ddi_buf_trans
> struct.
>
> v2: Handle adl-p
>
> Reviewed-by: Jani Nikula <jani.nikula at intel.com> #v1

Holds for v2.

> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c      | 76 +++++++-------
>  .../drm/i915/display/intel_ddi_buf_trans.c    | 98 +++++++++----------
>  .../drm/i915/display/intel_ddi_buf_trans.h    | 22 ++---
>  3 files changed, 98 insertions(+), 98 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index f3fba535812c..37445cec0c23 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -102,7 +102,7 @@ void hsw_prepare_dp_ddi_buffers(struct intel_encoder *encoder,
>  	u32 iboost_bit = 0;
>  	int i, n_entries;
>  	enum port port = encoder->port;
> -	const union intel_ddi_buf_trans_entry *ddi_translations;
> +	const struct intel_ddi_buf_trans *ddi_translations;
>  
>  	ddi_translations = hsw_get_buf_trans(encoder, crtc_state, &n_entries);
>  
> @@ -116,9 +116,9 @@ void hsw_prepare_dp_ddi_buffers(struct intel_encoder *encoder,
>  
>  	for (i = 0; i < n_entries; i++) {
>  		intel_de_write(dev_priv, DDI_BUF_TRANS_LO(port, i),
> -			       ddi_translations[i].hsw.trans1 | iboost_bit);
> +			       ddi_translations->entries[i].hsw.trans1 | iboost_bit);
>  		intel_de_write(dev_priv, DDI_BUF_TRANS_HI(port, i),
> -			       ddi_translations[i].hsw.trans2);
> +			       ddi_translations->entries[i].hsw.trans2);
>  	}
>  }
>  
> @@ -135,7 +135,7 @@ static void hsw_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder,
>  	u32 iboost_bit = 0;
>  	int n_entries;
>  	enum port port = encoder->port;
> -	const union intel_ddi_buf_trans_entry *ddi_translations;
> +	const struct intel_ddi_buf_trans *ddi_translations;
>  
>  	ddi_translations = hsw_get_buf_trans(encoder, crtc_state,  &n_entries);
>  
> @@ -151,9 +151,9 @@ static void hsw_prepare_hdmi_ddi_buffers(struct intel_encoder *encoder,
>  
>  	/* Entry 9 is for HDMI: */
>  	intel_de_write(dev_priv, DDI_BUF_TRANS_LO(port, 9),
> -		       ddi_translations[level].hsw.trans1 | iboost_bit);
> +		       ddi_translations->entries[level].hsw.trans1 | iboost_bit);
>  	intel_de_write(dev_priv, DDI_BUF_TRANS_HI(port, 9),
> -		       ddi_translations[level].hsw.trans2);
> +		       ddi_translations->entries[level].hsw.trans2);
>  }
>  
>  void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv,
> @@ -944,7 +944,7 @@ static void skl_ddi_set_iboost(struct intel_encoder *encoder,
>  		iboost = intel_bios_encoder_dp_boost_level(encoder->devdata);
>  
>  	if (iboost == 0) {
> -		const union intel_ddi_buf_trans_entry *ddi_translations;
> +		const struct intel_ddi_buf_trans *ddi_translations;
>  		int n_entries;
>  
>  		ddi_translations = hsw_get_buf_trans(encoder, crtc_state, &n_entries);
> @@ -954,7 +954,7 @@ static void skl_ddi_set_iboost(struct intel_encoder *encoder,
>  		if (drm_WARN_ON_ONCE(&dev_priv->drm, level >= n_entries))
>  			level = n_entries - 1;
>  
> -		iboost = ddi_translations[level].hsw.i_boost;
> +		iboost = ddi_translations->entries[level].hsw.i_boost;
>  	}
>  
>  	/* Make sure that the requested I_boost is valid */
> @@ -974,7 +974,7 @@ static void bxt_ddi_vswing_sequence(struct intel_encoder *encoder,
>  				    int level)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	const union intel_ddi_buf_trans_entry *ddi_translations;
> +	const struct intel_ddi_buf_trans *ddi_translations;
>  	enum port port = encoder->port;
>  	int n_entries;
>  
> @@ -985,10 +985,10 @@ static void bxt_ddi_vswing_sequence(struct intel_encoder *encoder,
>  		level = n_entries - 1;
>  
>  	bxt_ddi_phy_set_signal_level(dev_priv, port,
> -				     ddi_translations[level].bxt.margin,
> -				     ddi_translations[level].bxt.scale,
> -				     ddi_translations[level].bxt.enable,
> -				     ddi_translations[level].bxt.deemphasis);
> +				     ddi_translations->entries[level].bxt.margin,
> +				     ddi_translations->entries[level].bxt.scale,
> +				     ddi_translations->entries[level].bxt.enable,
> +				     ddi_translations->entries[level].bxt.deemphasis);
>  }
>  
>  static u8 intel_ddi_dp_voltage_max(struct intel_dp *intel_dp,
> @@ -1049,7 +1049,7 @@ static void cnl_ddi_vswing_program(struct intel_encoder *encoder,
>  				   int level)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	const union intel_ddi_buf_trans_entry *ddi_translations;
> +	const struct intel_ddi_buf_trans *ddi_translations;
>  	enum port port = encoder->port;
>  	int n_entries, ln;
>  	u32 val;
> @@ -1071,8 +1071,8 @@ static void cnl_ddi_vswing_program(struct intel_encoder *encoder,
>  	val = intel_de_read(dev_priv, CNL_PORT_TX_DW2_LN0(port));
>  	val &= ~(SWING_SEL_LOWER_MASK | SWING_SEL_UPPER_MASK |
>  		 RCOMP_SCALAR_MASK);
> -	val |= SWING_SEL_UPPER(ddi_translations[level].cnl.dw2_swing_sel);
> -	val |= SWING_SEL_LOWER(ddi_translations[level].cnl.dw2_swing_sel);
> +	val |= SWING_SEL_UPPER(ddi_translations->entries[level].cnl.dw2_swing_sel);
> +	val |= SWING_SEL_LOWER(ddi_translations->entries[level].cnl.dw2_swing_sel);
>  	/* Rcomp scalar is fixed as 0x98 for every table entry */
>  	val |= RCOMP_SCALAR(0x98);
>  	intel_de_write(dev_priv, CNL_PORT_TX_DW2_GRP(port), val);
> @@ -1083,9 +1083,9 @@ static void cnl_ddi_vswing_program(struct intel_encoder *encoder,
>  		val = intel_de_read(dev_priv, CNL_PORT_TX_DW4_LN(ln, port));
>  		val &= ~(POST_CURSOR_1_MASK | POST_CURSOR_2_MASK |
>  			 CURSOR_COEFF_MASK);
> -		val |= POST_CURSOR_1(ddi_translations[level].cnl.dw4_post_cursor_1);
> -		val |= POST_CURSOR_2(ddi_translations[level].cnl.dw4_post_cursor_2);
> -		val |= CURSOR_COEFF(ddi_translations[level].cnl.dw4_cursor_coeff);
> +		val |= POST_CURSOR_1(ddi_translations->entries[level].cnl.dw4_post_cursor_1);
> +		val |= POST_CURSOR_2(ddi_translations->entries[level].cnl.dw4_post_cursor_2);
> +		val |= CURSOR_COEFF(ddi_translations->entries[level].cnl.dw4_cursor_coeff);
>  		intel_de_write(dev_priv, CNL_PORT_TX_DW4_LN(ln, port), val);
>  	}
>  
> @@ -1100,7 +1100,7 @@ static void cnl_ddi_vswing_program(struct intel_encoder *encoder,
>  	/* Program PORT_TX_DW7 */
>  	val = intel_de_read(dev_priv, CNL_PORT_TX_DW7_LN0(port));
>  	val &= ~N_SCALAR_MASK;
> -	val |= N_SCALAR(ddi_translations[level].cnl.dw7_n_scalar);
> +	val |= N_SCALAR(ddi_translations->entries[level].cnl.dw7_n_scalar);
>  	intel_de_write(dev_priv, CNL_PORT_TX_DW7_GRP(port), val);
>  }
>  
> @@ -1170,7 +1170,7 @@ static void icl_ddi_combo_vswing_program(struct intel_encoder *encoder,
>  					 int level)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> -	const union intel_ddi_buf_trans_entry *ddi_translations;
> +	const struct intel_ddi_buf_trans *ddi_translations;
>  	enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
>  	int n_entries, ln;
>  	u32 val;
> @@ -1211,8 +1211,8 @@ static void icl_ddi_combo_vswing_program(struct intel_encoder *encoder,
>  	val = intel_de_read(dev_priv, ICL_PORT_TX_DW2_LN0(phy));
>  	val &= ~(SWING_SEL_LOWER_MASK | SWING_SEL_UPPER_MASK |
>  		 RCOMP_SCALAR_MASK);
> -	val |= SWING_SEL_UPPER(ddi_translations[level].cnl.dw2_swing_sel);
> -	val |= SWING_SEL_LOWER(ddi_translations[level].cnl.dw2_swing_sel);
> +	val |= SWING_SEL_UPPER(ddi_translations->entries[level].cnl.dw2_swing_sel);
> +	val |= SWING_SEL_LOWER(ddi_translations->entries[level].cnl.dw2_swing_sel);
>  	/* Program Rcomp scalar for every table entry */
>  	val |= RCOMP_SCALAR(0x98);
>  	intel_de_write(dev_priv, ICL_PORT_TX_DW2_GRP(phy), val);
> @@ -1223,16 +1223,16 @@ static void icl_ddi_combo_vswing_program(struct intel_encoder *encoder,
>  		val = intel_de_read(dev_priv, ICL_PORT_TX_DW4_LN(ln, phy));
>  		val &= ~(POST_CURSOR_1_MASK | POST_CURSOR_2_MASK |
>  			 CURSOR_COEFF_MASK);
> -		val |= POST_CURSOR_1(ddi_translations[level].cnl.dw4_post_cursor_1);
> -		val |= POST_CURSOR_2(ddi_translations[level].cnl.dw4_post_cursor_2);
> -		val |= CURSOR_COEFF(ddi_translations[level].cnl.dw4_cursor_coeff);
> +		val |= POST_CURSOR_1(ddi_translations->entries[level].cnl.dw4_post_cursor_1);
> +		val |= POST_CURSOR_2(ddi_translations->entries[level].cnl.dw4_post_cursor_2);
> +		val |= CURSOR_COEFF(ddi_translations->entries[level].cnl.dw4_cursor_coeff);
>  		intel_de_write(dev_priv, ICL_PORT_TX_DW4_LN(ln, phy), val);
>  	}
>  
>  	/* Program PORT_TX_DW7 */
>  	val = intel_de_read(dev_priv, ICL_PORT_TX_DW7_LN0(phy));
>  	val &= ~N_SCALAR_MASK;
> -	val |= N_SCALAR(ddi_translations[level].cnl.dw7_n_scalar);
> +	val |= N_SCALAR(ddi_translations->entries[level].cnl.dw7_n_scalar);
>  	intel_de_write(dev_priv, ICL_PORT_TX_DW7_GRP(phy), val);
>  }
>  
> @@ -1303,7 +1303,7 @@ static void icl_mg_phy_ddi_vswing_sequence(struct intel_encoder *encoder,
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	enum tc_port tc_port = intel_port_to_tc(dev_priv, encoder->port);
> -	const union intel_ddi_buf_trans_entry *ddi_translations;
> +	const struct intel_ddi_buf_trans *ddi_translations;
>  	int n_entries, ln;
>  	u32 val;
>  
> @@ -1333,13 +1333,13 @@ static void icl_mg_phy_ddi_vswing_sequence(struct intel_encoder *encoder,
>  		val = intel_de_read(dev_priv, MG_TX1_SWINGCTRL(ln, tc_port));
>  		val &= ~CRI_TXDEEMPH_OVERRIDE_17_12_MASK;
>  		val |= CRI_TXDEEMPH_OVERRIDE_17_12(
> -			ddi_translations[level].mg.cri_txdeemph_override_17_12);
> +			ddi_translations->entries[level].mg.cri_txdeemph_override_17_12);
>  		intel_de_write(dev_priv, MG_TX1_SWINGCTRL(ln, tc_port), val);
>  
>  		val = intel_de_read(dev_priv, MG_TX2_SWINGCTRL(ln, tc_port));
>  		val &= ~CRI_TXDEEMPH_OVERRIDE_17_12_MASK;
>  		val |= CRI_TXDEEMPH_OVERRIDE_17_12(
> -			ddi_translations[level].mg.cri_txdeemph_override_17_12);
> +			ddi_translations->entries[level].mg.cri_txdeemph_override_17_12);
>  		intel_de_write(dev_priv, MG_TX2_SWINGCTRL(ln, tc_port), val);
>  	}
>  
> @@ -1349,9 +1349,9 @@ static void icl_mg_phy_ddi_vswing_sequence(struct intel_encoder *encoder,
>  		val &= ~(CRI_TXDEEMPH_OVERRIDE_11_6_MASK |
>  			 CRI_TXDEEMPH_OVERRIDE_5_0_MASK);
>  		val |= CRI_TXDEEMPH_OVERRIDE_5_0(
> -			ddi_translations[level].mg.cri_txdeemph_override_5_0) |
> +			ddi_translations->entries[level].mg.cri_txdeemph_override_5_0) |
>  			CRI_TXDEEMPH_OVERRIDE_11_6(
> -				ddi_translations[level].mg.cri_txdeemph_override_11_6) |
> +				ddi_translations->entries[level].mg.cri_txdeemph_override_11_6) |
>  			CRI_TXDEEMPH_OVERRIDE_EN;
>  		intel_de_write(dev_priv, MG_TX1_DRVCTRL(ln, tc_port), val);
>  
> @@ -1359,9 +1359,9 @@ static void icl_mg_phy_ddi_vswing_sequence(struct intel_encoder *encoder,
>  		val &= ~(CRI_TXDEEMPH_OVERRIDE_11_6_MASK |
>  			 CRI_TXDEEMPH_OVERRIDE_5_0_MASK);
>  		val |= CRI_TXDEEMPH_OVERRIDE_5_0(
> -			ddi_translations[level].mg.cri_txdeemph_override_5_0) |
> +			ddi_translations->entries[level].mg.cri_txdeemph_override_5_0) |
>  			CRI_TXDEEMPH_OVERRIDE_11_6(
> -				ddi_translations[level].mg.cri_txdeemph_override_11_6) |
> +				ddi_translations->entries[level].mg.cri_txdeemph_override_11_6) |
>  			CRI_TXDEEMPH_OVERRIDE_EN;
>  		intel_de_write(dev_priv, MG_TX2_DRVCTRL(ln, tc_port), val);
>  
> @@ -1441,7 +1441,7 @@ tgl_dkl_phy_ddi_vswing_sequence(struct intel_encoder *encoder,
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	enum tc_port tc_port = intel_port_to_tc(dev_priv, encoder->port);
> -	const union intel_ddi_buf_trans_entry *ddi_translations;
> +	const struct intel_ddi_buf_trans *ddi_translations;
>  	u32 val, dpcnt_mask, dpcnt_val;
>  	int n_entries, ln;
>  
> @@ -1461,9 +1461,9 @@ tgl_dkl_phy_ddi_vswing_sequence(struct intel_encoder *encoder,
>  	dpcnt_mask = (DKL_TX_PRESHOOT_COEFF_MASK |
>  		      DKL_TX_DE_EMPAHSIS_COEFF_MASK |
>  		      DKL_TX_VSWING_CONTROL_MASK);
> -	dpcnt_val = DKL_TX_VSWING_CONTROL(ddi_translations[level].dkl.dkl_vswing_control);
> -	dpcnt_val |= DKL_TX_DE_EMPHASIS_COEFF(ddi_translations[level].dkl.dkl_de_emphasis_control);
> -	dpcnt_val |= DKL_TX_PRESHOOT_COEFF(ddi_translations[level].dkl.dkl_preshoot_control);
> +	dpcnt_val = DKL_TX_VSWING_CONTROL(ddi_translations->entries[level].dkl.dkl_vswing_control);
> +	dpcnt_val |= DKL_TX_DE_EMPHASIS_COEFF(ddi_translations->entries[level].dkl.dkl_de_emphasis_control);
> +	dpcnt_val |= DKL_TX_PRESHOOT_COEFF(ddi_translations->entries[level].dkl.dkl_preshoot_control);
>  
>  	for (ln = 0; ln < 2; ln++) {
>  		intel_de_write(dev_priv, HIP_INDEX_REG(tc_port),
> 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 3149b01aaca7..95b8f9b43ea2 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
> @@ -1027,19 +1027,19 @@ static const struct intel_ddi_buf_trans adlp_dkl_phy_ddi_translations_dp_hbr2_hb
>  	.num_entries = ARRAY_SIZE(_adlp_dkl_phy_ddi_translations_dp_hbr2_hbr3),
>  };
>  
> -bool is_hobl_buf_trans(const union intel_ddi_buf_trans_entry *table)
> +bool is_hobl_buf_trans(const struct intel_ddi_buf_trans *table)
>  {
> -	return table == tgl_combo_phy_ddi_translations_edp_hbr2_hobl.entries;
> +	return table == &tgl_combo_phy_ddi_translations_edp_hbr2_hobl;
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  intel_get_buf_trans(const struct intel_ddi_buf_trans *ddi_translations, int *num_entries)
>  {
>  	*num_entries = ddi_translations->num_entries;
> -	return ddi_translations->entries;
> +	return ddi_translations;
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  bdw_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> @@ -1053,7 +1053,7 @@ bdw_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries)
>  	}
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  skl_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> @@ -1070,7 +1070,7 @@ skl_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries)
>  	}
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  kbl_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> @@ -1091,7 +1091,7 @@ kbl_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries)
>  	}
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  skl_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> @@ -1123,7 +1123,7 @@ skl_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries)
>  		return skl_get_buf_trans_dp(encoder, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  skl_get_buf_trans_hdmi(struct drm_i915_private *dev_priv, int *n_entries)
>  {
>  	if (IS_SKL_ULX(dev_priv) ||
> @@ -1147,7 +1147,7 @@ static int skl_buf_trans_num_entries(enum port port, int n_entries)
>  		return min(n_entries, 9);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  hsw_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> @@ -1155,12 +1155,12 @@ hsw_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries)
>  	if (IS_KABYLAKE(dev_priv) ||
>  	    IS_COFFEELAKE(dev_priv) ||
>  	    IS_COMETLAKE(dev_priv)) {
> -		const union intel_ddi_buf_trans_entry *ddi_translations =
> +		const struct intel_ddi_buf_trans *ddi_translations =
>  			kbl_get_buf_trans_dp(encoder, n_entries);
>  		*n_entries = skl_buf_trans_num_entries(encoder->port, *n_entries);
>  		return ddi_translations;
>  	} else if (IS_SKYLAKE(dev_priv)) {
> -		const union intel_ddi_buf_trans_entry *ddi_translations =
> +		const struct intel_ddi_buf_trans *ddi_translations =
>  			skl_get_buf_trans_dp(encoder, n_entries);
>  		*n_entries = skl_buf_trans_num_entries(encoder->port, *n_entries);
>  		return ddi_translations;
> @@ -1176,13 +1176,13 @@ hsw_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries)
>  	return NULL;
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  hsw_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  
>  	if (DISPLAY_VER(dev_priv) == 9 && !IS_BROXTON(dev_priv)) {
> -		const union intel_ddi_buf_trans_entry *ddi_translations =
> +		const struct intel_ddi_buf_trans *ddi_translations =
>  			skl_get_buf_trans_edp(encoder, n_entries);
>  		*n_entries = skl_buf_trans_num_entries(encoder->port, *n_entries);
>  		return ddi_translations;
> @@ -1197,7 +1197,7 @@ hsw_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries)
>  	return NULL;
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  hsw_get_buf_trans_fdi(struct intel_encoder *encoder,
>  		      int *n_entries)
>  {
> @@ -1215,7 +1215,7 @@ hsw_get_buf_trans_fdi(struct intel_encoder *encoder,
>  	return NULL;
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  hsw_get_buf_trans_hdmi(struct intel_encoder *encoder,
>  		       int *n_entries)
>  {
> @@ -1235,7 +1235,7 @@ hsw_get_buf_trans_hdmi(struct intel_encoder *encoder,
>  	return NULL;
>  }
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  hsw_get_buf_trans(struct intel_encoder *encoder,
>  		  const struct intel_crtc_state *crtc_state,
>  		  int *n_entries)
> @@ -1250,13 +1250,13 @@ hsw_get_buf_trans(struct intel_encoder *encoder,
>  		return hsw_get_buf_trans_dp(encoder, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  bxt_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries)
>  {
>  	return intel_get_buf_trans(&bxt_ddi_translations_dp, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  bxt_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> @@ -1269,13 +1269,13 @@ bxt_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries)
>  	return bxt_get_buf_trans_dp(encoder, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  bxt_get_buf_trans_hdmi(struct intel_encoder *encoder, int *n_entries)
>  {
>  	return intel_get_buf_trans(&bxt_ddi_translations_hdmi, n_entries);
>  }
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  bxt_get_buf_trans(struct intel_encoder *encoder,
>  		  const struct intel_crtc_state *crtc_state,
>  		  int *n_entries)
> @@ -1287,7 +1287,7 @@ bxt_get_buf_trans(struct intel_encoder *encoder,
>  	return bxt_get_buf_trans_dp(encoder, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  cnl_get_buf_trans_hdmi(struct intel_encoder *encoder, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> @@ -1309,7 +1309,7 @@ cnl_get_buf_trans_hdmi(struct intel_encoder *encoder, int *n_entries)
>  	return NULL;
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  cnl_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> @@ -1331,7 +1331,7 @@ cnl_get_buf_trans_dp(struct intel_encoder *encoder, int *n_entries)
>  	return NULL;
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  cnl_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> @@ -1357,7 +1357,7 @@ cnl_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries)
>  	}
>  }
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  cnl_get_buf_trans(struct intel_encoder *encoder,
>  		  const struct intel_crtc_state *crtc_state,
>  		  int *n_entries)
> @@ -1369,7 +1369,7 @@ cnl_get_buf_trans(struct intel_encoder *encoder,
>  	return cnl_get_buf_trans_dp(encoder, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +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)
> @@ -1378,7 +1378,7 @@ icl_get_combo_buf_trans_hdmi(struct intel_encoder *encoder,
>  				   n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  icl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
>  			   const struct intel_crtc_state *crtc_state,
>  			   int *n_entries)
> @@ -1387,7 +1387,7 @@ icl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
>  				   n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  icl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
>  			    const struct intel_crtc_state *crtc_state,
>  			    int *n_entries)
> @@ -1411,7 +1411,7 @@ icl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
>  	return icl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  icl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			const struct intel_crtc_state *crtc_state,
>  			int *n_entries)
> @@ -1424,7 +1424,7 @@ icl_get_combo_buf_trans(struct intel_encoder *encoder,
>  		return icl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +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)
> @@ -1433,7 +1433,7 @@ icl_get_mg_buf_trans_hdmi(struct intel_encoder *encoder,
>  				   n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  icl_get_mg_buf_trans_dp(struct intel_encoder *encoder,
>  			const struct intel_crtc_state *crtc_state,
>  			int *n_entries)
> @@ -1447,7 +1447,7 @@ icl_get_mg_buf_trans_dp(struct intel_encoder *encoder,
>  	}
>  }
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  icl_get_mg_buf_trans(struct intel_encoder *encoder,
>  		     const struct intel_crtc_state *crtc_state,
>  		     int *n_entries)
> @@ -1458,7 +1458,7 @@ icl_get_mg_buf_trans(struct intel_encoder *encoder,
>  		return icl_get_mg_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +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)
> @@ -1467,7 +1467,7 @@ ehl_get_combo_buf_trans_hdmi(struct intel_encoder *encoder,
>  				   n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +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)
> @@ -1476,7 +1476,7 @@ ehl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
>  				   n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  ehl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
>  			    const struct intel_crtc_state *crtc_state,
>  			    int *n_entries)
> @@ -1491,7 +1491,7 @@ ehl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
>  	return ehl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  ehl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			const struct intel_crtc_state *crtc_state,
>  			int *n_entries)
> @@ -1504,7 +1504,7 @@ ehl_get_combo_buf_trans(struct intel_encoder *encoder,
>  		return ehl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +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)
> @@ -1513,7 +1513,7 @@ jsl_get_combo_buf_trans_hdmi(struct intel_encoder *encoder,
>  				   n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +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)
> @@ -1522,7 +1522,7 @@ jsl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
>  				   n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  jsl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
>  			    const struct intel_crtc_state *crtc_state,
>  			    int *n_entries)
> @@ -1542,7 +1542,7 @@ jsl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
>  	return jsl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  jsl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			const struct intel_crtc_state *crtc_state,
>  			int *n_entries)
> @@ -1555,7 +1555,7 @@ jsl_get_combo_buf_trans(struct intel_encoder *encoder,
>  		return jsl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +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)
> @@ -1564,7 +1564,7 @@ tgl_get_combo_buf_trans_hdmi(struct intel_encoder *encoder,
>  				   n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  tgl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
>  			   const struct intel_crtc_state *crtc_state,
>  			   int *n_entries)
> @@ -1593,7 +1593,7 @@ tgl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
>  	}
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  tgl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
>  			    const struct intel_crtc_state *crtc_state,
>  			    int *n_entries)
> @@ -1615,7 +1615,7 @@ tgl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
>  	return tgl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  tgl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			const struct intel_crtc_state *crtc_state,
>  			int *n_entries)
> @@ -1628,7 +1628,7 @@ tgl_get_combo_buf_trans(struct intel_encoder *encoder,
>  		return tgl_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +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)
> @@ -1637,7 +1637,7 @@ tgl_get_dkl_buf_trans_hdmi(struct intel_encoder *encoder,
>  				   n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  tgl_get_dkl_buf_trans_dp(struct intel_encoder *encoder,
>  			 const struct intel_crtc_state *crtc_state,
>  			 int *n_entries)
> @@ -1651,7 +1651,7 @@ tgl_get_dkl_buf_trans_dp(struct intel_encoder *encoder,
>  	}
>  }
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  tgl_get_dkl_buf_trans(struct intel_encoder *encoder,
>  		      const struct intel_crtc_state *crtc_state,
>  		      int *n_entries)
> @@ -1662,7 +1662,7 @@ tgl_get_dkl_buf_trans(struct intel_encoder *encoder,
>  		return tgl_get_dkl_buf_trans_dp(encoder, crtc_state, n_entries);
>  }
>  
> -static const union intel_ddi_buf_trans_entry *
> +static const struct intel_ddi_buf_trans *
>  adlp_get_dkl_buf_trans_dp(struct intel_encoder *encoder,
>  			  const struct intel_crtc_state *crtc_state,
>  			  int *n_entries)
> @@ -1676,7 +1676,7 @@ adlp_get_dkl_buf_trans_dp(struct intel_encoder *encoder,
>  	}
>  }
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  adlp_get_dkl_buf_trans(struct intel_encoder *encoder,
>  		       const struct intel_crtc_state *crtc_state,
>  		       int *n_entries)
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h
> index aa612725d510..2ffa534010b3 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h
> +++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.h
> @@ -58,52 +58,52 @@ struct intel_ddi_buf_trans {
>  	u8 num_entries;
>  };
>  
> -bool is_hobl_buf_trans(const union intel_ddi_buf_trans_entry *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);
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  hsw_get_buf_trans(struct intel_encoder *encoder,
>  		  const struct intel_crtc_state *crtc_state,
>  		  int *n_entries);
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  bxt_get_buf_trans(struct intel_encoder *encoder,
>  		  const struct intel_crtc_state *crtc_state,
>  		  int *n_entries);
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  adlp_get_dkl_buf_trans(struct intel_encoder *encoder,
>  		       const struct intel_crtc_state *crtc_state,
>  		       int *n_entries);
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  tgl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			const struct intel_crtc_state *crtc_state,
>  			int *n_entries);
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  tgl_get_dkl_buf_trans(struct intel_encoder *encoder,
>  		      const struct intel_crtc_state *crtc_state,
>  		      int *n_entries);
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  jsl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			const struct intel_crtc_state *crtc_state,
>  			int *n_entries);
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  ehl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			const struct intel_crtc_state *crtc_state,
>  			int *n_entries);
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  icl_get_combo_buf_trans(struct intel_encoder *encoder,
>  			const struct intel_crtc_state *crtc_state,
>  			int *n_entries);
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  icl_get_mg_buf_trans(struct intel_encoder *encoder,
>  		     const struct intel_crtc_state *crtc_state,
>  		     int *n_entries);
>  
> -const union intel_ddi_buf_trans_entry *
> +const struct intel_ddi_buf_trans *
>  cnl_get_buf_trans(struct intel_encoder *encoder,
>  		  const struct intel_crtc_state *crtc_state,
>  		  int *n_entries);

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list