if (state == SVGA3D_QUERYSTATE_PENDING) {
if (!wait)
return FALSE;
- sws->fence_finish(sws, sq->fence, SVGA_FENCE_FLAG_QUERY);
+ sws->fence_finish(sws, sq->fence, PIPE_TIMEOUT_INFINITE,
+ SVGA_FENCE_FLAG_QUERY);
state = sq->queryResult->state;
}
queryState == SVGA3D_QUERYSTATE_NEW) {
if (!wait)
return FALSE;
- sws->fence_finish(sws, sq->fence, SVGA_FENCE_FLAG_QUERY);
+ sws->fence_finish(sws, sq->fence, PIPE_TIMEOUT_INFINITE,
+ SVGA_FENCE_FLAG_QUERY);
sws->query_get_result(sws, sq->gb_query, sq->offset, &queryState, result, resultLen);
}
if ((mode == PIPE_RENDER_COND_WAIT ||
mode == PIPE_RENDER_COND_BY_REGION_WAIT) && sq->fence) {
- sws->fence_finish(sws, sq->fence, SVGA_FENCE_FLAG_QUERY);
+ sws->fence_finish(sws, sq->fence, PIPE_TIMEOUT_INFINITE,
+ SVGA_FENCE_FLAG_QUERY);
}
}
/*
if (transfer == SVGA3D_READ_HOST_VRAM) {
svga_context_flush(svga, &fence);
- sws->fence_finish(sws, fence, 0);
+ sws->fence_finish(sws, fence, PIPE_TIMEOUT_INFINITE, 0);
sws->fence_reference(sws, &fence, NULL);
}
}
if (transfer == SVGA3D_READ_HOST_VRAM) {
svga_context_flush(svga, &fence);
- sws->fence_finish(sws, fence, 0);
+ sws->fence_finish(sws, fence, PIPE_TIMEOUT_INFINITE, 0);
hw = sws->buffer_map(sws, st->hwbuf, PIPE_TRANSFER_READ);
assert(hw);
SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "%s fence_ptr %p\n",
__FUNCTION__, fence);
- retVal = sws->fence_finish(sws, fence, 0) == 0;
+ retVal = sws->fence_finish(sws, fence, timeout, 0) == 0;
}
SVGA_STATS_TIME_POP(sws);
/**
* Wait for the fence to finish.
+ * \param timeout in nanoseconds (may be PIPE_TIMEOUT_INFINITE).
+ * 0 to return immediately, if the API suports it.
* \param flags driver-specific meaning
* \return zero on success.
*/
int (*fence_finish)( struct svga_winsys_screen *sws,
struct pipe_fence_handle *fence,
+ uint64_t timeout,
unsigned flag );
*
* @vws: Pointer to the winsys screen.
* @fence: Handle to the fence object.
+ * @timeout: How long to wait before timing out.
* @flag: Fence flags to wait for. If the fence object can't signal
* a flag, it is assumed to be already signaled.
*
int
vmw_fence_finish(struct vmw_winsys_screen *vws,
struct pipe_fence_handle *fence,
+ uint64_t timeout,
unsigned flag)
{
struct vmw_fence *vfence;
{
struct vmw_winsys_screen *vws = vmw_fence_ops(ops)->vws;
- return vmw_fence_finish(vws, fence, flag);
+ return vmw_fence_finish(vws, fence, PIPE_TIMEOUT_INFINITE, flag);
}
int
vmw_fence_finish(struct vmw_winsys_screen *vws,
struct pipe_fence_handle *fence,
+ uint64_t timeout,
unsigned flag);
int
vmw_fence_signalled(struct vmw_winsys_screen *vws,
static int
vmw_svga_winsys_fence_finish(struct svga_winsys_screen *sws,
struct pipe_fence_handle *fence,
+ uint64_t timeout,
unsigned flag)
{
struct vmw_winsys_screen *vws = vmw_winsys_screen(sws);
- return vmw_fence_finish(vws, fence, flag);
+ return vmw_fence_finish(vws, fence, timeout, flag);
}