[Intel-gfx] [PATCH 2/2] drm/i915: Prove an assert for when we expect forcewake to be held

Chris Wilson chris at chris-wilson.co.uk
Fri Oct 6 16:21:14 UTC 2017


s/Prove/Provide/

Quoting Chris Wilson (2017-10-06 15:54:59)
> Add assert_forcewakes_active() (the complementary function to
> assert_forcewakes_inactive) that documents the requirement of a
> function for its callers to be holding the forcewake ref (i.e. the
> function is part of a sequence over which RC6 must be prevented).
> 
> One such example is during ringbuffer reset, where RC6 must be held
> across the whole reinitialisation sequence.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ringbuffer.c | 11 ++++++++++-
>  drivers/gpu/drm/i915/intel_uncore.c     | 12 ++++++++++++
>  drivers/gpu/drm/i915/intel_uncore.h     |  2 ++
>  3 files changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 05c08b0bc172..4285f09ff8b8 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -579,7 +579,16 @@ static int init_ring_common(struct intel_engine_cs *engine)
>  static void reset_ring_common(struct intel_engine_cs *engine,
>                               struct drm_i915_gem_request *request)
>  {
> -       /* Try to restore the logical GPU state to match the continuation
> +       /*
> +        * RC6 must be prevented until the reset is complete and the engine
> +        * reinitialised. If it occurs in the middle of this sequence, the
> +        * state written to/loaded from the power context is ill-defined (e.g.
> +        * the PP_BASE_DIR may be lost).

PP_DIR_BASE
-Chris


More information about the Intel-gfx mailing list