[igt-dev] [PATCH i-g-t v5 1/1] tests/i915/gem_ctx_persistence: Set context with supported engines

Chris Wilson chris at chris-wilson.co.uk
Wed Jan 29 15:57:00 UTC 2020


Quoting Bommu Krishnaiah (2020-01-29 15:24:27)
> -static void test_process_mixed(int i915, unsigned int engine)
> +static void test_process_mixed(int pfd, unsigned int engine)
>  {
>         int fence[2], sv[2];
> +       int i915;

This is local to the child, best given local scope.

>         /*
>          * If a process dies early, any nonpersistent contexts it had
> @@ -565,14 +566,15 @@ static void test_process_mixed(int i915, unsigned int engine)
>         igt_require(socketpair(AF_UNIX, SOCK_DGRAM, 0, sv) == 0);
>  
>         igt_fork(child, 1) {
> -               i915 = gem_reopen_driver(i915);
> +               i915 = gem_reopen_driver(pfd);
>                 gem_quiescent_gpu(i915);
>  
>                 for (int persists = 0; persists <= 1; persists++) {
>                         igt_spin_t *spin;
>                         uint32_t ctx;
>  
> -                       ctx = gem_context_create(i915);
> +                       ctx = gem_context_clone_with_engines(i915, 0);
No point cloning from the wrong context, 

> +                       gem_context_copy_engines(pfd, 0, i915, ctx);
when you copy across the engines[] anyway.

>                         gem_context_set_persistence(i915, ctx, persists);


More information about the igt-dev mailing list