All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/gem_exec_basic: Quiesce GPU before returning from test
@ 2018-06-11 20:58 Antonio Argenziano
  2018-06-11 21:06 ` Chris Wilson
  2018-06-11 21:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/gem_exec_basic: Quiesce GPU before returning from test (rev2) Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: Antonio Argenziano @ 2018-06-11 20:58 UTC (permalink / raw)
  To: igt-dev

All subtests send a workload to the engines and then return without
waiting on it, while this is not a problem because the test targets the
API, it makes the hang detector pointless since the driver will declare
an hang long after the test has completed.

Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_exec_basic.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/gem_exec_basic.c b/tests/gem_exec_basic.c
index 2f057ef0..473c2e8e 100644
--- a/tests/gem_exec_basic.c
+++ b/tests/gem_exec_basic.c
@@ -42,7 +42,9 @@ static void noop(int fd, unsigned ring)
 	execbuf.buffer_count = 1;
 	execbuf.flags = ring;
 	gem_execbuf(fd, &execbuf);
+
 	gem_close(fd, exec.handle);
+	gem_quiescent_gpu(fd);
 }
 
 static void readonly(int fd, unsigned ring)
@@ -66,8 +68,10 @@ static void readonly(int fd, unsigned ring)
 	igt_assert(mprotect(execbuf, 4096, PROT_READ) == 0);
 
 	gem_execbuf(fd, execbuf);
+
 	munmap(execbuf, 4096);
 	gem_close(fd, exec.handle);
+	gem_quiescent_gpu(fd);
 }
 
 static void gtt(int fd, unsigned ring)
@@ -94,9 +98,11 @@ static void gtt(int fd, unsigned ring)
 	execbuf->flags = ring;
 
 	gem_execbuf(fd, execbuf);
-	gem_close(fd, exec->handle);
 
+	gem_close(fd, exec->handle);
 	munmap(execbuf, 4096);
+
+	gem_quiescent_gpu(fd);
 }
 
 igt_main
-- 
2.16.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] tests/gem_exec_basic: Quiesce GPU before returning from test
  2018-06-11 20:58 [igt-dev] [PATCH i-g-t] tests/gem_exec_basic: Quiesce GPU before returning from test Antonio Argenziano
@ 2018-06-11 21:06 ` Chris Wilson
  2018-06-11 21:20   ` Antonio Argenziano
  2018-06-11 21:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/gem_exec_basic: Quiesce GPU before returning from test (rev2) Patchwork
  1 sibling, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2018-06-11 21:06 UTC (permalink / raw)
  To: Antonio Argenziano, igt-dev

Quoting Antonio Argenziano (2018-06-11 21:58:36)
> All subtests send a workload to the engines and then return without
> waiting on it, while this is not a problem because the test targets the
> API, it makes the hang detector pointless since the driver will declare
> an hang long after the test has completed.
> 
> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/gem_exec_basic.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/gem_exec_basic.c b/tests/gem_exec_basic.c
> index 2f057ef0..473c2e8e 100644
> --- a/tests/gem_exec_basic.c
> +++ b/tests/gem_exec_basic.c
> @@ -42,7 +42,9 @@ static void noop(int fd, unsigned ring)
>         execbuf.buffer_count = 1;
>         execbuf.flags = ring;
>         gem_execbuf(fd, &execbuf);
> +
>         gem_close(fd, exec.handle);
> +       gem_quiescent_gpu(fd);
>  }
>  
>  static void readonly(int fd, unsigned ring)
> @@ -66,8 +68,10 @@ static void readonly(int fd, unsigned ring)
>         igt_assert(mprotect(execbuf, 4096, PROT_READ) == 0);
>  
>         gem_execbuf(fd, execbuf);
> +
>         munmap(execbuf, 4096);
>         gem_close(fd, exec.handle);
> +       gem_quiescent_gpu(fd);
>  }
>  
>  static void gtt(int fd, unsigned ring)
> @@ -94,9 +98,11 @@ static void gtt(int fd, unsigned ring)
>         execbuf->flags = ring;
>  
>         gem_execbuf(fd, execbuf);
> -       gem_close(fd, exec->handle);
>  
> +       gem_close(fd, exec->handle);
>         munmap(execbuf, 4096);
> +
> +       gem_quiescent_gpu(fd);
>  }

As you are there, maybe
diff --git a/tests/gem_exec_basic.c b/tests/gem_exec_basic.c
index 2f057ef..b1b9081 100644
--- a/tests/gem_exec_basic.c
+++ b/tests/gem_exec_basic.c
@@ -25,37 +25,51 @@
 
 IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl rings.");
 
+static uint32_t batch_create(int fd)
+{
+       const uint32_t bbe = MI_BATCH_BUFFER_END;
+       uint32_t handle;
+
+       handle = gem_create(fd, 4096);
+       gem_write(fd, handle, 0, &bbe, sizeof(bbe));
+
+       return handle;
+}
+
+static void batch_fini(int fd, uint32_t handle)
+{
+       gem_sync(fd, handle); /* catch any GPU hang */
+       gem_close(fd, handle);
+}
+
 static void noop(int fd, unsigned ring)
 {
-       uint32_t bbe = MI_BATCH_BUFFER_END;
        struct drm_i915_gem_execbuffer2 execbuf;
        struct drm_i915_gem_exec_object2 exec;
 
        gem_require_ring(fd, ring);
 
        memset(&exec, 0, sizeof(exec));
-       exec.handle = gem_create(fd, 4096);
-       gem_write(fd, exec.handle, 0, &bbe, sizeof(bbe));
+       exec.handle = batch_create(fd);
 
        memset(&execbuf, 0, sizeof(execbuf));
        execbuf.buffers_ptr = to_user_pointer(&exec);
        execbuf.buffer_count = 1;
        execbuf.flags = ring;
        gem_execbuf(fd, &execbuf);
-       gem_close(fd, exec.handle);
+
+       batch_fini(fd, exec.handle);
 }
 
 static void readonly(int fd, unsigned ring)
 {
-       uint32_t bbe = MI_BATCH_BUFFER_END;
        struct drm_i915_gem_execbuffer2 *execbuf;
        struct drm_i915_gem_exec_object2 exec;
 
        gem_require_ring(fd, ring);
 
        memset(&exec, 0, sizeof(exec));
-       exec.handle = gem_create(fd, 4096);
-       gem_write(fd, exec.handle, 0, &bbe, sizeof(bbe));
+       exec.handle = batch_create(fd);
 
        execbuf = mmap(NULL, 4096, PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
        igt_assert(execbuf != NULL);
@@ -67,12 +81,12 @@ static void readonly(int fd, unsigned ring)
 
        gem_execbuf(fd, execbuf);
        munmap(execbuf, 4096);
-       gem_close(fd, exec.handle);
+
+       batch_fini(fd, exec.handle);
 }
 
 static void gtt(int fd, unsigned ring)
 {
-       uint32_t bbe = MI_BATCH_BUFFER_END;
        struct drm_i915_gem_execbuffer2 *execbuf;
        struct drm_i915_gem_exec_object2 *exec;
        uint32_t handle;
@@ -86,15 +100,15 @@ static void gtt(int fd, unsigned ring)
        exec = (struct drm_i915_gem_exec_object2 *)(execbuf + 1);
        gem_close(fd, handle);
 
-       exec->handle = gem_create(fd, 4096);
-       gem_write(fd, exec->handle, 0, &bbe, sizeof(bbe));
+       exec->handle = batch_create(fd);
 
        execbuf->buffers_ptr = to_user_pointer(exec);
        execbuf->buffer_count = 1;
        execbuf->flags = ring;
 
        gem_execbuf(fd, execbuf);
-       gem_close(fd, exec->handle);
+
+       batch_fini(fd, exec->handle);
 
        munmap(execbuf, 4096);
 }

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [igt-dev] [PATCH i-g-t] tests/gem_exec_basic: Quiesce GPU before returning from test
  2018-06-11 21:06 ` Chris Wilson
@ 2018-06-11 21:20   ` Antonio Argenziano
  0 siblings, 0 replies; 4+ messages in thread
From: Antonio Argenziano @ 2018-06-11 21:20 UTC (permalink / raw)
  To: Chris Wilson, igt-dev



On 11/06/18 14:06, Chris Wilson wrote:
> Quoting Antonio Argenziano (2018-06-11 21:58:36)
>> All subtests send a workload to the engines and then return without
>> waiting on it, while this is not a problem because the test targets the
>> API, it makes the hang detector pointless since the driver will declare
>> an hang long after the test has completed.
>>
>> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> ---
>>   tests/gem_exec_basic.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/gem_exec_basic.c b/tests/gem_exec_basic.c
>> index 2f057ef0..473c2e8e 100644
>> --- a/tests/gem_exec_basic.c
>> +++ b/tests/gem_exec_basic.c
>> @@ -42,7 +42,9 @@ static void noop(int fd, unsigned ring)
>>          execbuf.buffer_count = 1;
>>          execbuf.flags = ring;
>>          gem_execbuf(fd, &execbuf);
>> +
>>          gem_close(fd, exec.handle);
>> +       gem_quiescent_gpu(fd);
>>   }
>>   
>>   static void readonly(int fd, unsigned ring)
>> @@ -66,8 +68,10 @@ static void readonly(int fd, unsigned ring)
>>          igt_assert(mprotect(execbuf, 4096, PROT_READ) == 0);
>>   
>>          gem_execbuf(fd, execbuf);
>> +
>>          munmap(execbuf, 4096);
>>          gem_close(fd, exec.handle);
>> +       gem_quiescent_gpu(fd);
>>   }
>>   
>>   static void gtt(int fd, unsigned ring)
>> @@ -94,9 +98,11 @@ static void gtt(int fd, unsigned ring)
>>          execbuf->flags = ring;
>>   
>>          gem_execbuf(fd, execbuf);
>> -       gem_close(fd, exec->handle);
>>   
>> +       gem_close(fd, exec->handle);
>>          munmap(execbuf, 4096);
>> +
>> +       gem_quiescent_gpu(fd);
>>   }
> 
> As you are there, maybe

Sounds good, be right back with v2.

Thanks,
Antonio

> diff --git a/tests/gem_exec_basic.c b/tests/gem_exec_basic.c
> index 2f057ef..b1b9081 100644
> --- a/tests/gem_exec_basic.c
> +++ b/tests/gem_exec_basic.c
> @@ -25,37 +25,51 @@
>   
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/gem_exec_basic: Quiesce GPU before returning from test (rev2)
  2018-06-11 20:58 [igt-dev] [PATCH i-g-t] tests/gem_exec_basic: Quiesce GPU before returning from test Antonio Argenziano
  2018-06-11 21:06 ` Chris Wilson
@ 2018-06-11 21:28 ` Patchwork
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-06-11 21:28 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: tests/gem_exec_basic: Quiesce GPU before returning from test (rev2)
URL   : https://patchwork.freedesktop.org/series/44590/
State : failure

== Summary ==

Applying: tests/gem_exec_basic: Quiesce GPU before returning from test
Using index info to reconstruct a base tree...
Patch failed at 0001 tests/gem_exec_basic: Quiesce GPU before returning from test
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-11 21:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-11 20:58 [igt-dev] [PATCH i-g-t] tests/gem_exec_basic: Quiesce GPU before returning from test Antonio Argenziano
2018-06-11 21:06 ` Chris Wilson
2018-06-11 21:20   ` Antonio Argenziano
2018-06-11 21:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/gem_exec_basic: Quiesce GPU before returning from test (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.