[Intel-gfx] [PATCH 05/15] drm/i915: Eliminate duplicated skl_get_buf_trans_dp()

Daniel Vetter daniel at ffwll.ch
Thu Dec 10 05:24:41 PST 2015


On Tue, Dec 08, 2015 at 07:59:40PM +0200, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> skl_get_buf_trans_edp() effectively contains another copy of
> skl_get_buf_trans_dp(). Remove the duplication and just call
> skl_get_buf_trans_dp() from  skl_get_buf_trans_edp().
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 21 +++++----------------
>  1 file changed, 5 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index f8517ed4d636..e281813cad82 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -368,31 +368,20 @@ skl_get_buf_trans_edp(struct drm_device *dev, int *n_entries)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  
> -	if (IS_SKL_ULX(dev)) {
> -		if (dev_priv->edp_low_vswing) {
> +	if (dev_priv->edp_low_vswing) {
> +		if (IS_SKL_ULX(dev)) {
>  			*n_entries = ARRAY_SIZE(skl_y_ddi_translations_edp);
>  			return skl_y_ddi_translations_edp;
> -		} else {
> -			*n_entries = ARRAY_SIZE(skl_y_ddi_translations_dp);
> -			return skl_y_ddi_translations_dp;
> -		}
> -	} else if (IS_SKL_ULT(dev)) {
> -		if (dev_priv->edp_low_vswing) {
> +		} else if (IS_SKL_ULT(dev)) {
>  			*n_entries = ARRAY_SIZE(skl_u_ddi_translations_edp);
>  			return skl_u_ddi_translations_edp;
>  		} else {
> -			*n_entries = ARRAY_SIZE(skl_u_ddi_translations_dp);
> -			return skl_u_ddi_translations_dp;
> -		}
> -	} else {
> -		if (dev_priv->edp_low_vswing) {
>  			*n_entries = ARRAY_SIZE(skl_ddi_translations_edp);
>  			return skl_ddi_translations_edp;
> -		} else {
> -			*n_entries = ARRAY_SIZE(skl_ddi_translations_dp);
> -			return skl_ddi_translations_dp;
>  		}
>  	}
> +
> +	return skl_get_buf_trans_dp(dev, n_entries);
>  }
>  
>  static const struct ddi_buf_trans *
> -- 
> 2.4.10
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list