[igt-dev] [i-g-t] lib/gem_submission: Remove __gem_execbuf call

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Apr 8 09:33:20 UTC 2021


On Thu, Apr 08, 2021 at 12:22:31PM +0530, Tejas Upadhyay wrote:
> After reloc support got dropped on GEN12/12+, lot of tests are
> reporting failures which should be skipped using check
> gem_has_relocations(). The problem is lot of those failures are
> due to direct __gem_execbuf() call where we cant put gem_has_
> relocations check to skip the test in case platform does not
> support reason being it also calls __gem_execbuf which creates
> never ending loop. Thus to avoid looping, call __gem_execbuf()
> inside gem_has_relocations() is replaced with direct ioctl call.

We cannot do that. We have to fix tests, not to skip them.

--
Zbigniew

> 
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay at intel.com>
> ---
>  lib/i915/gem_submission.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c
> index 051f9d04..50a8ae11 100644
> --- a/lib/i915/gem_submission.c
> +++ b/lib/i915/gem_submission.c
> @@ -422,8 +422,14 @@ bool gem_has_relocations(int i915)
>  		.buffer_count = 1,
>  	};
>  	bool has_relocs;
> +	int err = 0;
> +
> +	if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf)) {
> +		err = -errno;
> +		igt_assume(err != 0);
> +	}
>  
> -	has_relocs = __gem_execbuf(i915, &execbuf) == -ENOENT;
> +	has_relocs = err == -ENOENT;
>  	gem_close(i915, obj.handle);
>  
>  	return has_relocs;
> -- 
> 2.30.0
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list