[igt-dev] [PATCH i-g-t 21/93] tests/i915/perf_pmu: Convert to intel_ctx_t

Dixit, Ashutosh ashutosh.dixit at intel.com
Sat Jun 12 01:42:27 UTC 2021


On Wed, 09 Jun 2021 10:36:04 -0700, Jason Ekstrand wrote:
>
> @@ -2107,48 +2130,48 @@ igt_main
>	 * Test that a single engine metric can be initialized or it
>	 * is correctly rejected.
>	 */
> -	test_each_engine("init-busy", fd, e)
> +	test_each_engine("init-busy", fd, ctx, e)
>		init(fd, e, I915_SAMPLE_BUSY);
>
> -	test_each_engine("init-wait", fd, e)
> +	test_each_engine("init-wait", fd, ctx, e)
>		init(fd, e, I915_SAMPLE_WAIT);
>
> -	test_each_engine("init-sema", fd, e)
> +	test_each_engine("init-sema", fd, ctx, e)
>		init(fd, e, I915_SAMPLE_SEMA);

To be completely equivalent to the previous code it seems we should be
passing in ctx into init() so that ctx->id can be passed into
gem_context_has_engine() instead of id 0. Since only ctx has all engines
and ctx 0 only has legacy engines (unlike previous code where ctx 0 had all
engines).

>	/**
>	 * Check render nodes are counted.
>	 */
>	igt_subtest_group {
>		int render_fd = -1;
> +		const intel_ctx_t *render_ctx = NULL;
>
>		igt_fixture {
>			render_fd = __drm_open_driver_render(DRIVER_INTEL);
>			igt_require_gem(render_fd);
> +			render_ctx = intel_ctx_create_all_physical(render_fd);
>
>			gem_quiescent_gpu(fd);
>		}
>
> -		test_each_engine("render-node-busy", render_fd, e)
> -			single(render_fd, e, TEST_BUSY);
> -		test_each_engine("render-node-busy-idle", render_fd, e)
> -			single(render_fd, e, TEST_BUSY | TEST_TRAILING_IDLE);
> +		test_each_engine("render-node-busy", render_fd, ctx, e)

Shouldn't this be render_ctx instead of ctx?

> +			single(render_fd, render_ctx, e, TEST_BUSY);
> +		test_each_engine("render-node-busy-idle", render_fd, ctx, e)

Shouldn't this be render_ctx instead of ctx?

Everthing else seems to be fine.


More information about the igt-dev mailing list