From: Andi Shyti <andi@etezian.org>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: IGT dev <igt-dev@lists.freedesktop.org>, Andi Shyti <andi@etezian.org>
Subject: Re: [igt-dev] [PATCH] lib/i915: gem_engine_topology: get eb flags from engine's coordiantes
Date: Thu, 20 Jun 2019 10:52:32 +0300 [thread overview]
Message-ID: <20190620075232.GA10328@jack.zhora.eu> (raw)
In-Reply-To: <f841495e-b5cd-9249-2d18-282885fb5945@linux.intel.com>
Hi Tvrtko,
> > + struct intel_execution_engine2 *e;
> > +
> > + for_each_context_engine(fd, ctx_id, e)
> > + if (class == e->class && instance == e->instance)
> > + return e->flags;
>
> And most important difference, I wouldn't configure the context from this helper. Instead I think all we need is:
>
> int gem_context_get_eb_flags(int fd, uint32_t ctx, struct i915_engine_class_instance ci)
> {
> DEFINE_CONTEXT_ENGINES_PARAM(engines, param, ctx, GEM_MAX_ENGINES);
> int ret
>
> ret = gem_topology_get_param(fd, ¶m);
> if (ret) {
> const struct intel_execution_engine2 *e;
>
> /* Legacy kernels. */
> __for_each_static_engine(e) {
> if (e->class == ci.engine_class &&
> e->instance == ci.engine_instance)
> return e->flags;
> }
>
> return -EINVAL;
> }
>
> /* Engine map with no engines. */
> if (!param.size)
> return -EINVAL;
this means that tests have responsibility to alway create a
context and do the mapping before (we haven't always assumed it
in other tests).
> /* Engine map lookup. */
> for (unsigned int i = 0; i < param.size; i++) {
> if (engines.engines[i].engine_class == ci.engine_class &&
> engines.engines[i].engine_instance == ci.engine_instance)
> return i;
> }
>
> return -EINVAL;
> }
This version, a the end, becomes a slim version of
'intel_init_engine_list', with the only difference that it
wouldn't do any mapping (which I agree would be too much but we
did it in other tests), that's why, at the end I preferred the
short version I sent.
OK, we can definitely do it this way, too
Andi
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-06-20 8:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-19 22:19 [igt-dev] [PATCH] lib/i915: gem_engine_topology: get eb flags from engine's coordiantes Andi Shyti
2019-06-19 23:33 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-06-20 5:59 ` [igt-dev] [PATCH] " Tvrtko Ursulin
2019-06-20 7:52 ` Andi Shyti [this message]
2019-06-20 8:12 ` Tvrtko Ursulin
2019-06-20 8:26 ` Chris Wilson
2019-06-20 14:38 ` [igt-dev] ✓ Fi.CI.IGT: success for " 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=20190620075232.GA10328@jack.zhora.eu \
--to=andi@etezian.org \
--cc=igt-dev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox