Re: [igt-dev] [PATCH i-g-t] i915/gem_softpin: Limit the noreloc test runtime

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 28, 2020 at 10:12:36AM +0000, Chris Wilson wrote:
> Use a fixed duration rather than a fixed amount of work.
> 
> Closes: https://gitlab.freedesktop.org/drm/intel/issues/1325
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>


Reviewed-by: Petri Latvala <petri.latvala@xxxxxxxxx>

> ---
>  tests/i915/gem_softpin.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
> index 2c258f443..98c7ab63b 100644
> --- a/tests/i915/gem_softpin.c
> +++ b/tests/i915/gem_softpin.c
> @@ -442,7 +442,7 @@ static void test_noreloc(int fd, enum sleep sleep)
>  	uint64_t offset;
>  	uint32_t handle;
>  	uint32_t *batch, *b;
> -	int i, loop;
> +	int i, loop = 0;
>  
>  	handle = gem_create(fd, (ARRAY_SIZE(object)+1)*size);
>  	gem_write(fd, handle, 0, &bbe, sizeof(bbe));
> @@ -494,11 +494,11 @@ static void test_noreloc(int fd, enum sleep sleep)
>  	munmap(batch, size);
>  
>  	execbuf.buffer_count = ARRAY_SIZE(object);
> -	for (loop = 0; loop < 1024; loop++) {
> +	igt_until_timeout(5) {
>  		igt_permute_array(object, ARRAY_SIZE(object)-1, xchg_offset);
>  		gem_execbuf(fd, &execbuf);
>  
> -		if ((loop & 127) == 0) {
> +		if ((loop++ & 127) == 0) {
>  			switch (sleep) {
>  			case NOSLEEP:
>  				break;
> -- 
> 2.25.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux