util/u_queue: handle OS_TIMEOUT_INFINITE in util_queue_fence_wait_timeout
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 10 Nov 2017 09:40:41 +0000 (10:40 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 10 Nov 2017 15:37:47 +0000 (16:37 +0100)
Fixes e.g. piglit/bin/bufferstorage-persistent read -auto

Fixes: e6dbc804a87a ("winsys/amdgpu: handle cs_add_fence_dependency for deferred/unsubmitted fences")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/util/u_queue.h

index ec028157480a7e614c419eae7a5059b5e6586fe7..57753bd31bca8f3ac102ba39d2dd326a1883691c 100644 (file)
@@ -38,6 +38,7 @@
 #include "util/futex.h"
 #include "util/list.h"
 #include "util/macros.h"
+#include "util/os_time.h"
 #include "util/u_atomic.h"
 #include "util/u_thread.h"
 
@@ -179,6 +180,11 @@ util_queue_fence_wait_timeout(struct util_queue_fence *fence,
    if (util_queue_fence_is_signalled(fence))
       return true;
 
+   if (abs_timeout == (int64_t)OS_TIMEOUT_INFINITE) {
+      _util_queue_fence_wait(fence);
+      return true;
+   }
+
    return _util_queue_fence_wait_timeout(fence, abs_timeout);
 }