All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 5/8] drm/i915/icl: Add reset control register changes
Date: Fri, 16 Mar 2018 14:22:46 +0200	[thread overview]
Message-ID: <877eqcmcq1.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180316121456.11577-5-mika.kuoppala@linux.intel.com>

Mika Kuoppala <mika.kuoppala@linux.intel.com> writes:

> From: Michel Thierry <michel.thierry@intel.com>
>
> The bits used to reset the different engines/domains have changed in
> GEN11, this patch maps the reset engine mask bits with the new bits
> in the reset control register.
>
> v2: Use shift-left instead of BIT macro to match the file style (Paulo).
> v3: Reuse gen8_reset_engines (Daniele).
> v4: Do not call intel_uncore_forcewake_reset after reset, we may be
> using the forcewake to read protected registers elsewhere and those
> results may be clobbered by the concurrent dropping of forcewake.
>
> bspec: 19212
> Cc: Oscar Mateo <oscar.mateo@intel.com>
> Cc: Antonio Argenziano <antonio.argenziano@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Acked-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h     | 11 ++++++++
>  drivers/gpu/drm/i915/intel_uncore.c | 53 +++++++++++++++++++++++++++++++++++--
>  2 files changed, 62 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 9eaaa96287ec..f3cc77690124 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -301,6 +301,17 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
>  #define  GEN6_GRDOM_VECS		(1 << 4)
>  #define  GEN9_GRDOM_GUC			(1 << 5)
>  #define  GEN8_GRDOM_MEDIA2		(1 << 7)
> +/* GEN11 changed all bit defs except for FULL & RENDER */
> +#define  GEN11_GRDOM_FULL		GEN6_GRDOM_FULL
> +#define  GEN11_GRDOM_RENDER		GEN6_GRDOM_RENDER
> +#define  GEN11_GRDOM_BLT		(1 << 2)
> +#define  GEN11_GRDOM_GUC		(1 << 3)
> +#define  GEN11_GRDOM_MEDIA		(1 << 5)
> +#define  GEN11_GRDOM_MEDIA2		(1 << 6)
> +#define  GEN11_GRDOM_MEDIA3		(1 << 7)
> +#define  GEN11_GRDOM_MEDIA4		(1 << 8)

I would like these to be named like they are in bspec.
First being MEDIA0.

> +#define  GEN11_GRDOM_VECS		(1 << 13)
> +#define  GEN11_GRDOM_VECS2		(1 << 14)

And same to these, VECS0 and VECS1.

-Mika

>
>  #define RING_PP_DIR_BASE(engine)	_MMIO((engine)->mmio_base+0x228)
>  #define RING_PP_DIR_BASE_READ(engine)	_MMIO((engine)->mmio_base+0x518)
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 4c616d074a97..cabbf0e682e7 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1909,6 +1909,50 @@ static int gen6_reset_engines(struct drm_i915_private *dev_priv,
>  	return gen6_hw_domain_reset(dev_priv, hw_mask);
>  }
>  
> +/**
> + * gen11_reset_engines - reset individual engines
> + * @dev_priv: i915 device
> + * @engine_mask: mask of intel_ring_flag() engines or ALL_ENGINES for full reset
> + *
> + * This function will reset the individual engines that are set in engine_mask.
> + * If you provide ALL_ENGINES as mask, full global domain reset will be issued.
> + *
> + * Note: It is responsibility of the caller to handle the difference between
> + * asking full domain reset versus reset for all available individual engines.
> + *
> + * Returns 0 on success, nonzero on error.
> + */
> +static int gen11_reset_engines(struct drm_i915_private *dev_priv,
> +			       unsigned engine_mask)
> +{
> +	struct intel_engine_cs *engine;
> +	const u32 hw_engine_mask[I915_NUM_ENGINES] = {
> +		[RCS] = GEN11_GRDOM_RENDER,
> +		[BCS] = GEN11_GRDOM_BLT,
> +		[VCS] = GEN11_GRDOM_MEDIA,
> +		[VCS2] = GEN11_GRDOM_MEDIA2,
> +		[VCS3] = GEN11_GRDOM_MEDIA3,
> +		[VCS4] = GEN11_GRDOM_MEDIA4,
> +		[VECS] = GEN11_GRDOM_VECS,
> +		[VECS2] = GEN11_GRDOM_VECS2,
> +	};
> +	u32 hw_mask;
> +
> +	BUILD_BUG_ON(VECS2 + 1 != I915_NUM_ENGINES);
> +
> +	if (engine_mask == ALL_ENGINES) {
> +		hw_mask = GEN11_GRDOM_FULL;
> +	} else {
> +		unsigned int tmp;
> +
> +		hw_mask = 0;
> +		for_each_engine_masked(engine, dev_priv, engine_mask, tmp)
> +			hw_mask |= hw_engine_mask[engine->id];
> +	}
> +
> +	return gen6_hw_domain_reset(dev_priv, hw_mask);
> +}
> +
>  /**
>   * __intel_wait_for_register_fw - wait until register matches expected state
>   * @dev_priv: the i915 device
> @@ -2056,7 +2100,10 @@ static int gen8_reset_engines(struct drm_i915_private *dev_priv,
>  		if (gen8_reset_engine_start(engine))
>  			goto not_ready;
>  
> -	return gen6_reset_engines(dev_priv, engine_mask);
> +	if (INTEL_GEN(dev_priv) >= 11)
> +		return gen11_reset_engines(dev_priv, engine_mask);
> +	else
> +		return gen6_reset_engines(dev_priv, engine_mask);
>  
>  not_ready:
>  	for_each_engine_masked(engine, dev_priv, engine_mask, tmp)
> @@ -2141,12 +2188,14 @@ bool intel_has_reset_engine(struct drm_i915_private *dev_priv)
>  
>  int intel_reset_guc(struct drm_i915_private *dev_priv)
>  {
> +	u32 guc_domain = INTEL_GEN(dev_priv) >= 11 ? GEN11_GRDOM_GUC :
> +						     GEN9_GRDOM_GUC;
>  	int ret;
>  
>  	GEM_BUG_ON(!HAS_GUC(dev_priv));
>  
>  	intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
> -	ret = gen6_hw_domain_reset(dev_priv, GEN9_GRDOM_GUC);
> +	ret = gen6_hw_domain_reset(dev_priv, guc_domain);
>  	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
>  
>  	return ret;
> -- 
> 2.14.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-03-16 12:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 12:14 [PATCH 1/8] drm/i915/icl: Check for fused-off VDBOX and VEBOX instances Mika Kuoppala
2018-03-16 12:14 ` [PATCH 2/8] drm/i915/icl: Enable the extra video decode and enhancement boxes for Icelake 11 Mika Kuoppala
2018-03-16 12:14 ` [PATCH 3/8] drm/i915/icl: Update subslice define for ICL 11 Mika Kuoppala
2018-03-20 14:34   ` Mika Kuoppala
2018-03-16 12:14 ` [PATCH 4/8] drm/i915/icl: Added ICL 11 slice, subslice and EU fuse detection Mika Kuoppala
2018-03-16 12:18   ` Lionel Landwerlin
2018-03-16 13:06   ` [PATCH v2 " Lionel Landwerlin
2018-03-16 12:14 ` [PATCH 5/8] drm/i915/icl: Add reset control register changes Mika Kuoppala
2018-03-16 12:22   ` Mika Kuoppala [this message]
2018-03-16 12:45   ` Chris Wilson
2018-03-16 20:28   ` Daniele Ceraolo Spurio
2018-03-16 21:55     ` Chris Wilson
2018-03-27 16:26     ` Michel Thierry
2018-03-16 12:14 ` [PATCH 6/8] drm/i915/icl: Handle RPS interrupts correctly for Gen11 Mika Kuoppala
2018-03-16 12:14 ` [PATCH 7/8] drm/i915/icl: Enable RC6 and RPS in Gen11 Mika Kuoppala
2018-03-16 12:14 ` [PATCH 8/8] drm/i915/icl: Use hw engine class, instance to find irq handler Mika Kuoppala
2018-03-16 18:28   ` Michel Thierry
2018-03-16 19:37     ` Daniele Ceraolo Spurio
2018-03-19 15:14       ` Daniele Ceraolo Spurio
2018-03-16 13:53 ` ✓ Fi.CI.BAT: success for series starting with [1/8] drm/i915/icl: Check for fused-off VDBOX and VEBOX instances (rev2) Patchwork
2018-03-16 17:01 ` ✓ Fi.CI.IGT: " Patchwork
2018-03-19 15:26 ` [PATCH 1/8] drm/i915/icl: Check for fused-off VDBOX and VEBOX instances Sagar Arun Kamble
2018-10-18  9:47   ` Tvrtko Ursulin
2018-03-23 16:28 ` Lionel Landwerlin
2018-03-27 22:42   ` Paulo Zanoni
2018-03-27 23:39     ` Paulo Zanoni
2018-03-28 11:36       ` Lionel Landwerlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877eqcmcq1.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.