diff options
29 files changed, 71 insertions, 36 deletions
diff --git a/src/gallium/auxiliary/util/u_simple_screen.h b/src/gallium/auxiliary/util/u_simple_screen.h index 7139aaabc56..7caeb75cd27 100644 --- a/src/gallium/auxiliary/util/u_simple_screen.h +++ b/src/gallium/auxiliary/util/u_simple_screen.h @@ -159,7 +159,8 @@ struct pipe_winsys */ int (*fence_finish)( struct pipe_winsys *ws, struct pipe_fence_handle *fence, - unsigned flag ); + unsigned flags, + uint64_t timeout ); }; diff --git a/src/gallium/drivers/cell/ppu/cell_fence.c b/src/gallium/drivers/cell/ppu/cell_fence.c index e7c9fc46d9f..3014a8a7b84 100644 --- a/src/gallium/drivers/cell/ppu/cell_fence.c +++ b/src/gallium/drivers/cell/ppu/cell_fence.c @@ -47,7 +47,8 @@ cell_fence_init(struct cell_fence *fence) boolean cell_fence_signalled(const struct cell_context *cell, - const struct cell_fence *fence) + const struct cell_fence *fence, + unsigned flags) { uint i; for (i = 0; i < cell->num_spus; i++) { @@ -61,7 +62,9 @@ cell_fence_signalled(const struct cell_context *cell, void cell_fence_finish(const struct cell_context *cell, - const struct cell_fence *fence) + const struct cell_fence *fence, + unsigned flags, + uint64_t timeout) { while (!cell_fence_signalled(cell, fence)) { usleep(10); diff --git a/src/gallium/drivers/cell/ppu/cell_fence.h b/src/gallium/drivers/cell/ppu/cell_fence.h index 536b4ba411a..3ef6cf7bbca 100644 --- a/src/gallium/drivers/cell/ppu/cell_fence.h +++ b/src/gallium/drivers/cell/ppu/cell_fence.h @@ -36,12 +36,15 @@ cell_fence_init(struct cell_fence *fence); extern boolean cell_fence_signalled(const struct cell_context *cell, - const struct cell_fence *fence); + const struct cell_fence *fence, + unsigned flags); extern void cell_fence_finish(const struct cell_context *cell, - const struct cell_fence *fence); + const struct cell_fence *fence, + unsigned flags, + uint64_t timeout); diff --git a/src/gallium/drivers/galahad/glhd_screen.c b/src/gallium/drivers/galahad/glhd_screen.c index b4825bef66d..fbe19bf324b 100644 --- a/src/gallium/drivers/galahad/glhd_screen.c +++ b/src/gallium/drivers/galahad/glhd_screen.c @@ -292,14 +292,16 @@ galahad_screen_fence_signalled(struct pipe_screen *_screen, static int galahad_screen_fence_finish(struct pipe_screen *_screen, struct pipe_fence_handle *fence, - unsigned flags) + unsigned flags, + uint64_t timeout) { struct galahad_screen *glhd_screen = galahad_screen(_screen); struct pipe_screen *screen = glhd_screen->screen; return screen->fence_finish(screen, fence, - flags); + flags, + timeout); } struct pipe_screen * diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index 64c4bbab399..39f65f8c8fd 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -331,7 +331,8 @@ i915_fence_signalled(struct pipe_screen *screen, static int i915_fence_finish(struct pipe_screen *screen, struct pipe_fence_handle *fence, - unsigned flags) + unsigned flags, + uint64_t timeout) { struct i915_screen *is = i915_screen(screen); diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c index bf805fd080c..367581a6b41 100644 --- a/src/gallium/drivers/i965/brw_screen.c +++ b/src/gallium/drivers/i965/brw_screen.c @@ -376,7 +376,8 @@ brw_fence_signalled(struct pipe_screen *screen, static int brw_fence_finish(struct pipe_screen *screen, struct pipe_fence_handle *fence, - unsigned flags) + unsigned flags, + uint64_t timeout) { return 0; } diff --git a/src/gallium/drivers/identity/id_screen.c b/src/gallium/drivers/identity/id_screen.c index 644481bb748..b289c1e5d17 100644 --- a/src/gallium/drivers/identity/id_screen.c +++ b/src/gallium/drivers/identity/id_screen.c @@ -258,14 +258,16 @@ identity_screen_fence_signalled(struct pipe_screen *_screen, static int identity_screen_fence_finish(struct pipe_screen *_screen, struct pipe_fence_handle *fence, - unsigned flags) + unsigned flags, + uint64_t timeout) { struct identity_screen *id_screen = identity_screen(_screen); struct pipe_screen *screen = id_screen->screen; return screen->fence_finish(screen, fence, - flags); + flags, + timeout); } struct pipe_screen * diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c index 849db06acdf..6118164b20b 100644 --- a/src/gallium/drivers/llvmpipe/lp_flush.c +++ b/src/gallium/drivers/llvmpipe/lp_flush.c @@ -92,7 +92,7 @@ llvmpipe_finish( struct pipe_context *pipe, struct pipe_fence_handle *fence = NULL; llvmpipe_flush(pipe, 0, &fence, reason); if (fence) { - pipe->screen->fence_finish(pipe->screen, fence, 0); + pipe->screen->fence_finish(pipe->screen, fence, 0, PIPE_TIMEOUT_INFINITE); pipe->screen->fence_reference(pipe->screen, &fence, NULL); } } diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index edcfbfcfac1..c600144a2da 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -365,7 +365,8 @@ llvmpipe_fence_signalled(struct pipe_screen *screen, static int llvmpipe_fence_finish(struct pipe_screen *screen, struct pipe_fence_handle *fence_handle, - unsigned flag) + unsigned flag, + uint64_t timeout) { struct lp_fence *f = (struct lp_fence *) fence_handle; diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index e6cd3064c9a..3111bef7a22 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -165,7 +165,8 @@ nouveau_screen_fence_signalled(struct pipe_screen *screen, static int nouveau_screen_fence_finish(struct pipe_screen *screen, struct pipe_fence_handle *pfence, - unsigned flags) + unsigned flags, + uint64_t timeout) { return !nouveau_fence_wait(nouveau_fence(pfence)); } diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 2c7bca86277..18ed0356cae 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -434,7 +434,8 @@ static int r300_fence_signalled(struct pipe_screen *screen, static int r300_fence_finish(struct pipe_screen *screen, struct pipe_fence_handle *fence, - unsigned flags) + unsigned flags, + uint64_t timeout) { struct r300_winsys_screen *rws = r300_screen(screen)->rws; struct r300_winsys_bo *rfence = (struct r300_winsys_bo*)fence; diff --git a/src/gallium/drivers/rbug/rbug_screen.c b/src/gallium/drivers/rbug/rbug_screen.c index d635ce575c0..d8d23bcb9c5 100644 --- a/src/gallium/drivers/rbug/rbug_screen.c +++ b/src/gallium/drivers/rbug/rbug_screen.c @@ -256,14 +256,16 @@ rbug_screen_fence_signalled(struct pipe_screen *_screen, static int rbug_screen_fence_finish(struct pipe_screen *_screen, struct pipe_fence_handle *fence, - unsigned flags) + unsigned flags, + uint64_t timeout) { struct rbug_screen *rb_screen = rbug_screen(_screen); struct pipe_screen *screen = rb_screen->screen; return screen->fence_finish(screen, fence, - flags); + flags, + timeout); } boolean diff --git a/src/gallium/drivers/softpipe/sp_fence.c b/src/gallium/drivers/softpipe/sp_fence.c index 66c52141132..40d0b5970ef 100644 --- a/src/gallium/drivers/softpipe/sp_fence.c +++ b/src/gallium/drivers/softpipe/sp_fence.c @@ -54,7 +54,8 @@ softpipe_fence_signalled(struct pipe_screen *screen, static int softpipe_fence_finish(struct pipe_screen *screen, struct pipe_fence_handle *fence, - unsigned flags) + unsigned flags, + uint64_t timeout) { assert(!fence); return 0; diff --git a/src/gallium/drivers/softpipe/sp_flush.c b/src/gallium/drivers/softpipe/sp_flush.c index 6f7addd441a..00a2fafdfa2 100644 --- a/src/gallium/drivers/softpipe/sp_flush.c +++ b/src/gallium/drivers/softpipe/sp_flush.c @@ -162,7 +162,8 @@ softpipe_flush_resource(struct pipe_context *pipe, * This is for illustrative purposes only, as softpipe does not * have fences. */ - pipe->screen->fence_finish(pipe->screen, fence, 0); + pipe->screen->fence_finish(pipe->screen, fence, 0, + PIPE_TIMEOUT_INFINITE); pipe->screen->fence_reference(pipe->screen, &fence, NULL); } } else { diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c index f0f875b2b23..e64dc94b9d8 100644 --- a/src/gallium/drivers/svga/svga_context.c +++ b/src/gallium/drivers/svga/svga_context.c @@ -241,7 +241,8 @@ void svga_context_flush( struct svga_context *svga, if (SVGA_DEBUG & DEBUG_SYNC) { if (fence) - svga->pipe.screen->fence_finish( svga->pipe.screen, fence, 0); + svga->pipe.screen->fence_finish( svga->pipe.screen, fence, 0, + PIPE_TIMEOUT_INFINITE); } if(pfence) diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index ef1d3098d51..f4029c7e363 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -425,7 +425,8 @@ svga_fence_signalled(struct pipe_screen *screen, static int svga_fence_finish(struct pipe_screen *screen, struct pipe_fence_handle *fence, - unsigned flag) + unsigned flag, + uint64_t timeout) { struct svga_winsys_screen *sws = svga_screen(screen)->sws; diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index 7cfaab060f1..17f87cb906c 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -421,7 +421,8 @@ trace_screen_fence_signalled(struct pipe_screen *_screen, static int trace_screen_fence_finish(struct pipe_screen *_screen, struct pipe_fence_handle *fence, - unsigned flags) + unsigned flags, + uint64_t timeout) { struct trace_screen *tr_scr = trace_screen(_screen); struct pipe_screen *screen = tr_scr->screen; @@ -432,8 +433,9 @@ trace_screen_fence_finish(struct pipe_screen *_screen, trace_dump_arg(ptr, screen); trace_dump_arg(ptr, fence); trace_dump_arg(uint, flags); + trace_dump_arg(uint, timeout); - result = screen->fence_finish(screen, fence, flags); + result = screen->fence_finish(screen, fence, flags, timeout); trace_dump_ret(int, result); diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index edbaaae334a..9350a755d73 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -426,6 +426,8 @@ enum pipe_transfer_usage { #define PIPE_SWIZZLE_ONE 5 +#define PIPE_TIMEOUT_INFINITE 0xffffffffffffffffull + /** * Implementation capabilities/limits which are queried through * pipe_screen::get_param() and pipe_screen::get_paramf(). diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 850eb84a3c8..8e77e77db39 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -193,11 +193,13 @@ struct pipe_screen { /** * Wait for the fence to finish. * \param flags driver-specific meaning + * \param timeout in nanoseconds * \return zero on success. */ int (*fence_finish)( struct pipe_screen *screen, struct pipe_fence_handle *fence, - unsigned flags ); + unsigned flags, + uint64_t timeout ); }; diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c b/src/gallium/state_trackers/egl/common/egl_g3d_api.c index 2068256dff2..61619886c3d 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c @@ -689,7 +689,7 @@ egl_g3d_wait_client(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx) gctx->stctxi->flush(gctx->stctxi, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence); if (fence) { - screen->fence_finish(screen, fence, 0); + screen->fence_finish(screen, fence, 0, PIPE_TIMEOUT_INFINITE); screen->fence_reference(screen, &fence, NULL); } diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_sync.c b/src/gallium/state_trackers/egl/common/egl_g3d_sync.c index 4e6d944c151..020c696238f 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d_sync.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d_sync.c @@ -109,7 +109,7 @@ egl_g3d_wait_fence_sync(struct egl_g3d_sync *gsync, EGLTimeKHR timeout) _eglUnlockMutex(&dpy->Mutex); /* no timed finish? */ - screen->fence_finish(screen, fence, 0x0); + screen->fence_finish(screen, fence, 0x0, PIPE_TIMEOUT_INFINITE); ret = EGL_CONDITION_SATISFIED_KHR; _eglLockMutex(&dpy->Mutex); diff --git a/src/gallium/state_trackers/egl/common/native_helper.c b/src/gallium/state_trackers/egl/common/native_helper.c index be6713d03a8..aaccee3e1d1 100644 --- a/src/gallium/state_trackers/egl/common/native_helper.c +++ b/src/gallium/state_trackers/egl/common/native_helper.c @@ -333,7 +333,7 @@ resource_surface_throttle(struct resource_surface *rsurf) struct pipe_fence_handle *fence = swap_fences_pop_front(rsurf); if (fence) { - (void) screen->fence_finish(screen, fence, 0); + (void) screen->fence_finish(screen, fence, 0, PIPE_TIMEOUT_INFINITE); screen->fence_reference(screen, &fence, NULL); return TRUE; } diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 7c47a25ceba..506d6ecda8e 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -1227,7 +1227,8 @@ void XMesaFlush( XMesaContext c ) c->st->flush(c->st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence); if (fence) { - xmdpy->screen->fence_finish(xmdpy->screen, fence, 0); + xmdpy->screen->fence_finish(xmdpy->screen, fence, 0, + PIPE_TIMEOUT_INFINITE); xmdpy->screen->fence_reference(xmdpy->screen, &fence, NULL); } XFlush( c->xm_visual->display ); diff --git a/src/gallium/state_trackers/vega/api_context.c b/src/gallium/state_trackers/vega/api_context.c index d6bbda5e075..5fba56fd211 100644 --- a/src/gallium/state_trackers/vega/api_context.c +++ b/src/gallium/state_trackers/vega/api_context.c @@ -74,7 +74,8 @@ void vegaFinish(void) pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence); if (fence) { - pipe->screen->fence_finish(pipe->screen, fence, 0); + pipe->screen->fence_finish(pipe->screen, fence, 0, + PIPE_TIMEOUT_INFINITE); pipe->screen->fence_reference(pipe->screen, &fence, NULL); } } diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index 17c34b7eac8..6fc3e6514cd 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -362,7 +362,8 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion, if (extents->x1 == 0 && extents->y1 == 0 && extents->x2 == pDraw->width && extents->y2 == pDraw->height) { - ms->screen->fence_finish(ms->screen, dst_priv->fence, 0); + ms->screen->fence_finish(ms->screen, dst_priv->fence, 0, + PIPE_TIMEOUT_INFINITE); ms->screen->fence_reference(ms->screen, &dst_priv->fence, NULL); } } diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 33bcacdcc2e..9c890ff0866 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -334,7 +334,8 @@ drv_cleanup_fences(ScrnInfoPtr pScrn) for (i = 0; i < XORG_NR_FENCES; i++) { if (ms->fence[i]) { - ms->screen->fence_finish(ms->screen, ms->fence[i], 0); + ms->screen->fence_finish(ms->screen, ms->fence[i], 0, + PIPE_TIMEOUT_INFINITE); ms->screen->fence_reference(ms->screen, &ms->fence[i], NULL); } } @@ -555,7 +556,8 @@ void xorg_flush(ScreenPtr pScreen) if (ms->dirtyThrottling) { if (ms->fence[0]) ms->ctx->screen->fence_finish(ms->ctx->screen, - ms->fence[0], 0); + ms->fence[0], 0, + PIPE_TIMEOUT_INFINITE); /* The amount of rendering generated by a block handler can be * quite small. Let us get a fair way ahead of hardware before diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 718a3453939..38d67d1b0b8 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -1084,7 +1084,8 @@ void xorg_exa_finish(struct exa_context *exa) xorg_exa_flush(exa, PIPE_FLUSH_RENDER_CACHE, &fence); - exa->pipe->screen->fence_finish(exa->pipe->screen, fence, 0); + exa->pipe->screen->fence_finish(exa->pipe->screen, fence, 0, + PIPE_TIMEOUT_INFINITE); exa->pipe->screen->fence_reference(exa->pipe->screen, &fence, NULL); } diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c index 5a2343d3aec..35ab00f6d01 100644 --- a/src/mesa/state_tracker/st_cb_flush.c +++ b/src/mesa/state_tracker/st_cb_flush.c @@ -103,7 +103,8 @@ void st_finish( struct st_context *st ) st_flush(st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence); if(fence) { - st->pipe->screen->fence_finish(st->pipe->screen, fence, 0); + st->pipe->screen->fence_finish(st->pipe->screen, fence, 0, + PIPE_TIMEOUT_INFINITE); st->pipe->screen->fence_reference(st->pipe->screen, &fence, NULL); } } diff --git a/src/mesa/state_tracker/st_cb_syncobj.c b/src/mesa/state_tracker/st_cb_syncobj.c index 69a8678a7c0..85aad08cc70 100644 --- a/src/mesa/state_tracker/st_cb_syncobj.c +++ b/src/mesa/state_tracker/st_cb_syncobj.c @@ -96,8 +96,8 @@ static void st_client_wait_sync(struct gl_context *ctx, /* We don't care about GL_SYNC_FLUSH_COMMANDS_BIT, because flush is * already called when creating a fence. */ - if (so->fence) { - screen->fence_finish(screen, so->fence, 0); + if (so->fence && + screen->fence_finish(screen, so->fence, 0, timeout) == 0) { screen->fence_reference(screen, &so->fence, NULL); so->b.StatusFlag = GL_TRUE; } |