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.
This commit is contained in:
@@ -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++],
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user