Module: Mesa
Branch: master
Commit: fd7a14f8ddeae5fc868a8d452445d708505cc930
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd7a14f8ddeae5fc868a8d452445d708505cc930

Author: Rob Clark <[email protected]>
Date:   Sun Aug 16 19:18:22 2015 -0400

freedreno: fence fix

Don't take current timestamp/fence from current ring, as we might have
already rolled over to new rb.

Signed-off-by: Rob Clark <[email protected]>

---

 src/gallium/drivers/freedreno/freedreno_context.c |    4 +++-
 src/gallium/drivers/freedreno/freedreno_fence.c   |    5 +++--
 src/gallium/drivers/freedreno/freedreno_fence.h   |    3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_context.c 
b/src/gallium/drivers/freedreno/freedreno_context.c
index 8e6d431..0b6b9fb 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -131,11 +131,13 @@ static void
 fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
                unsigned flags)
 {
+       struct fd_ringbuffer *ring = fd_context(pctx)->ring;
+
        fd_context_render(pctx);
 
        if (fence) {
                fd_screen_fence_ref(pctx->screen, fence, NULL);
-               *fence = fd_fence_create(pctx);
+               *fence = fd_fence_create(pctx, fd_ringbuffer_timestamp(ring));
        }
 }
 
diff --git a/src/gallium/drivers/freedreno/freedreno_fence.c 
b/src/gallium/drivers/freedreno/freedreno_fence.c
index 04a9fea..337359c 100644
--- a/src/gallium/drivers/freedreno/freedreno_fence.c
+++ b/src/gallium/drivers/freedreno/freedreno_fence.c
@@ -78,7 +78,8 @@ boolean fd_screen_fence_finish(struct pipe_screen *screen,
        return true;
 }
 
-struct pipe_fence_handle * fd_fence_create(struct pipe_context *pctx)
+struct pipe_fence_handle * fd_fence_create(struct pipe_context *pctx,
+               uint32_t timestamp)
 {
        struct pipe_fence_handle *fence;
        struct fd_context *ctx = fd_context(pctx);
@@ -91,7 +92,7 @@ struct pipe_fence_handle * fd_fence_create(struct 
pipe_context *pctx)
 
        fence->ctx = ctx;
        fence->screen = ctx->screen;
-       fence->timestamp = fd_ringbuffer_timestamp(ctx->ring);
+       fence->timestamp = timestamp;
 
        return fence;
 }
diff --git a/src/gallium/drivers/freedreno/freedreno_fence.h 
b/src/gallium/drivers/freedreno/freedreno_fence.h
index e36bcc4..9bb3e21 100644
--- a/src/gallium/drivers/freedreno/freedreno_fence.h
+++ b/src/gallium/drivers/freedreno/freedreno_fence.h
@@ -39,6 +39,7 @@ boolean fd_screen_fence_signalled(struct pipe_screen *screen,
 boolean fd_screen_fence_finish(struct pipe_screen *screen,
                struct pipe_fence_handle *pfence,
                uint64_t timeout);
-struct pipe_fence_handle * fd_fence_create(struct pipe_context *pctx);
+struct pipe_fence_handle * fd_fence_create(struct pipe_context *pctx,
+               uint32_t timestamp);
 
 #endif /* FREEDRENO_FENCE_H_ */

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to