summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2019-04-25 18:42:03 +0100
committerEmil Velikov <[email protected]>2019-04-26 11:26:33 +0100
commit591955d82d8d9fd752b900b9bdc0c17085d55560 (patch)
treeb2db4b8530887a6e970732fc818fce4b1986fb8c
parent5b284fe6bc0a2a5c2d9e5da09a5b86ff8912e474 (diff)
llvmpipe: correctly handle waiting in llvmpipe_fence_finish
Currently if the timeout differs from 0, we'll end up with infinite wait... even if the user is perfectly clear they don't want that. Use the new lp_fence_timedwait() helper guarding both waits in an !lp_fence_signalled block like the rest of llvmpipe. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
-rw-r--r--src/gallium/drivers/llvmpipe/lp_screen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 8426427e397..510346d2abf 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -637,7 +637,12 @@ llvmpipe_fence_finish(struct pipe_screen *screen,
if (!timeout)
return lp_fence_signalled(f);
- lp_fence_wait(f);
+ if (!lp_fence_signalled(f)) {
+ if (timeout != PIPE_TIMEOUT_INFINITE)
+ return lp_fence_timedwait(f, timeout);
+
+ lp_fence_wait(f);
+ }
return TRUE;
}