[Intel-gfx] [PATCH v2 8/8] drm/i915: make intel_wakeref work on the rpm struct

Chris Wilson chris at chris-wilson.co.uk
Wed Jun 12 22:18:55 UTC 2019


Quoting Daniele Ceraolo Spurio (2019-06-12 19:37:47)
> intel_runtime_pm is the only thing they use from the i915 structure,
> so use that directly.
> 
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_engine_pm.c |  4 +--
>  drivers/gpu/drm/i915/gt/intel_gt_pm.c     |  4 +--
>  drivers/gpu/drm/i915/i915_gem.c           |  2 +-
>  drivers/gpu/drm/i915/intel_wakeref.c      | 32 +++++++++++------------
>  drivers/gpu/drm/i915/intel_wakeref.h      | 18 ++++++-------
>  5 files changed, 30 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_pm.c b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
> index ccf034764741..903bee3d6c6d 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_pm.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
> @@ -37,7 +37,7 @@ static int __engine_unpark(struct intel_wakeref *wf)
>  
>  void intel_engine_pm_get(struct intel_engine_cs *engine)
>  {
> -       intel_wakeref_get(engine->i915, &engine->wakeref, __engine_unpark);
> +       intel_wakeref_get(&engine->i915->runtime_pm, &engine->wakeref, __engine_unpark);
>  }
>  
>  void intel_engine_park(struct intel_engine_cs *engine)
> @@ -131,7 +131,7 @@ static int __engine_park(struct intel_wakeref *wf)
>  
>  void intel_engine_pm_put(struct intel_engine_cs *engine)
>  {
> -       intel_wakeref_put(engine->i915, &engine->wakeref, __engine_park);
> +       intel_wakeref_put(&engine->i915->runtime_pm, &engine->wakeref, __engine_park);
>  }
>  
>  void intel_engine_init__pm(struct intel_engine_cs *engine)
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> index ae7155f0e063..7b5967751762 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
> @@ -52,7 +52,7 @@ static int intel_gt_unpark(struct intel_wakeref *wf)
>  
>  void intel_gt_pm_get(struct drm_i915_private *i915)
>  {
> -       intel_wakeref_get(i915, &i915->gt.wakeref, intel_gt_unpark);
> +       intel_wakeref_get(&i915->runtime_pm, &i915->gt.wakeref, intel_gt_unpark);
>  }
>  
>  static int intel_gt_park(struct intel_wakeref *wf)
> @@ -77,7 +77,7 @@ static int intel_gt_park(struct intel_wakeref *wf)
>  
>  void intel_gt_pm_put(struct drm_i915_private *i915)
>  {
> -       intel_wakeref_put(i915, &i915->gt.wakeref, intel_gt_park);
> +       intel_wakeref_put(&i915->runtime_pm, &i915->gt.wakeref, intel_gt_park);
>  }
>  
>  void intel_gt_pm_init(struct drm_i915_private *i915)
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 598faca4899e..8f5510af2ca4 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1776,7 +1776,7 @@ static void i915_gem_init__mm(struct drm_i915_private *i915)
>         INIT_LIST_HEAD(&i915->mm.fence_list);
>  
>         INIT_LIST_HEAD(&i915->mm.userfault_list);
> -       intel_wakeref_auto_init(&i915->mm.userfault_wakeref, i915);
> +       intel_wakeref_auto_init(&i915->mm.userfault_wakeref, &i915->runtime_pm);
>  
>         i915_gem_init__objects(i915);
>  }
> diff --git a/drivers/gpu/drm/i915/intel_wakeref.c b/drivers/gpu/drm/i915/intel_wakeref.c
> index b677ae893d6f..3db6fa682823 100644
> --- a/drivers/gpu/drm/i915/intel_wakeref.c
> +++ b/drivers/gpu/drm/i915/intel_wakeref.c
> @@ -4,23 +4,23 @@
>   * Copyright © 2019 Intel Corporation
>   */
>  
> -#include "intel_drv.h"
> -#include "intel_wakeref.h"
> +#include "intel_runtime_pm.h"
> +#include "i915_gem.h"

Mutters GEM_BUG_ON. We need compartmentalisation and specialisation of
our DEBUG utils.
-Chris


More information about the Intel-gfx mailing list