All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: use get_reset_domain() helper
Date: Fri, 18 Feb 2022 15:27:59 -0500	[thread overview]
Message-ID: <YhABT97K6C2NQRJb@intel.com> (raw)
In-Reply-To: <20220217123223.748184-1-tejaskumarx.surendrakumar.upadhyay@intel.com>

On Thu, Feb 17, 2022 at 06:02:23PM +0530, Tejas Upadhyay wrote:
> We dont need to implement reset_domain in intel_engine
> _setup(), but can be done as a helper. Implemented as
> engine->reset_domain = get_reset_domain().
> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>

it is a good non-functional clean-up in the engine setup function and we
will need this soon to be called from more other places, so:

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

> ---
>  drivers/gpu/drm/i915/gt/intel_engine_cs.c | 74 +++++++++++++----------
>  1 file changed, 42 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> index e53008b4dd05..e855c801ba28 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> @@ -293,6 +293,46 @@ static void nop_irq_handler(struct intel_engine_cs *engine, u16 iir)
>  	GEM_DEBUG_WARN_ON(iir);
>  }
>  
> +static u32 get_reset_domain(u8 ver, enum intel_engine_id id)
> +{
> +	u32 reset_domain;
> +
> +	if (ver >= 11) {
> +		static const u32 engine_reset_domains[] = {
> +			[RCS0]  = GEN11_GRDOM_RENDER,
> +			[BCS0]  = GEN11_GRDOM_BLT,
> +			[VCS0]  = GEN11_GRDOM_MEDIA,
> +			[VCS1]  = GEN11_GRDOM_MEDIA2,
> +			[VCS2]  = GEN11_GRDOM_MEDIA3,
> +			[VCS3]  = GEN11_GRDOM_MEDIA4,
> +			[VCS4]  = GEN11_GRDOM_MEDIA5,
> +			[VCS5]  = GEN11_GRDOM_MEDIA6,
> +			[VCS6]  = GEN11_GRDOM_MEDIA7,
> +			[VCS7]  = GEN11_GRDOM_MEDIA8,
> +			[VECS0] = GEN11_GRDOM_VECS,
> +			[VECS1] = GEN11_GRDOM_VECS2,
> +			[VECS2] = GEN11_GRDOM_VECS3,
> +			[VECS3] = GEN11_GRDOM_VECS4,
> +		};
> +		GEM_BUG_ON(id >= ARRAY_SIZE(engine_reset_domains) ||
> +			   !engine_reset_domains[id]);
> +		reset_domain = engine_reset_domains[id];
> +	} else {
> +		static const u32 engine_reset_domains[] = {
> +			[RCS0]  = GEN6_GRDOM_RENDER,
> +			[BCS0]  = GEN6_GRDOM_BLT,
> +			[VCS0]  = GEN6_GRDOM_MEDIA,
> +			[VCS1]  = GEN8_GRDOM_MEDIA2,
> +			[VECS0] = GEN6_GRDOM_VECS,
> +		};
> +		GEM_BUG_ON(id >= ARRAY_SIZE(engine_reset_domains) ||
> +			   !engine_reset_domains[id]);
> +		reset_domain = engine_reset_domains[id];
> +	}
> +
> +	return reset_domain;
> +}
> +
>  static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id,
>  			      u8 logical_instance)
>  {
> @@ -328,38 +368,8 @@ static int intel_engine_setup(struct intel_gt *gt, enum intel_engine_id id,
>  	engine->id = id;
>  	engine->legacy_idx = INVALID_ENGINE;
>  	engine->mask = BIT(id);
> -	if (GRAPHICS_VER(gt->i915) >= 11) {
> -		static const u32 engine_reset_domains[] = {
> -			[RCS0]  = GEN11_GRDOM_RENDER,
> -			[BCS0]  = GEN11_GRDOM_BLT,
> -			[VCS0]  = GEN11_GRDOM_MEDIA,
> -			[VCS1]  = GEN11_GRDOM_MEDIA2,
> -			[VCS2]  = GEN11_GRDOM_MEDIA3,
> -			[VCS3]  = GEN11_GRDOM_MEDIA4,
> -			[VCS4]  = GEN11_GRDOM_MEDIA5,
> -			[VCS5]  = GEN11_GRDOM_MEDIA6,
> -			[VCS6]  = GEN11_GRDOM_MEDIA7,
> -			[VCS7]  = GEN11_GRDOM_MEDIA8,
> -			[VECS0] = GEN11_GRDOM_VECS,
> -			[VECS1] = GEN11_GRDOM_VECS2,
> -			[VECS2] = GEN11_GRDOM_VECS3,
> -			[VECS3] = GEN11_GRDOM_VECS4,
> -		};
> -		GEM_BUG_ON(id >= ARRAY_SIZE(engine_reset_domains) ||
> -			   !engine_reset_domains[id]);
> -		engine->reset_domain = engine_reset_domains[id];
> -	} else {
> -		static const u32 engine_reset_domains[] = {
> -			[RCS0]  = GEN6_GRDOM_RENDER,
> -			[BCS0]  = GEN6_GRDOM_BLT,
> -			[VCS0]  = GEN6_GRDOM_MEDIA,
> -			[VCS1]  = GEN8_GRDOM_MEDIA2,
> -			[VECS0] = GEN6_GRDOM_VECS,
> -		};
> -		GEM_BUG_ON(id >= ARRAY_SIZE(engine_reset_domains) ||
> -			   !engine_reset_domains[id]);
> -		engine->reset_domain = engine_reset_domains[id];
> -	}
> +	engine->reset_domain = get_reset_domain(GRAPHICS_VER(gt->i915),
> +						id);
>  	engine->i915 = i915;
>  	engine->gt = gt;
>  	engine->uncore = gt->uncore;
> -- 
> 2.34.1
> 

      parent reply	other threads:[~2022-02-18 20:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 12:32 [Intel-gfx] [PATCH] drm/i915/gt: use get_reset_domain() helper Tejas Upadhyay
2022-02-17 21:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-02-18  8:06 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-02-18 20:27 ` Rodrigo Vivi [this message]

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=YhABT97K6C2NQRJb@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tejaskumarx.surendrakumar.upadhyay@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.