Chris Wilson <[email protected]> writes:

> Signed-off-by: Chris Wilson <[email protected]>
> ---
>  tests/gem_workarounds.c | 28 +++++++++++++++++++++++-----
>  1 file changed, 23 insertions(+), 5 deletions(-)
>
> diff --git a/tests/gem_workarounds.c b/tests/gem_workarounds.c
> index 95ec250a..c252133f 100644
> --- a/tests/gem_workarounds.c
> +++ b/tests/gem_workarounds.c
> @@ -164,8 +164,14 @@ static int workaround_fail_count(int fd)
>       return fail_count;
>  }
>  
> -static void check_workarounds(int fd, enum operation op)
> +#define CONTEXT 0x1
> +static void check_workarounds(int fd, enum operation op, unsigned int flags)
>  {
> +     uint32_t ctx = 0;
> +
> +     if (flags & CONTEXT)
> +             ctx = gem_context_create(fd);
> +
>       igt_assert_eq(workaround_fail_count(fd), 0);

The batch to read them will still use the default context. I would
have assumed that you want to read the results throught your
newly created context?

-Mika


>  
>       switch (op) {
> @@ -178,13 +184,16 @@ static void check_workarounds(int fd, enum operation op)
>               break;
>  
>       case SIMPLE_READ:
> -             return;
> +             break;
>  
>       default:
>               igt_assert(0);
>       }
>  
>       igt_assert_eq(workaround_fail_count(fd), 0);
> +
> +     if (ctx)
> +             gem_context_destroy(fd, ctx);
>  }
>  
>  igt_main
> @@ -230,11 +239,20 @@ igt_main
>       }
>  
>       igt_subtest("basic-read")
> -             check_workarounds(device, SIMPLE_READ);
> +             check_workarounds(device, SIMPLE_READ, 0);
> +
> +     igt_subtest("basic-read-context")
> +             check_workarounds(device, SIMPLE_READ, CONTEXT);
>  
>       igt_subtest("reset")
> -             check_workarounds(device, GPU_RESET);
> +             check_workarounds(device, GPU_RESET, 0);
> +
> +     igt_subtest("reset-context")
> +             check_workarounds(device, GPU_RESET, CONTEXT);
>  
>       igt_subtest("suspend-resume")
> -             check_workarounds(device, SUSPEND_RESUME);
> +             check_workarounds(device, SUSPEND_RESUME, 0);
> +
> +     igt_subtest("suspend-resume-context")
> +             check_workarounds(device, SUSPEND_RESUME, CONTEXT);
>  }
> -- 
> 2.14.2
>
> _______________________________________________
> Intel-gfx mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to