Re: [PATCH 7/7] drm/i915: Move intel_atomic_get_shared_dpll_state() to intel_dpll_mgr.c

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

 



On Thu, Dec 29, 2016 at 05:22:13PM +0200, Ander Conselvan de Oliveira wrote:
> The function intel_atomic_get_shared_dpll_state() is only called from
> intel_dpll_mgr.c and it concerns the same data structures as the other
> functions in that file, so move it there and make it static.
> 
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@xxxxxxxxx>
> Suggested-by: Daniel Vetter <daniel.vetter@xxxxxxxx>

Always love some doc work, thanks for respinning this series.

Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>

> ---
>  drivers/gpu/drm/i915/intel_atomic.c   | 31 -------------------------------
>  drivers/gpu/drm/i915/intel_dpll_mgr.c | 31 +++++++++++++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_drv.h      |  2 --
>  3 files changed, 31 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index fa6dc43..aa9160e 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -265,37 +265,6 @@ int intel_atomic_setup_scalers(struct drm_device *dev,
>  	return 0;
>  }
>  
> -static void
> -intel_atomic_duplicate_dpll_state(struct drm_i915_private *dev_priv,
> -				  struct intel_shared_dpll_state *shared_dpll)
> -{
> -	enum intel_dpll_id i;
> -
> -	/* Copy shared dpll state */
> -	for (i = 0; i < dev_priv->num_shared_dpll; i++) {
> -		struct intel_shared_dpll *pll = &dev_priv->shared_dplls[i];
> -
> -		shared_dpll[i] = pll->state;
> -	}
> -}
> -
> -struct intel_shared_dpll_state *
> -intel_atomic_get_shared_dpll_state(struct drm_atomic_state *s)
> -{
> -	struct intel_atomic_state *state = to_intel_atomic_state(s);
> -
> -	WARN_ON(!drm_modeset_is_locked(&s->dev->mode_config.connection_mutex));
> -
> -	if (!state->dpll_set) {
> -		state->dpll_set = true;
> -
> -		intel_atomic_duplicate_dpll_state(to_i915(s->dev),
> -						  state->shared_dpll);
> -	}
> -
> -	return state->shared_dpll;
> -}
> -
>  struct drm_atomic_state *
>  intel_atomic_state_alloc(struct drm_device *dev)
>  {
> diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> index 57d4271..c92a255 100644
> --- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
> +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> @@ -80,6 +80,37 @@ skl_find_link_pll(struct drm_i915_private *dev_priv, int clock)
>  	return pll;
>  }
>  
> +static void
> +intel_atomic_duplicate_dpll_state(struct drm_i915_private *dev_priv,
> +				  struct intel_shared_dpll_state *shared_dpll)
> +{
> +	enum intel_dpll_id i;
> +
> +	/* Copy shared dpll state */
> +	for (i = 0; i < dev_priv->num_shared_dpll; i++) {
> +		struct intel_shared_dpll *pll = &dev_priv->shared_dplls[i];
> +
> +		shared_dpll[i] = pll->state;
> +	}
> +}
> +
> +static struct intel_shared_dpll_state *
> +intel_atomic_get_shared_dpll_state(struct drm_atomic_state *s)
> +{
> +	struct intel_atomic_state *state = to_intel_atomic_state(s);
> +
> +	WARN_ON(!drm_modeset_is_locked(&s->dev->mode_config.connection_mutex));
> +
> +	if (!state->dpll_set) {
> +		state->dpll_set = true;
> +
> +		intel_atomic_duplicate_dpll_state(to_i915(s->dev),
> +						  state->shared_dpll);
> +	}
> +
> +	return state->shared_dpll;
> +}
> +
>  /**
>   * intel_get_shared_dpll_by_id - get a DPLL given its id
>   * @dev_priv: i915 device instance
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 5ee1719..6b02dac 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1815,8 +1815,6 @@ void intel_crtc_destroy_state(struct drm_crtc *crtc,
>  			       struct drm_crtc_state *state);
>  struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev);
>  void intel_atomic_state_clear(struct drm_atomic_state *);
> -struct intel_shared_dpll_state *
> -intel_atomic_get_shared_dpll_state(struct drm_atomic_state *s);
>  
>  static inline struct intel_crtc_state *
>  intel_atomic_get_crtc_state(struct drm_atomic_state *state,
> -- 
> 2.5.5
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux