[i-g-t,2/2] tests/i915/gem_exec_parallel:Set engine map to default context
diff mbox series

Message ID 20200124121759.22308-2-tvrtko.ursulin@linux.intel.com
State New
Headers show
Series
  • [i-g-t,1/2] lib/i915: Add helper for copying engine maps from one context to another
Related show

Commit Message

Tvrtko Ursulin Jan. 24, 2020, 12:17 p.m. UTC
From: Sreedhar Telukuntla <sreedhar.telukuntla@intel.com>

Set the potential engine map of the parent client's default
context to the newly created DRM client's default context.
Without doing so there is a mismatch between the intended
and actual engine used by the *-fds subtests.

v2: Fix FDS flags check

Tvrtko:
v3: Use new helper gem_context_copy_engines.

Signed-off-by: Sreedhar Telukuntla <sreedhar.telukuntla@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/i915/gem_exec_parallel.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Chris Wilson Jan. 24, 2020, 12:25 p.m. UTC | #1
Quoting Tvrtko Ursulin (2020-01-24 12:17:59)
> From: Sreedhar Telukuntla <sreedhar.telukuntla@intel.com>
> 
> Set the potential engine map of the parent client's default
> context to the newly created DRM client's default context.
> Without doing so there is a mismatch between the intended
> and actual engine used by the *-fds subtests.
> 
> v2: Fix FDS flags check
> 
> Tvrtko:
> v3: Use new helper gem_context_copy_engines.
> 
> Signed-off-by: Sreedhar Telukuntla <sreedhar.telukuntla@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  tests/i915/gem_exec_parallel.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c
> index cfbe78070873..0d4d6c6283e0 100644
> --- a/tests/i915/gem_exec_parallel.c
> +++ b/tests/i915/gem_exec_parallel.c
> @@ -83,10 +83,12 @@ static void *thread(void *data)
>                 pthread_cond_wait(t->cond, t->mutex);
>         pthread_mutex_unlock(t->mutex);
>  
> -       if (t->flags & FDS)
> +       if (t->flags & FDS) {
>                 fd = drm_open_driver(DRIVER_INTEL);
> -       else
> +               gem_context_copy_engines(t->fd, 0, fd, 0);

Makes sense,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

Patch
diff mbox series

diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c
index cfbe78070873..0d4d6c6283e0 100644
--- a/tests/i915/gem_exec_parallel.c
+++ b/tests/i915/gem_exec_parallel.c
@@ -83,10 +83,12 @@  static void *thread(void *data)
 		pthread_cond_wait(t->cond, t->mutex);
 	pthread_mutex_unlock(t->mutex);
 
-	if (t->flags & FDS)
+	if (t->flags & FDS) {
 		fd = drm_open_driver(DRIVER_INTEL);
-	else
+		gem_context_copy_engines(t->fd, 0, fd, 0);
+	} else {
 		fd = t->fd;
+	}
 
 	i = 0;
 	batch[i] = MI_STORE_DWORD_IMM | (t->gen < 6 ? 1 << 22 : 0);