Re: [PATCH 2/6] drm/i915/pm: drop intel_pm_setup()

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

 



On Wed, Mar 01, 2023 at 03:54:16PM +0200, Jani Nikula wrote:
> All the init in intel_pm_setup() is related to runtime pm. Move them to
> intel_runtime_pm_init_early(), and remove intel_pm_setup().
> 
> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>

> ---
>  drivers/gpu/drm/i915/i915_driver.c      | 1 -
>  drivers/gpu/drm/i915/intel_pm.c         | 6 ------
>  drivers/gpu/drm/i915/intel_pm.h         | 1 -
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 2 ++
>  4 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index 8bc76dede332..171ff4edabd6 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -250,7 +250,6 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
>  	/* This must be called before any calls to HAS_PCH_* */
>  	intel_detect_pch(dev_priv);
>  
> -	intel_pm_setup(dev_priv);
>  	intel_irq_init(dev_priv);
>  	intel_init_display_hooks(dev_priv);
>  	intel_init_clock_gating_hooks(dev_priv);
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index ddf004e5bb4b..8b02af531e82 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -899,9 +899,3 @@ void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv)
>  		dev_priv->clock_gating_funcs = &nop_clock_gating_funcs;
>  	}
>  }
> -
> -void intel_pm_setup(struct drm_i915_private *dev_priv)
> -{
> -	dev_priv->runtime_pm.suspended = false;
> -	atomic_set(&dev_priv->runtime_pm.wakeref_count, 0);
> -}
> diff --git a/drivers/gpu/drm/i915/intel_pm.h b/drivers/gpu/drm/i915/intel_pm.h
> index eab60df0c6bb..1dd464d2d186 100644
> --- a/drivers/gpu/drm/i915/intel_pm.h
> +++ b/drivers/gpu/drm/i915/intel_pm.h
> @@ -15,6 +15,5 @@ struct intel_plane_state;
>  void intel_init_clock_gating(struct drm_i915_private *dev_priv);
>  void intel_suspend_hw(struct drm_i915_private *dev_priv);
>  void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv);
> -void intel_pm_setup(struct drm_i915_private *dev_priv);
>  
>  #endif /* __INTEL_PM_H__ */
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 129746713d07..cf5122299b6b 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -652,6 +652,8 @@ void intel_runtime_pm_init_early(struct intel_runtime_pm *rpm)
>  
>  	rpm->kdev = kdev;
>  	rpm->available = HAS_RUNTIME_PM(i915);
> +	rpm->suspended = false;
> +	atomic_set(&rpm->wakeref_count, 0);
>  
>  	init_intel_runtime_pm_wakeref(rpm);
>  	INIT_LIST_HEAD(&rpm->lmem_userfault_list);
> -- 
> 2.39.1
> 



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux