From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 09/13] drm/i915: Extend I915_CONTEXT_PARAM_SSEU to support local ctx->engine[]
Date: Fri, 8 Mar 2019 16:31:51 +0000 [thread overview]
Message-ID: <46560f29-2cf3-fbd3-d29d-c9635b246996@linux.intel.com> (raw)
In-Reply-To: <20190308141244.16837-10-chris@chris-wilson.co.uk>
On 08/03/2019 14:12, Chris Wilson wrote:
> Allow the user to specify a local engine index (as opposed to
> class:index) that they can use to refer to a preset engine inside the
> ctx->engine[] array defined by an earlier I915_CONTEXT_PARAM_ENGINES.
> This will be useful for setting SSEU parameters on virtual engines that
> are local to the context and do not have a valid global class:instance
> lookup.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_context.c | 24 ++++++++++++++++++++----
> include/uapi/drm/i915_drm.h | 3 ++-
> 2 files changed, 22 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index 86d9bea6f275..a581c01ffff1 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -1313,6 +1313,7 @@ static int set_sseu(struct i915_gem_context *ctx,
> struct drm_i915_gem_context_param_sseu user_sseu;
> struct intel_engine_cs *engine;
> struct intel_sseu sseu;
> + unsigned long lookup;
Poor 32-bit builds. ;) And in lookup_user_engine as well.
> int ret;
>
> if (args->size < sizeof(user_sseu))
> @@ -1325,10 +1326,17 @@ static int set_sseu(struct i915_gem_context *ctx,
> sizeof(user_sseu)))
> return -EFAULT;
>
> - if (user_sseu.flags || user_sseu.rsvd)
> + if (user_sseu.rsvd)
> return -EINVAL;
>
> - engine = lookup_user_engine(ctx, 0,
> + if (user_sseu.flags & ~(I915_CONTEXT_SSEU_FLAG_ENGINE_INDEX))
> + return -EINVAL;
> +
> + lookup = 0;
> + if (user_sseu.flags & I915_CONTEXT_SSEU_FLAG_ENGINE_INDEX)
> + lookup |= LOOKUP_USER_INDEX;
> +
> + engine = lookup_user_engine(ctx, lookup,
> user_sseu.engine_class,
> user_sseu.engine_instance);
> if (!engine)
> @@ -1807,6 +1815,7 @@ static int get_sseu(struct i915_gem_context *ctx,
> struct drm_i915_gem_context_param_sseu user_sseu;
> struct intel_engine_cs *engine;
> struct intel_context *ce;
> + unsigned long lookup;
>
> if (args->size == 0)
> goto out;
> @@ -1817,10 +1826,17 @@ static int get_sseu(struct i915_gem_context *ctx,
> sizeof(user_sseu)))
> return -EFAULT;
>
> - if (user_sseu.flags || user_sseu.rsvd)
> + if (user_sseu.rsvd)
> return -EINVAL;
>
> - engine = lookup_user_engine(ctx, 0,
> + if (user_sseu.flags & ~(I915_CONTEXT_SSEU_FLAG_ENGINE_INDEX))
> + return -EINVAL;
> +
> + lookup = 0;
> + if (user_sseu.flags & I915_CONTEXT_SSEU_FLAG_ENGINE_INDEX)
> + lookup |= LOOKUP_USER_INDEX;
> +
> + engine = lookup_user_engine(ctx, lookup,
> user_sseu.engine_class,
> user_sseu.engine_instance);
> if (!engine)
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index 00147b990e63..a609619610f2 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -1565,9 +1565,10 @@ struct drm_i915_gem_context_param_sseu {
> __u16 engine_instance;
>
> /*
> - * Unused for now. Must be cleared to zero.
> + * Unknown flags must be cleared to zero.
> */
> __u32 flags;
> +#define I915_CONTEXT_SSEU_FLAG_ENGINE_INDEX (1u << 0)
>
> /*
> * Mask of slices to enable for the context. Valid values are a subset
>
Looks okay. But one more thing is needed:
https://cgit.freedesktop.org/~tursulin/drm-intel/commit/?h=media&id=38266bfe99469de9e13774a13fa641c377988c67
If you don't disagree with this patch feel free to adopt it into your tree.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-03-08 16:31 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 14:12 Home straight for veng, the uAPI wars Chris Wilson
2019-03-08 14:12 ` [PATCH 01/13] drm/i915: Suppress the "Failed to idle" warning for gem_eio Chris Wilson
2019-03-08 14:12 ` [PATCH 02/13] drm/i915: Introduce the i915_user_extension_method Chris Wilson
2019-03-08 14:33 ` Tvrtko Ursulin
2019-03-13 10:50 ` Chris Wilson
2019-03-13 11:13 ` Tvrtko Ursulin
2019-03-13 11:21 ` Chris Wilson
2019-03-13 11:35 ` Tvrtko Ursulin
2019-03-13 11:46 ` Chris Wilson
2019-03-13 13:11 ` Tvrtko Ursulin
2019-03-13 13:14 ` Chris Wilson
2019-03-08 14:12 ` [PATCH 03/13] drm/i915: Introduce a context barrier callback Chris Wilson
2019-03-08 14:12 ` [PATCH 04/13] drm/i915: Create/destroy VM (ppGTT) for use with contexts Chris Wilson
2019-03-08 15:03 ` Tvrtko Ursulin
2019-03-08 15:35 ` Chris Wilson
2019-03-08 15:41 ` [PATCH v2] " Chris Wilson
2019-03-08 14:12 ` [PATCH 05/13] drm/i915: Extend CONTEXT_CREATE to set parameters upon construction Chris Wilson
2019-03-08 14:12 ` [PATCH 06/13] drm/i915: Allow contexts to share a single timeline across all engines Chris Wilson
2019-03-08 15:56 ` Tvrtko Ursulin
2019-03-08 14:12 ` [PATCH 07/13] drm/i915: Allow userspace to clone contexts on creation Chris Wilson
2019-03-08 16:13 ` Tvrtko Ursulin
2019-03-08 16:34 ` Chris Wilson
2019-03-08 14:12 ` [PATCH 08/13] drm/i915: Allow a context to define its set of engines Chris Wilson
2019-03-08 16:27 ` Tvrtko Ursulin
2019-03-08 16:47 ` Chris Wilson
2019-03-11 9:23 ` Tvrtko Ursulin
2019-03-11 9:45 ` Chris Wilson
2019-03-11 10:12 ` Tvrtko Ursulin
2019-03-11 14:45 ` Chris Wilson
2019-03-11 16:16 ` Tvrtko Ursulin
2019-03-11 16:22 ` Chris Wilson
2019-03-11 16:34 ` Tvrtko Ursulin
2019-03-11 16:52 ` Chris Wilson
2019-03-08 14:12 ` [PATCH 09/13] drm/i915: Extend I915_CONTEXT_PARAM_SSEU to support local ctx->engine[] Chris Wilson
2019-03-08 16:31 ` Tvrtko Ursulin [this message]
2019-03-08 16:57 ` Chris Wilson
2019-03-11 7:14 ` Tvrtko Ursulin
2019-03-11 10:33 ` Chris Wilson
2019-03-08 17:11 ` Chris Wilson
2019-03-11 7:16 ` Tvrtko Ursulin
2019-03-11 10:31 ` Chris Wilson
2019-03-08 14:12 ` [PATCH 10/13] drm/i915: Load balancing across a virtual engine Chris Wilson
2019-03-11 12:47 ` Tvrtko Ursulin
2019-03-11 13:43 ` Chris Wilson
2019-03-12 7:52 ` Tvrtko Ursulin
2019-03-12 8:56 ` Chris Wilson
2019-03-08 14:12 ` [PATCH 11/13] drm/i915: Extend execution fence to support a callback Chris Wilson
2019-03-11 13:09 ` Tvrtko Ursulin
2019-03-11 14:22 ` Chris Wilson
2019-03-08 14:12 ` [PATCH 12/13] drm/i915/execlists: Virtual engine bonding Chris Wilson
2019-03-11 13:38 ` Tvrtko Ursulin
2019-03-11 14:30 ` Chris Wilson
2019-03-08 14:12 ` [PATCH 13/13] drm/i915: Allow specification of parallel execbuf Chris Wilson
2019-03-11 13:40 ` Tvrtko Ursulin
2019-03-08 14:58 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/13] drm/i915: Suppress the "Failed to idle" warning for gem_eio Patchwork
2019-03-08 15:05 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-08 15:19 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-03-08 16:47 ` ✗ Fi.CI.BAT: failure for series starting with [01/13] drm/i915: Suppress the "Failed to idle" warning for gem_eio (rev2) Patchwork
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=46560f29-2cf3-fbd3-d29d-c9635b246996@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox