diff mbox

[igt,12/24] igt/gem_ringfill: Prime execbuf before measuring ring size

Message ID 20170814201848.28216-12-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Aug. 14, 2017, 8:18 p.m. UTC
Make sure that our buffers are ready and loaded to reduce the initial
stall.
---
 tests/gem_ringfill.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Michał Winiarski Aug. 21, 2017, 12:54 p.m. UTC | #1
On Mon, Aug 14, 2017 at 09:18:36PM +0100, Chris Wilson wrote:
> Make sure that our buffers are ready and loaded to reduce the initial
> stall.

Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>

Already looked at this one before:
https://lists.freedesktop.org/archives/intel-gfx/2017-July/134344.html
(as well as couple of other patches in this series)

-Michał

> ---
>  tests/gem_ringfill.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
> index b52996a4..01cbd0a9 100644
> --- a/tests/gem_ringfill.c
> +++ b/tests/gem_ringfill.c
> @@ -288,10 +288,15 @@ static unsigned int measure_ring_size(int fd)
>  	obj[1].handle = gem_create(fd, 4096);
>  	gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
>  
> +	memset(&execbuf, 0, sizeof(execbuf));
> +	execbuf.buffers_ptr = to_user_pointer(obj + 1);
> +	execbuf.buffer_count = 1;
> +	gem_execbuf(fd, &execbuf);
> +	gem_sync(fd, obj[1].handle);
> +
>  	plug(fd, &c);
>  	obj[0].handle = c.handle;
>  
> -	memset(&execbuf, 0, sizeof(execbuf));
>  	execbuf.buffers_ptr = to_user_pointer(obj);
>  	execbuf.buffer_count = 2;
>  
> @@ -302,7 +307,8 @@ static unsigned int measure_ring_size(int fd)
>  	itv.it_value.tv_usec = 1000;
>  	setitimer(ITIMER_REAL, &itv, NULL);
>  
> -	last = count = 0;
> +	last = -1;
> +	count = 0;
>  	do {
>  		if (__execbuf(fd, &execbuf) == 0) {
>  			count++;
> -- 
> 2.13.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index b52996a4..01cbd0a9 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -288,10 +288,15 @@  static unsigned int measure_ring_size(int fd)
 	obj[1].handle = gem_create(fd, 4096);
 	gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
 
+	memset(&execbuf, 0, sizeof(execbuf));
+	execbuf.buffers_ptr = to_user_pointer(obj + 1);
+	execbuf.buffer_count = 1;
+	gem_execbuf(fd, &execbuf);
+	gem_sync(fd, obj[1].handle);
+
 	plug(fd, &c);
 	obj[0].handle = c.handle;
 
-	memset(&execbuf, 0, sizeof(execbuf));
 	execbuf.buffers_ptr = to_user_pointer(obj);
 	execbuf.buffer_count = 2;
 
@@ -302,7 +307,8 @@  static unsigned int measure_ring_size(int fd)
 	itv.it_value.tv_usec = 1000;
 	setitimer(ITIMER_REAL, &itv, NULL);
 
-	last = count = 0;
+	last = -1;
+	count = 0;
 	do {
 		if (__execbuf(fd, &execbuf) == 0) {
 			count++;