[igt-dev] [PATCH i-g-t v2] i915/gem_exec_params: Cross-check getparam against engine execution

Kamil Konieczny kamil.konieczny at linux.intel.com
Fri Feb 3 09:24:06 UTC 2023


Hi Nirmoy,

LGTM,

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

--
Kamil

On 2023-02-02 at 18:27:44 +0100, Nirmoy Das wrote:
> From: Chris Wilson <chris.p.wilson at intel.com>
> 
> Do not just skip the test if getparam for bsd, blt, vebox passes.
> Be more robust and compare result of getparam with a engine execution
> which should give more test coverage.
> 
> v2: improve commit message and keep RUN_FAIL()(Kamil)
> 
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> Signed-off-by: Chris Wilson <chris.p.wilson at intel.com>
> Co-developed-by: Nirmoy Das <nirmoy.das at intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
>  tests/i915/gem_exec_params.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/i915/gem_exec_params.c b/tests/i915/gem_exec_params.c
> index 618635ec3..fd86afa16 100644
> --- a/tests/i915/gem_exec_params.c
> +++ b/tests/i915/gem_exec_params.c
> @@ -411,24 +411,23 @@ igt_main
>  	igt_subtest("mmapped")
>  		mmapped(fd);
>  
> -#define RUN_FAIL(expected_errno) do { \
> -		igt_assert_eq(__gem_execbuf(fd, &execbuf), -expected_errno); \
> -	} while(0)
> +#define CHK_RUN(has_check, expected_errno) \
> +		igt_assert_eq(__gem_execbuf(fd, &execbuf), has_check(fd) ? 0 : -(expected_errno))
> +#define RUN_FAIL(expected_errno) \
> +		igt_assert_eq(__gem_execbuf(fd, &execbuf), -(expected_errno))
> +
>  
>  	igt_subtest("no-bsd") {
> -		igt_require(!gem_has_bsd(fd));
>  		execbuf.flags = I915_EXEC_BSD;
> -		RUN_FAIL(EINVAL);
> +		CHK_RUN(gem_has_bsd, EINVAL);
>  	}
>  	igt_subtest("no-blt") {
> -		igt_require(!gem_has_blt(fd));
>  		execbuf.flags = I915_EXEC_BLT;
> -		RUN_FAIL(EINVAL);
> +		CHK_RUN(gem_has_blt, EINVAL);
>  	}
>  	igt_subtest("no-vebox") {
> -		igt_require(!gem_has_vebox(fd));
>  		execbuf.flags = I915_EXEC_VEBOX;
> -		RUN_FAIL(EINVAL);
> +		CHK_RUN(gem_has_vebox, EINVAL);
>  	}
>  	igt_subtest("invalid-ring") {
>  		execbuf.flags = I915_EXEC_RING_MASK;
> -- 
> 2.39.0
> 


More information about the igt-dev mailing list