[Mesa-dev] [PATCH 2/3] llvmpipe: correctly handle waiting in llvmpipe_fence_finish
Emil Velikov
emil.l.velikov at gmail.com
Thu Apr 11 16:05:57 UTC 2019
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.
Cc: Roland Scheidegger <sroland at vmware.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
src/gallium/drivers/llvmpipe/lp_screen.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index b55b4a3c4fe..3aa8b9fbcc9 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -636,7 +636,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;
}
--
2.20.1
More information about the mesa-dev
mailing list