public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 14/18] drm/i915: Extend I915_CONTEXT_PARAM_SSEU to support local ctx->engine[]
Date: Wed, 20 Mar 2019 13:22:03 +0000	[thread overview]
Message-ID: <5df6cc33-a9dc-9c29-f804-3f4ac7a4ffe7@linux.intel.com> (raw)
In-Reply-To: <20190319115742.21844-14-chris@chris-wilson.co.uk>


On 19/03/2019 11:57, 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 f038c15e73d8..cbd76ef95115 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -1381,6 +1381,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;
>   	int ret;
>   
>   	if (args->size < sizeof(user_sseu))
> @@ -1393,10 +1394,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)
> @@ -1967,6 +1975,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;
> @@ -1977,10 +1986,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 4e67c2395b46..8ef6d60929c6 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -1567,9 +1567,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
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-03-20 13:22 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 11:57 [PATCH 01/18] drm/i915/selftests: Provide stub reset functions Chris Wilson
2019-03-19 11:57 ` [PATCH 02/18] drm/i915: Flush pages on acquisition Chris Wilson
2019-03-20 11:41   ` Matthew Auld
2019-03-20 11:48     ` Chris Wilson
2019-03-20 12:26       ` Matthew Auld
2019-03-20 12:35         ` Chris Wilson
2019-03-20 14:24           ` Matthew Auld
2019-03-21  0:16           ` Chris Wilson
2019-03-19 11:57 ` [PATCH 03/18] drm/i915: Move intel_engine_mask_t around for use by i915_request_types.h Chris Wilson
2019-03-19 11:57 ` [PATCH 04/18] drm/i915: Separate GEM context construction and registration to userspace Chris Wilson
2019-03-19 13:41   ` Tvrtko Ursulin
2019-03-19 13:56     ` Chris Wilson
2019-03-19 11:57 ` [PATCH 05/18] drm/i915: Introduce a mutex for file_priv->context_idr Chris Wilson
2019-03-20 10:36   ` Tvrtko Ursulin
2019-03-19 11:57 ` [PATCH 06/18] drm/i915: Stop storing ctx->user_handle Chris Wilson
2019-03-19 12:58   ` [PATCH v2] " Chris Wilson
2019-03-20 10:43     ` Tvrtko Ursulin
2019-03-19 11:57 ` [PATCH 07/18] drm/i915: Stop storing the context name as the timeline name Chris Wilson
2019-03-20 12:46   ` Tvrtko Ursulin
2019-03-19 11:57 ` [PATCH 08/18] drm/i915: Introduce the i915_user_extension_method Chris Wilson
2019-03-19 11:57 ` [PATCH 09/18] drm/i915: Create/destroy VM (ppGTT) for use with contexts Chris Wilson
2019-03-20 13:00   ` Tvrtko Ursulin
2019-03-19 11:57 ` [PATCH 10/18] drm/i915: Extend CONTEXT_CREATE to set parameters upon construction Chris Wilson
2019-03-19 11:57 ` [PATCH 11/18] drm/i915: Allow contexts to share a single timeline across all engines Chris Wilson
2019-03-19 11:57 ` [PATCH 12/18] drm/i915: Allow userspace to clone contexts on creation Chris Wilson
2019-03-20 13:13   ` Tvrtko Ursulin
2019-03-21 14:38     ` Chris Wilson
2019-03-21 15:19       ` Tvrtko Ursulin
2019-03-19 11:57 ` [PATCH 13/18] drm/i915: Allow a context to define its set of engines Chris Wilson
2019-03-20 13:20   ` Tvrtko Ursulin
2019-03-19 11:57 ` [PATCH 14/18] drm/i915: Extend I915_CONTEXT_PARAM_SSEU to support local ctx->engine[] Chris Wilson
2019-03-20 13:22   ` Tvrtko Ursulin [this message]
2019-03-19 11:57 ` [PATCH 15/18] drm/i915: Load balancing across a virtual engine Chris Wilson
2019-03-20 15:59   ` Tvrtko Ursulin
2019-03-21 15:00     ` Chris Wilson
2019-03-21 15:13       ` Tvrtko Ursulin
2019-03-21 15:28         ` Chris Wilson
2019-03-19 11:57 ` [PATCH 16/18] drm/i915: Extend execution fence to support a callback Chris Wilson
2019-03-19 11:57 ` [PATCH 17/18] drm/i915/execlists: Virtual engine bonding Chris Wilson
2019-03-19 11:57 ` [PATCH 18/18] drm/i915: Allow specification of parallel execbuf Chris Wilson
2019-03-19 12:09 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/18] drm/i915/selftests: Provide stub reset functions Patchwork
2019-03-19 12:18 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-19 12:40 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-03-19 13:12 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/18] drm/i915/selftests: Provide stub reset functions (rev2) Patchwork
2019-03-19 13:21 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-19 13:32 ` ✓ Fi.CI.BAT: success " Patchwork
2019-03-19 21:14 ` ✗ Fi.CI.IGT: failure " 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=5df6cc33-a9dc-9c29-f804-3f4ac7a4ffe7@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