[igt-dev] [PATCH v23 09/14] test/i915: gem_ctx_exec: use the gem_engine_topology library

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Mon May 13 10:46:48 UTC 2019


On 13/05/2019 01:45, Andi Shyti wrote:
> From: Andi Shyti <andi.shyti at intel.com>
> 
> Replace the legacy for_each_engine* defines with the ones
> implemented in the gem_engine_topology library.
> 
> Signed-off-by: Andi Shyti <andi.shyti at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>   tests/i915/gem_ctx_exec.c | 15 +++++++--------
>   1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/i915/gem_ctx_exec.c b/tests/i915/gem_ctx_exec.c
> index b8e0e0743892..c3543bfe5dd1 100644
> --- a/tests/i915/gem_ctx_exec.c
> +++ b/tests/i915/gem_ctx_exec.c
> @@ -111,7 +111,8 @@ static void big_exec(int fd, uint32_t handle, int ring)
>   	gem_sync(fd, handle);
>   }
>   
> -static void invalid_context(int fd, unsigned ring, uint32_t handle)
> +static void invalid_context(int fd, struct intel_execution_engine2 *e,
> +			    uint32_t handle)
>   {
>   	struct drm_i915_gem_exec_object2 obj = {
>   		.handle = handle,
> @@ -119,7 +120,7 @@ static void invalid_context(int fd, unsigned ring, uint32_t handle)
>   	struct drm_i915_gem_execbuffer2 execbuf = {
>   		.buffers_ptr = to_user_pointer(&obj),
>   		.buffer_count = 1,
> -		.flags = ring,
> +		.flags = e->flags,
>   	};
>   	unsigned int i;
>   	uint32_t ctx;
> @@ -198,7 +199,7 @@ static void norecovery(int i915)
>   igt_main
>   {
>   	const uint32_t batch[2] = { 0, MI_BATCH_BUFFER_END };
> -	const struct intel_execution_engine *e;
> +	struct intel_execution_engine2 *e;

I think if you added const new parameter in invalid_context this one 
here would be able to stay. It would have been nicer I think but never mind.

>   	uint32_t handle;
>   	uint32_t ctx_id;
>   	int fd;
> @@ -228,11 +229,9 @@ igt_main
>   		gem_sync(fd, handle);
>   	}
>   
> -	for (e = intel_execution_engines; e->name; e++) {
> -		igt_subtest_f("basic-invalid-context-%s", e->name) {
> -			gem_require_ring(fd, e->exec_id | e->flags);
> -			invalid_context(fd, e->exec_id | e->flags, handle);
> -		}
> +	__for_each_physical_engine(fd, e) {
> +		igt_subtest_f("basic-invalid-context-%s", e->name)
> +			invalid_context(fd, e, handle);
>   	}
>   
>   	igt_subtest("eviction")
> 
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko


More information about the igt-dev mailing list