summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-07-09 13:18:34 -0700
committerEric Anholt <[email protected]>2018-07-20 11:11:29 -0700
commitfc28692a5af22754818e2eda20409f9502daa088 (patch)
treeb7cbee471bf38a410e0c24bb78929b245bd4dccf
parent4f04bd68cfefea55c0fcddee74b46c5f8c905202 (diff)
v3d: Fix the timeout value passed to drmSyncobjWait().
The API wants an absolute time, so we need to go add gallium's argument to CLOCK_MONOTONIC.
-rw-r--r--src/gallium/drivers/v3d/v3d_fence.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/v3d/v3d_fence.c b/src/gallium/drivers/v3d/v3d_fence.c
index 850e4a74414..f07ea17b0d3 100644
--- a/src/gallium/drivers/v3d/v3d_fence.c
+++ b/src/gallium/drivers/v3d/v3d_fence.c
@@ -35,6 +35,7 @@
*/
#include "util/u_inlines.h"
+#include "util/os_time.h"
#include "v3d_context.h"
#include "v3d_bufmgr.h"
@@ -70,7 +71,11 @@ v3d_fence_finish(struct pipe_screen *pscreen,
struct v3d_screen *screen = v3d_screen(pscreen);
struct v3d_fence *f = (struct v3d_fence *)pf;
- return drmSyncobjWait(screen->fd, &f->sync, 1, timeout_ns, 0, NULL) >= 0;
+ uint64_t abs_timeout = os_time_get_absolute_timeout(timeout_ns);
+ if (abs_timeout == OS_TIMEOUT_INFINITE)
+ abs_timeout = INT64_MAX;
+ return drmSyncobjWait(screen->fd, &f->sync, 1, abs_timeout,
+ 0, NULL) >= 0;
}
struct v3d_fence *