From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Andi Shyti <andi.shyti@intel.com>
Cc: IGT dev <igt-dev@lists.freedesktop.org>, Andi Shyti <andi@etezian.org>
Subject: Re: [igt-dev] [PATCH v12 5/7] lib/i915: add gem_engine_topology library
Date: Tue, 19 Mar 2019 11:01:00 +0000 [thread overview]
Message-ID: <206f68bf-9247-0cfa-c69a-0e2c59c75f77@linux.intel.com> (raw)
In-Reply-To: <20190319104425.GC1135@intel.intel>
On 19/03/2019 10:44, Andi Shyti wrote:
> Hi Tvrtko,
>
> I agree with everything... few comments.
>
>>> + if (__gem_context_get_param(fd, &ctx_param)) {
>>> + const struct intel_execution_engine2 *e2;
>>> +
>>> + igt_debug("using pre-allocated engine list\n");
>>> +
>>> + __for_each_engine_class_instance(e2) {
>>> + if (!gem_has_engine(fd, e2->class, e2->instance))
>>> + continue;
>>> +
>>> + engine_data.engines[engine_data.nengines].name =
>>> + e2->name;
>>> + engine_data.engines[engine_data.nengines].instance =
>>> + e2->instance;
>>> + engine_data.engines[engine_data.nengines].class =
>>> + e2->class;
>>
>> Also could keep a pointer to engine_data.engines[<current>] for more
>> readable assignments.
>>
>>> + engine_data.nengines++;
>>> + }
>>> +
>>> + return engine_data;
>>> + }
>>> +
>>> + init_engine_list(&engine_data);
>>
>> As far as I can see you missed the use case where we want to iterate over
>> engines already defined in the context engine map.
>>
>> So I think if the above __gem_context_get_param succeeds with non-zero size
>> returned, you need to build engine_data based on those engines.
>
> Don't I get the engine list anyway? Do you man that
> DRM_I915_QUERY_ENGINE_INFO might have a different list from
> I915_CONTEXT_PARAM_ENGINES?
Yes, context may be configured to a subset of physical engines. That's
Chris' use case of preparing his own context and then being able to
iterate over it.
>>> + if (__gem_context_get_param(fd, &ctx_param)) {
>>> + eb->flags |= (I915_EXEC_RING_MASK & engine);
>>> + eb->rsvd1 = ctx;
>>> + } else {
>>> + eb->flags |= gem_class_instance_to_eb_flags(fd, e2.class,
>>> + e2.instance);
>>> + }
>>> +}
>>
>> Store flags in struct intel_execution_engine2 while building the list and
>> then just eb->flags |= e2->eb_flags in tests?
>
> You are recommending to extend the 'intel_execution_engine2' (that
> would make my life so very easy), I've been asked not to touch
> that structure.
>
> Then, I will add the flags value in the 'intel_execution_engine2'
> definition.
If you have explicit ask from Chris on how to do it, then follow his
idea. That's usually the quickest way upstream. :)
>
>>> +struct intel_engine_data {
>>> + int fd;
>>> + uint32_t ctx;
>>> +
>>> + uint32_t nengines;
>>> + uint32_t n;
>>
>> This is the current engine index? Could it come handy to also have a pointer
>> to current engine in the iterator? Will see in later patches..
>
> Actually not, in earlier version I had the pointer, but never
> used, so that I removed it.
I guess it depends on whether pointer to current engine is a parameter
in the for loop iterator and tests have to declare it, or we allow tests
to not bother and use the implicit iterator object to access it.
For me it is 50-50 which way we go.
Regards,
Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-03-19 11:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-18 23:28 [igt-dev] [PATCH v12 0/7] new engine discovery interface Andi Shyti
2019-03-18 23:28 ` [igt-dev] [PATCH v12 1/7] lib/igt_gt: remove unnecessary argument Andi Shyti
2019-03-18 23:28 ` [igt-dev] [PATCH v12 2/7] lib: ioctl_wrappers: reach engines by index as well Andi Shyti
2019-03-18 23:28 ` [igt-dev] [PATCH v12 3/7] lib: move gem_context_has_engine from ioctl_wrappers to gem_context Andi Shyti
2019-03-18 23:28 ` [igt-dev] [PATCH v12 4/7] include/drm-uapi: import i915_drm.h header file Andi Shyti
2019-03-18 23:28 ` [igt-dev] [PATCH v12 5/7] lib/i915: add gem_engine_topology library Andi Shyti
2019-03-19 9:43 ` Chris Wilson
2019-03-19 10:00 ` Andi Shyti
2019-03-19 10:18 ` Tvrtko Ursulin
2019-03-19 10:44 ` Andi Shyti
2019-03-19 11:01 ` Tvrtko Ursulin [this message]
2019-03-18 23:28 ` [igt-dev] [PATCH v12 6/7] lib/igt_gt: use for_each_engine_class_instance to loop through active engines Andi Shyti
2019-03-19 10:22 ` Tvrtko Ursulin
2019-03-19 10:26 ` Andi Shyti
2019-03-18 23:28 ` [igt-dev] [PATCH v12 7/7] tests: gem_exec_basic: add "exec-ctx" buffer execution demo test Andi Shyti
2019-03-18 23:33 ` [igt-dev] ✗ Fi.CI.BAT: failure for new engine discovery interface 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=206f68bf-9247-0cfa-c69a-0e2c59c75f77@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=andi.shyti@intel.com \
--cc=andi@etezian.org \
--cc=igt-dev@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