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

Marek Olšák maraeo at gmail.com
Fri Nov 10 12:51:22 UTC 2017


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Fri, Nov 10, 2017 at 10:41 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> 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
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list