All of lore.kernel.org
 help / color / mirror / Atom feed
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 v13 6/9] lib/i915: add gem_engine_topology library
Date: Wed, 20 Mar 2019 11:10:09 +0000	[thread overview]
Message-ID: <4cc0d8bc-bcb8-2e72-5652-8b4bfd97903c@linux.intel.com> (raw)
In-Reply-To: <20190320102921.GA2176@intel.intel>


On 20/03/2019 10:49, Andi Shyti wrote:
>>> +{
>>> +	const char *class_names[] = { "rcs", "bcs", "vcs", "vecs" };
>>> +	char *__name;
>>> +
>>> +	/* if we don't recognise the class, then we mark it as "unk" */
>>> +	if (name) {
>>> +		e2->name = name;
>>> +	} else {
>>> +		if (class >= ARRAY_SIZE(class_names))
>>> +			igt_assert(asprintf(&__name, "unk-%d:%d",
>>> +					    class, instance) > 0);
>>> +		else
>>> +			igt_assert(asprintf(&__name, "%s%d",
>>> +					    class_names[class], instance) > 0);
>>> +
>>> +		e2->name = __name;
>>
>> We discussed on the IRC how names can be borrowed from the static engine
>> table, which we have to keep maintaining due CI limitations anyway. That way
>> all leaks are solved.
>>
>> So you would just replace the above with a name lookup against the static
>> table and use that pointer.
> 
> Yes, this is the tax we need to pay for having counts name inside
> intel_execution_engine2.
> 
> I can take the pointer from our intel_exectuion_engines2 array,
> and then we wouldn't have "unk<class>:<instance>".
> 
> As I said the best thing here would be to remove the "const" and
> be able to use all the string functions.

Or, as long as we are depending on the static array being a superset, 
you could store a list of pointers to static array entries in the 
dynamic engine_data list, instead of copying over elements?

>>> +	} else if (cparam.size == sizeof(struct i915_context_param_engines)) {
>>
>> This should be "== 0" since Chris has special plans for the other.
>>
>>> +		/* else if context doesn't have mapped engines */
>>> +		query_engine_list(&engine_data);
>>> +		map_engine_context(&engine_data, &cparam);
>>> +
>>> +	} else {
>>> +		/* context has a list of mapped engines */
>>> +
>>> +		uint8_t nengines = (cparam.size -
>>> +				sizeof(struct i915_context_param_engines)) /
>>> +				sizeof(cengine->class_instance[0]);
>>> +
>>> +		for (i = 0; i < nengines - 1; i++)
>>
>> nengines - 1 is not right I think, just nengines.
>>
>>> +			dup_engine(&engine_data.engines[i], NULL,
>>> +				   cengine->class_instance[i].engine_class,
>>> +				   cengine->class_instance[i].engine_instance,
>>> +				   i + 1);
>>
>> Just "i" since index zero is not special any longer.
> 
> I was running on a messed up kernel that and was receiving weird
> values :/

If you are using my media branch and it is broken in some respect please 
report the details!

Regards,

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

  reply	other threads:[~2019-03-20 11:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 23:44 [igt-dev] [PATCH v13 0/9] new engine discovery interface Andi Shyti
2019-03-19 23:44 ` [igt-dev] [PATCH v13 1/9] lib/igt_gt: remove unnecessary argument Andi Shyti
2019-03-19 23:44 ` [igt-dev] [PATCH v13 2/9] lib: ioctl_wrappers: reach engines by index as well Andi Shyti
2019-03-20  9:14   ` Chris Wilson
2019-03-19 23:44 ` [igt-dev] [PATCH v13 3/9] lib: move gem_context_has_engine from ioctl_wrappers to gem_context Andi Shyti
2019-03-19 23:44 ` [igt-dev] [PATCH v13 4/9] include/drm-uapi: import i915_drm.h header file Andi Shyti
2019-03-19 23:44 ` [igt-dev] [PATCH v13 5/9] lib: igt_gt: use flags in intel_execution_engines2 Andi Shyti
2019-03-20  9:48   ` Tvrtko Ursulin
2019-03-19 23:44 ` [igt-dev] [PATCH v13 6/9] lib/i915: add gem_engine_topology library Andi Shyti
2019-03-20  9:47   ` Tvrtko Ursulin
2019-03-20 10:49     ` Andi Shyti
2019-03-20 11:10       ` Tvrtko Ursulin [this message]
2019-03-20 11:21         ` Andi Shyti
2019-03-20  9:56   ` Chris Wilson
2019-03-20 10:49     ` Andi Shyti
2019-03-20 10:59       ` Chris Wilson
2019-03-20 11:13         ` Andi Shyti
2019-03-20 11:18           ` Chris Wilson
2019-03-20 11:35             ` Andi Shyti
2019-03-19 23:44 ` [igt-dev] [PATCH v13 7/9] lib/igt_gt: use for_each_engine_class_instance to loop through active engines Andi Shyti
2019-03-20 10:04   ` Tvrtko Ursulin
2019-03-20 10:09     ` Chris Wilson
2019-03-20 10:33       ` Tvrtko Ursulin
2019-03-20 10:40         ` Chris Wilson
2019-03-19 23:44 ` [igt-dev] [PATCH v13 8/9] tests: perf_pmu: use the flag value embedded in intel_execution_engines2 Andi Shyti
2019-03-19 23:44 ` [igt-dev] [PATCH v13 9/9] tests: gem_exec_basic: add "exec-ctx" buffer execution demo test Andi Shyti
2019-03-20  0:13 ` [igt-dev] ✓ Fi.CI.BAT: success for new engine discovery interface Patchwork
2019-03-20  9:35 ` [igt-dev] ✗ 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=4cc0d8bc-bcb8-2e72-5652-8b4bfd97903c@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.