From 3b1ac8244ec5aecf703110f8191058f3299b72af Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 7 Feb 2019 09:40:00 -0800 Subject: [PATCH] iris: Add a timeout_nsec parameter, rename check_syncpt to wait_syncpt I want to be able to wait with a non-zero timeout from elsewhere. --- src/gallium/drivers/iris/iris_fence.c | 8 +++++--- src/gallium/drivers/iris/iris_fence.h | 5 +++-- src/gallium/drivers/iris/iris_query.c | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/iris/iris_fence.c b/src/gallium/drivers/iris/iris_fence.c index b050090675f..06452f70966 100644 --- a/src/gallium/drivers/iris/iris_fence.c +++ b/src/gallium/drivers/iris/iris_fence.c @@ -139,8 +139,9 @@ iris_fence_reference(struct pipe_screen *p_screen, } bool -iris_check_syncpt(struct pipe_screen *p_screen, - struct iris_syncpt *syncpt) +iris_wait_syncpt(struct pipe_screen *p_screen, + struct iris_syncpt *syncpt, + int64_t timeout_nsec) { if (!syncpt) return false; @@ -149,6 +150,7 @@ iris_check_syncpt(struct pipe_screen *p_screen, struct drm_syncobj_wait args = { .handles = (uintptr_t)&syncpt->handle, .count_handles = 1, + .timeout_nsec = timeout_nsec, }; return drm_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_WAIT, &args); } @@ -175,7 +177,7 @@ iris_fence_flush(struct pipe_context *ctx, pipe_reference_init(&fence->ref, 1); for (unsigned b = 0; b < IRIS_BATCH_COUNT; b++) { - if (!iris_check_syncpt(ctx->screen, ice->batches[b].last_syncpt)) + if (!iris_wait_syncpt(ctx->screen, ice->batches[b].last_syncpt, 0)) continue; iris_syncpt_reference(screen, &fence->syncpt[fence->count++], diff --git a/src/gallium/drivers/iris/iris_fence.h b/src/gallium/drivers/iris/iris_fence.h index 056db864f26..f14940fdc53 100644 --- a/src/gallium/drivers/iris/iris_fence.h +++ b/src/gallium/drivers/iris/iris_fence.h @@ -41,8 +41,9 @@ void iris_syncpt_destroy(struct iris_screen *, struct iris_syncpt *); void iris_batch_add_syncpt(struct iris_batch *batch, struct iris_syncpt *syncpt, unsigned flags); -bool iris_check_syncpt(struct pipe_screen *screen, - struct iris_syncpt *syncpt); +bool iris_wait_syncpt(struct pipe_screen *screen, + struct iris_syncpt *syncpt, + int64_t timeout_nsec); static inline void iris_syncpt_reference(struct iris_screen *screen, struct iris_syncpt **dst, diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index 2e6cc34c534..6e8062f3b4e 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -876,7 +876,7 @@ iris_get_query_result(struct pipe_context *ctx, while (!q->map->snapshots_landed) { if (wait) - iris_check_syncpt(ctx->screen, q->syncpt); + iris_wait_syncpt(ctx->screen, q->syncpt, 0); else return false; } -- 2.30.2