[Mesa-dev] [PATCH] mesa: don't wait in _mesa_ClientWaitSync if timeout is 0
From ARB_sync spec: If the value of timeout is zero, then ClientWaitSync does not block, but simply tests the current state of sync. TIMEOUT_EXPIRED will be returned in this case if sync is not signaled, even though no actual wait was performed. Fixes random fails of the arb_sync-timeout-zero piglit test on r600g. Signed-off-by: Vadim Girlin vadimgir...@gmail.com --- src/mesa/main/syncobj.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index e1a5c6c..9f5a27e 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -326,9 +326,13 @@ _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) if (syncObj-StatusFlag) { ret = GL_ALREADY_SIGNALED; } else { - ctx-Driver.ClientWaitSync(ctx, syncObj, flags, timeout); + if (timeout == 0) { + ret = GL_TIMEOUT_EXPIRED; + } else { + ctx-Driver.ClientWaitSync(ctx, syncObj, flags, timeout); - ret = syncObj-StatusFlag ? GL_CONDITION_SATISFIED : GL_TIMEOUT_EXPIRED; + ret = syncObj-StatusFlag ? GL_CONDITION_SATISFIED : GL_TIMEOUT_EXPIRED; + } } _mesa_unref_sync_object(ctx, syncObj); -- 1.7.11.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: don't wait in _mesa_ClientWaitSync if timeout is 0
Vadim Girlin vadimgir...@gmail.com writes: From ARB_sync spec: If the value of timeout is zero, then ClientWaitSync does not block, but simply tests the current state of sync. TIMEOUT_EXPIRED will be returned in this case if sync is not signaled, even though no actual wait was performed. Fixes random fails of the arb_sync-timeout-zero piglit test on r600g. We had similar failures. Thanks! Reviewed-by: Eric Anholt e...@anholt.net pgpkLK7STHsOn.pgp Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: don't wait in _mesa_ClientWaitSync if timeout is 0
On 08/31/2012 02:53 PM, Eric Anholt wrote: Vadim Girlinvadimgir...@gmail.com writes: From ARB_sync spec: If the value oftimeout is zero, then ClientWaitSync does not block, but simply tests the current state ofsync. TIMEOUT_EXPIRED will be returned in this case ifsync is not signaled, even though no actual wait was performed. Fixes random fails of the arb_sync-timeout-zero piglit test on r600g. We had similar failures. Thanks! Reviewed-by: Eric Anholte...@anholt.net Candidate for the 9.0 (and 8.0?) branches? -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: don't wait in _mesa_ClientWaitSync if timeout is 0
On Fri, 2012-08-31 at 15:50 -0600, Brian Paul wrote: On 08/31/2012 02:53 PM, Eric Anholt wrote: Vadim Girlinvadimgir...@gmail.com writes: From ARB_sync spec: If the value oftimeout is zero, then ClientWaitSync does not block, but simply tests the current state ofsync. TIMEOUT_EXPIRED will be returned in this case ifsync is not signaled, even though no actual wait was performed. Fixes random fails of the arb_sync-timeout-zero piglit test on r600g. We had similar failures. Thanks! Reviewed-by: Eric Anholte...@anholt.net Candidate for the 9.0 (and 8.0?) branches? Probably yes, but I forget to mention it in the commit message. On the other hand, I think it doesn't fix anything besides that test. Vadim -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] mesa: don't wait in _mesa_ClientWaitSync if timeout is 0
On 08/31/2012 01:37 PM, Vadim Girlin wrote: From ARB_sync spec: If the value of timeout is zero, then ClientWaitSync does not block, but simply tests the current state of sync. TIMEOUT_EXPIRED will be returned in this case if sync is not signaled, even though no actual wait was performed. Fixes random fails of the arb_sync-timeout-zero piglit test on r600g. Signed-off-by: Vadim Girlin vadimgir...@gmail.com --- src/mesa/main/syncobj.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) Hooray! I kept meaning to look into this, but never got to it. Thanks for fixing it. Reviewed-by: Kenneth Graunke kenn...@whitecape.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev