Re: [PATCH 3/4] drm/i915/dsi: Move vlv/icl_dphy_param_init call out of intel_dsi_vbt_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 24, 2019 at 06:30:19PM +0200, Hans de Goede wrote:
> The vlv/icl_dphy_param_init calls do various calculations to set dphy
> parameters based on the pclk.
> 
> Move the calling of vlv/icl_dphy_param_init to vlv_dsi_init to give
> vlv_dsi_init a chance to tweak the pclk before these calculations are done.
> 
> This also removes the single "if (IS_ICELAKE(dev_priv))" check from
> intel_dsi_vbt_init making it fully platform agnostic.
> 
> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/icl_dsi.c       | 1 +
>  drivers/gpu/drm/i915/intel_dsi.h     | 2 ++
>  drivers/gpu/drm/i915/intel_dsi_vbt.c | 9 ++-------
>  drivers/gpu/drm/i915/vlv_dsi.c       | 2 ++
>  4 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
> index 9d962ea1e635..0f43ef07efec 100644
> --- a/drivers/gpu/drm/i915/icl_dsi.c
> +++ b/drivers/gpu/drm/i915/icl_dsi.c
> @@ -1455,6 +1455,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
>  		goto err;
>  	}
>  
> +	icl_dphy_param_init(intel_dsi);

I think we should move the entire function into this file.

>  	return;
>  
>  err:
> diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
> index 705a609050c0..a58d3d988d9f 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.h
> +++ b/drivers/gpu/drm/i915/intel_dsi.h
> @@ -192,5 +192,7 @@ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id);
>  void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi,
>  				 enum mipi_seq seq_id);
>  void intel_dsi_msleep(struct intel_dsi *intel_dsi, int msec);
> +void icl_dphy_param_init(struct intel_dsi *intel_dsi);
> +void vlv_dphy_param_init(struct intel_dsi *intel_dsi);
>  
>  #endif /* _INTEL_DSI_H */
> diff --git a/drivers/gpu/drm/i915/intel_dsi_vbt.c b/drivers/gpu/drm/i915/intel_dsi_vbt.c
> index 3448e8d51057..022bf59418df 100644
> --- a/drivers/gpu/drm/i915/intel_dsi_vbt.c
> +++ b/drivers/gpu/drm/i915/intel_dsi_vbt.c
> @@ -578,7 +578,7 @@ static void intel_dsi_log_params(struct intel_dsi *intel_dsi)
>  #define ICL_HS_ZERO_CNT_MAX	0xf
>  #define ICL_EXIT_ZERO_CNT_MAX	0x7
>  
> -static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
> +void icl_dphy_param_init(struct intel_dsi *intel_dsi)
>  {
>  	struct drm_device *dev = intel_dsi->base.base.dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
> @@ -677,7 +677,7 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
>  	intel_dsi_log_params(intel_dsi);
>  }
>  
> -static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
> +void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
>  {
>  	struct drm_device *dev = intel_dsi->base.base.dev;
>  	struct drm_i915_private *dev_priv = to_i915(dev);
> @@ -914,11 +914,6 @@ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
>  
>  	intel_dsi->burst_mode_ratio = burst_mode_ratio;
>  
> -	if (INTEL_GEN(dev_priv) >= 11)
> -		icl_dphy_param_init(intel_dsi);
> -	else
> -		vlv_dphy_param_init(intel_dsi);
> -
>  	/* delays in VBT are in unit of 100us, so need to convert
>  	 * here in ms
>  	 * Delay (100us) * 100 /1000 = Delay / 10 (ms) */
> diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c
> index fce8b58f7f93..3329ccf3b346 100644
> --- a/drivers/gpu/drm/i915/vlv_dsi.c
> +++ b/drivers/gpu/drm/i915/vlv_dsi.c
> @@ -1782,6 +1782,8 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
>  		goto err;
>  	}
>  
> +	vlv_dphy_param_init(intel_dsi);

ditto

> +
>  	/*
>  	 * In case of BYT with CRC PMIC, we need to use GPIO for
>  	 * Panel control.
> -- 
> 2.21.0

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux