Intel-GFX Archive on lore.kernel.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 08/13] drm/i915: Allow a context to define its set of engines
Date: Mon, 11 Mar 2019 16:16:27 +0000	[thread overview]
Message-ID: <4567db7e-18f5-808a-5397-8ba4e555af62@linux.intel.com> (raw)
In-Reply-To: <155231554034.28158.10148353376668816103@skylake-alporthouse-com>


On 11/03/2019 14:45, Chris Wilson wrote:
> Quoting Chris Wilson (2019-03-11 09:45:17)
>> Quoting Tvrtko Ursulin (2019-03-11 09:23:44)
>>>
>>> On 08/03/2019 16:47, Chris Wilson wrote:
>>>> Quoting Tvrtko Ursulin (2019-03-08 16:27:22)
>>>>>
>>>>> On 08/03/2019 14:12, Chris Wilson wrote:
>>>>>> +static int
>>>>>> +set_engines(struct i915_gem_context *ctx,
>>>>>> +         const struct drm_i915_gem_context_param *args)
>>>>>> +{
>>>>>> +     struct i915_context_param_engines __user *user;
>>>>>> +     struct set_engines set = { .ctx = ctx };
>>>>>> +     u64 size, extensions;
>>>>>> +     unsigned int n;
>>>>>> +     int err;
>>>>>> +
>>>>>> +     user = u64_to_user_ptr(args->value);
>>>>>> +     size = args->size;
>>>>>> +     if (!size)
>>>>>> +             goto out;
>>>>>
>>>>> This prevents a hypothetical extension with empty map data.
>>>>
>>>> No... This is required for resetting and I think that's covered in what
>>>> little docs there are. It's the set.nengine==0 test later
>>>> that you mean to object to. But we can't do that as that's how we
>>>> differentiate between modes at the moment.
>>>>
>>>> We could use ctx->nengine = 0 and ctx->engines = ZERO_PTR.
>>>
>>> size == sizeof(struct i915_context_param_engines) could mean reset -
>>> meaning no map array provided.
>>
>> Nah, size=sizeof() => 0 [], size=0 => default map.
>>   
>>> Meaning one could reset the map and still pass in extensions.
>>
>> I missed that you were pointing out we didn't follow the extensions on
>> resetting.
>>
>> I'm not sure if that makes sense tbh. The extensions are written around
>> the concept of applying to the new engines[], and if the use has
>> explicitly removed the engines[] (distinct from defining a zero array),
>> what extensions can apply? One hopes they end up -EINVAL. As they should
>> -EINVAL, I guess it is no harm done to apply them.
> 
> Ok, the problem with the size=0 case is that quite obviously there is no
> extension chain to follow. (That was silly of me.)
> 
> I think
> 	.size = 0 => reset to default
> and
> 	.size = sizeof(arg) => 0 engines ([])

What is the difference between these two?

> 	.size = sizeof(arg) + N*sizeof(*class_instance) => N engines ([N])
> make the most logical sense, which does imply that if you want to apply
> extension options to ctx->engines[] you need to specify them.
> 
> And that also implies that if we have an extension that may make sense
> to the default setup, then either we say creating the engine[] map is
> compulsory, or we don't use a set-engines extension for that.

Hm.. load_balance is extension of set_engines. If we wanted to go crazy 
we could also support it directly from set_param(param=LOAD_BALANCE)?

I am not saying it makes sense, just thinking out loud.

Regards,

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

  reply	other threads:[~2019-03-11 16:16 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 [this message]
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
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=4567db7e-18f5-808a-5397-8ba4e555af62@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