[Piglit] [PATCH] ext_timer_query/time-elapsed: Prevent infinite loop.

Brian Paul brianp at vmware.com
Thu Apr 3 08:57:54 PDT 2014


On 04/03/2014 08:20 AM, jfonseca at vmware.com wrote:
> From: José Fonseca <jfonseca at vmware.com>
>
> When testing with llvmpipe, somehow the draw() function is returning
> constant elapsed time of 0.000222 approximately, regardless how big
> iters is.
>
> This is probably a bug in llvmpipe, but it seems a good idea to fix the
> test to prevent integer overflow and the consequent infinite loop in the
> test regardless.
> ---
>   tests/spec/ext_timer_query/time-elapsed.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/tests/spec/ext_timer_query/time-elapsed.c b/tests/spec/ext_timer_query/time-elapsed.c
> index e0da672..64c2d67 100644
> --- a/tests/spec/ext_timer_query/time-elapsed.c
> +++ b/tests/spec/ext_timer_query/time-elapsed.c
> @@ -213,6 +213,10 @@ retry:
>   	for (iters = 1; ; iters *= 2) {
>   		if (draw(q, iters) > 0.1)
>   			break;
> +		if (iters * 2 <= iters) {
> +			printf("Couldn't find appropriate number of iterations\n");
> +			piglit_report_result(PIGLIT_FAIL);
> +		}
>   	}
>
>   	/* Now, do several runs like this so we can determine if the
>

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the Piglit mailing list