From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Bommu Krishnaiah <krishnaiah.bommu@intel.com>,
igt-dev@lists.freedesktop.org
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v2 1/1] lib/i915/gem_ring : set the engine to default context
Date: Fri, 28 Feb 2020 14:23:46 +0000 [thread overview]
Message-ID: <37d68435-ac43-ccf3-db03-bbd4ef632e2e@linux.intel.com> (raw)
In-Reply-To: <158289729413.24106.11399579225916670468@skylake-alporthouse-com>
On 28/02/2020 13:41, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2020-02-28 11:15:14)
>>
>> On 18/02/2020 08:22, Bommu Krishnaiah wrote:
>>> Copy the existing engine map from default context to
>>> newly created default context
>>>
>>> v2: addressed review comments
>>>
>>> Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>> ---
>>> lib/i915/gem_ring.c | 8 ++++++--
>>> lib/i915/gem_ring.h | 2 +-
>>> tests/i915/gem_busy.c | 2 +-
>>> tests/i915/gem_ctx_persistence.c | 2 +-
>>> tests/i915/gem_eio.c | 6 +++---
>>> tests/i915/gem_exec_await.c | 2 +-
>>> tests/i915/gem_exec_fence.c | 2 +-
>>> tests/i915/gem_exec_latency.c | 2 +-
>>> tests/i915/gem_exec_schedule.c | 6 +++---
>>> tests/i915/gem_ringfill.c | 2 +-
>>> tests/perf_pmu.c | 2 +-
>>> 11 files changed, 20 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/lib/i915/gem_ring.c b/lib/i915/gem_ring.c
>>> index 99f4741c..14abfb16 100644
>>> --- a/lib/i915/gem_ring.c
>>> +++ b/lib/i915/gem_ring.c
>>> @@ -143,11 +143,15 @@ __gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags
>>> * Number of batches that fit in the ring
>>> */
>>> unsigned int
>>> -gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags flags)
>>> +gem_measure_ring_inflight(int sfd, unsigned int engine, enum measure_ring_flags flags, bool copy_engine_map)
>>> {
>>> unsigned int min = ~0u;
>>> + int fd;
>>>
>>> - fd = gem_reopen_driver(fd);
>>> + fd = gem_reopen_driver(sfd);
>>> +
>>> + if (copy_engine_map)
>>> + gem_context_copy_engines(sfd, 0, fd, 0);
>>
>> Would querying the context for presence of engine map be too hacky? It
>> would avoid having to change the prototype etc. I guess it would be
>> hacky since it could incorrectly imply from which kind of context
>> 'engine' comes.
>>
>> Perhaps proper fix it to pass in fd/ctx tuple in here and then decide
>> locally. That sounds better to me than the bool. Chris, your opinion?
>
> I was just planning on adding USE_ENGINE to flags.
>
> The reason we had to add gem_reopen_driver() here was someone converted
> some tests to __for_each_physical_engine but later on in the same test
> we used gem_measure_ring_inflight with a legacy ring. So I was wary of
> that breaking again, and thought the exercise of making the USE_ENGINE
> explicit would be useful review of the callers.
What would be the meaning of USE_ENGINE, I don't follow.
I agree there is some attractiveness in marking the callers and so
making the "kind" of 'engine' explicit (and audited), however that
process in general is also very tedious and error prone.
Ctx+engine tuplet sounds more robust. If ctx has engine map we copy it
after re-opening the driver.
Or you want to drop re-opening? Then I don't see what a new flag could do.
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:[~2020-02-28 14:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-18 8:22 [igt-dev] [PATCH i-g-t v2 0/1] lib/i915/gem_ring : set the engine to default context Bommu Krishnaiah
2020-02-18 8:22 ` [igt-dev] [PATCH i-g-t v2 1/1] " Bommu Krishnaiah
2020-02-28 11:15 ` Tvrtko Ursulin
2020-02-28 13:41 ` Chris Wilson
2020-02-28 14:23 ` Tvrtko Ursulin [this message]
2020-02-28 14:33 ` Chris Wilson
2020-02-18 17:19 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/i915/gem_ring : set the engine to default context (rev2) Patchwork
2020-02-20 0:57 ` [igt-dev] ✓ Fi.CI.IGT: " 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=37d68435-ac43-ccf3-db03-bbd4ef632e2e@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.org \
--cc=krishnaiah.bommu@intel.com \
--cc=tvrtko.ursulin@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