[Mesa-dev] [PATCH] util/u_queue: handle OS_TIMEOUT_INFINITE in util_queue_fence_wait_timeout

Nicolai Hähnle nhaehnle at gmail.com
Fri Nov 10 09:41:31 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Fixes e.g. piglit/bin/bufferstorage-persistent read -auto

Fixes: e6dbc804a87a ("winsys/amdgpu: handle cs_add_fence_dependency for deferred/unsubmitted fences")
---
 src/util/u_queue.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/util/u_queue.h b/src/util/u_queue.h
index ec028157480..57753bd31bc 100644
--- a/src/util/u_queue.h
+++ b/src/util/u_queue.h
@@ -31,20 +31,21 @@
  */
 
 #ifndef U_QUEUE_H
 #define U_QUEUE_H
 
 #include <string.h>
 
 #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"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 #define UTIL_QUEUE_INIT_USE_MINIMUM_PRIORITY      (1 << 0)
 #define UTIL_QUEUE_INIT_RESIZE_IF_FULL            (1 << 1)
 
@@ -172,20 +173,25 @@ _util_queue_fence_wait_timeout(struct util_queue_fence *fence,
  *
  * \return true if the fence was signaled, false if the timeout occurred.
  */
 static inline bool
 util_queue_fence_wait_timeout(struct util_queue_fence *fence,
                               int64_t abs_timeout)
 {
    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);
 }
 
 typedef void (*util_queue_execute_func)(void *job, int thread_index);
 
 struct util_queue_job {
    void *job;
    struct util_queue_fence *fence;
    util_queue_execute_func execute;
    util_queue_execute_func cleanup;
-- 
2.11.0



More information about the mesa-dev mailing list