[igt-dev] [PATCH i-g-t 7/9] tests/perf_pmu: Always skip missing engines

Chris Wilson chris at chris-wilson.co.uk
Fri Feb 2 20:54:58 UTC 2018


Quoting Tvrtko Ursulin (2018-02-02 18:37:52)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> Always skip missing engines to make tests skips very early and avoid
> losing time in tests which need to do setups or waits before they would
> otherwise detect this.
> 
> To ensure PMU is rejecting opening missing engines we will add an explicit
> test later.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>  tests/perf_pmu.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index de0a1c7d936c..d654ece63bb7 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -155,6 +155,8 @@ single(int gem_fd, const struct intel_execution_engine2 *e, unsigned int flags)
>         uint64_t val;
>         int fd;
>  
> +       gem_require_engine(gem_fd, e->class, e->instance);
> +
>         fd = open_pmu(I915_PMU_ENGINE_BUSY(e->class, e->instance));
>  
>         if (flags & TEST_BUSY)

I feel these probably deserve to be in an
for_each_engine(...)
	igt_subtest_group {
		igt_fixture {
			gem_require_engine(...)
		}

		igt_subtest() {
			single(...)
		}
		etc.
	}
-Chris


More information about the igt-dev mailing list