public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@intel.com>
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 v12 5/7] lib/i915: add gem_engine_topology library
Date: Tue, 19 Mar 2019 12:44:25 +0200	[thread overview]
Message-ID: <20190319104425.GC1135@intel.intel> (raw)
In-Reply-To: <4e154615-802d-71da-46c9-8c7614d46492@linux.intel.com>

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?

> > +	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.

> > +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.

> Regards,

Thanks a lot,
Andi

> Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-03-19 10:44 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 [this message]
2019-03-19 11:01       ` Tvrtko Ursulin
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=20190319104425.GC1135@intel.intel \
    --to=andi.shyti@intel.com \
    --cc=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