[Mesa-dev] [PATCH 2/5] gallium: handle fence_finish timeout in various drivers
Marek Olšák
maraeo at gmail.com
Fri Jun 26 11:22:15 PDT 2015
From: Marek Olšák <marek.olsak at amd.com>
I copied what fence_signalled does.
---
src/gallium/drivers/freedreno/freedreno_fence.c | 3 +++
src/gallium/drivers/i915/i915_screen.c | 3 +++
src/gallium/drivers/llvmpipe/lp_screen.c | 3 +++
src/gallium/drivers/nouveau/nouveau_screen.c | 3 +++
src/gallium/drivers/svga/svga_screen.c | 3 +++
5 files changed, 15 insertions(+)
diff --git a/src/gallium/drivers/freedreno/freedreno_fence.c b/src/gallium/drivers/freedreno/freedreno_fence.c
index 375e58f..04a9fea 100644
--- a/src/gallium/drivers/freedreno/freedreno_fence.c
+++ b/src/gallium/drivers/freedreno/freedreno_fence.c
@@ -69,6 +69,9 @@ boolean fd_screen_fence_finish(struct pipe_screen *screen,
struct pipe_fence_handle *fence,
uint64_t timeout)
{
+ if (!timeout)
+ return fd_screen_fence_signalled(screen, fence);
+
if (fd_pipe_wait(fence->screen->pipe, fence->timestamp))
return false;
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index 0590da0..10508ce 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -478,6 +478,9 @@ i915_fence_finish(struct pipe_screen *screen,
{
struct i915_screen *is = i915_screen(screen);
+ if (!timeout)
+ return is->iws->fence_signalled(is->iws, fence) == 1;
+
return is->iws->fence_finish(is->iws, fence) == 1;
}
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 47f1897..d3392e7 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -550,6 +550,9 @@ llvmpipe_fence_finish(struct pipe_screen *screen,
{
struct lp_fence *f = (struct lp_fence *) fence_handle;
+ if (!timeout)
+ return lp_fence_signalled(f);
+
lp_fence_wait(f);
return TRUE;
}
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index b4f1413..ff1d0e2 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -79,6 +79,9 @@ nouveau_screen_fence_finish(struct pipe_screen *screen,
struct pipe_fence_handle *pfence,
uint64_t timeout)
{
+ if (!timeout)
+ return nouveau_fence_signalled(nouveau_fence(pfence));
+
return nouveau_fence_wait(nouveau_fence(pfence));
}
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 56e4867..9ba157e 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -558,6 +558,9 @@ svga_fence_finish(struct pipe_screen *screen,
{
struct svga_winsys_screen *sws = svga_screen(screen)->sws;
+ if (!timeout)
+ return sws->fence_signalled(sws, fence, 0) == 0;
+
SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "%s fence_ptr %p\n",
__FUNCTION__, fence);
--
2.1.0
More information about the mesa-dev
mailing list