[igt-dev] [PATCH i-g-t] lib/gt: Make use of dummyload library to create recursive batch

Antonio Argenziano antonio.argenziano at intel.com
Fri Jul 13 18:22:41 UTC 2018



On 13/07/18 03:06, Chris Wilson wrote:
> From: Antonio Argenziano <antonio.argenziano at intel.com>
> 
> An hanging batch is nothing more than a spinning batch that never gets
> stopped, so re-use the routines implemented in dummyload.c.
> 
> v2: Let caller decide spin loop size
> v3: Only use loose loops for hangs (Chris)
> v4: No requires
> v5: Free the spinner
> v6: Chamelium exists.
> 
> Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---

>   /**
> @@ -377,11 +329,11 @@ igt_hang_t igt_hang_ring(int fd, int ring)
>    */
>   void igt_post_hang_ring(int fd, igt_hang_t arg)
>   {
> -	if (arg.handle == 0)
> +	if (!arg.spin)
>   		return;
>   
> -	gem_sync(fd, arg.handle);
> -	gem_close(fd, arg.handle);
> +	gem_sync(fd, arg.spin->handle); /* Wait until it hangs */

I was expecting a poll spinner + manual reset here.

> +	igt_spin_batch_free(fd, arg.spin);
>   
>   	context_set_ban(fd, arg.ctx, arg.ban);
>   
> diff --git a/lib/igt_gt.h b/lib/igt_gt.h

> +
> +#define igt_list_for_each_safe(pos, tmp, head, member)			\

(nitpick) extra tab.

> +	for (pos = igt_list_first_entry(head, pos, member),		\
> +	     tmp = igt_list_next_entry(pos, member);			\

I trust you and the compiler got all the places that needed changing.

Reviewed-by: Antonio Argenziano <antonio.argenziano at intel.com>

Thanks for picking-up this. At my speed it would have taken years :).


More information about the igt-dev mailing list