Re: [igt-dev] [PATCH i-g-t] perf_pmu: Actually require engines again

Tvrtko Ursulin
2019-06-05T09:49:45Z

On 05/06/2019 10:08, Petri Latvala wrote:
> On Tue, Jun 04, 2019 at 09:51:17AM +0100, Tvrtko Ursulin wrote:
>>
>> On 04/06/2019 09:46, Petri Latvala wrote:
>>> In commit 32e421f6f74a ("test: perf_pmu: use the gem_engine_topology
>>> library") perf_pmu was converted to use gem_context_has_engine()
>>> instead of gem_require_engine, but missing the crucial part of
>>> igt_require().
>>>
>>> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> Cc: Andi Shyti <andi.shyti@intel.com>
>>> ---
>>> tests/perf_pmu.c | 6 +++---
>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
>>> index 72b9166a..fdaf96da 100644
>>> --- a/tests/perf_pmu.c
>>> +++ b/tests/perf_pmu.c
>>> @@ -1714,7 +1714,7 @@ igt_main
>>> igt_subtest_group {
>>> igt_fixture {
>>> - gem_context_has_engine(fd, 0, e->flags);
>>> + igt_require(gem_context_has_engine(fd, 0, e->flags));
>>
>> Hmmm.. is the line even needed? I think iterator will only contain available
>> engines.
>
>
> Good question, looks like no.
>
> Does the iterator only give available engines on ye olde kernels too?

There is a gem_has_ring in gem_engine_topology.c/intel_init_engine_list
on the legacy path so I think it filters them there as well.

Andi?

Regards,

Tvrtko