All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Subject: Re: [PATCH 2/3] drm/i915: Store engine mask in intel_gt
Date: Wed, 16 Oct 2019 14:03:34 +0100	[thread overview]
Message-ID: <157123101407.22469.10360475997002619905@skylake-alporthouse-com> (raw)
In-Reply-To: <20191016122843.9429-2-tvrtko.ursulin@linux.intel.com>

Quoting Tvrtko Ursulin (2019-10-16 13:28:42)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Medium term goal is to eliminate the i915->engine[] array and to get there
> we have recently introduced equivalent array in intel_gt. Now we need to
> migrate the code further towards this state.
> 
> To allow for_each_engine_masked call sites to pass in gt instead of i915
> we need to have a copy of INTEL_INFO()->engine_mask in intel_gt.
> 
> For this to work we also need to use engine->id as index when populating
> the gt->engine[] array.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/gt/intel_engine_user.c | 4 ++--
>  drivers/gpu/drm/i915/gt/intel_gt.c          | 5 +++++
>  drivers/gpu/drm/i915/gt/intel_gt.h          | 1 +
>  drivers/gpu/drm/i915/gt/intel_gt_types.h    | 4 ++++
>  drivers/gpu/drm/i915/i915_drv.c             | 2 ++
>  5 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_user.c b/drivers/gpu/drm/i915/gt/intel_engine_user.c
> index 77cd5de83930..099abae860ec 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_user.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_user.c
> @@ -183,8 +183,8 @@ static void add_legacy_ring(struct legacy_ring *ring,
>         if (unlikely(idx == -1))
>                 return;
>  
> -       GEM_BUG_ON(idx >= ARRAY_SIZE(ring->gt->engine));
> -       ring->gt->engine[idx] = engine;

This is used for the legacy uapi mapping. So we need to adjust the loop
in i915_gem_context.c::default_engines() to use engine->legacy_idx
instead of id. And all other users of engine->legacy_idx are now
backwards.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-10-16 13:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16 12:28 [PATCH 1/3] drm/i915: Make i915_gem_load_power_context take struct intel_gt Tvrtko Ursulin
2019-10-16 12:28 ` [PATCH 2/3] drm/i915: Store engine mask in intel_gt Tvrtko Ursulin
2019-10-16 13:03   ` Chris Wilson [this message]
2019-10-16 13:31     ` Tvrtko Ursulin
2019-10-16 13:41       ` Chris Wilson
2019-10-16 12:28 ` [PATCH 3/3] drm/i915: Pass in intel_gt at some for_each_engine sites Tvrtko Ursulin
2019-10-16 13:04   ` Chris Wilson

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=157123101407.22469.10360475997002619905@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.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.