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 <robclark@freedesktop.org>
This commit is contained in:
Rob Clark
2015-08-16 19:18:22 -04:00
parent 885762e182
commit fd7a14f8dd
3 changed files with 8 additions and 4 deletions

View File

@@ -131,11 +131,13 @@ static void
fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence, fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
unsigned flags) unsigned flags)
{ {
struct fd_ringbuffer *ring = fd_context(pctx)->ring;
fd_context_render(pctx); fd_context_render(pctx);
if (fence) { if (fence) {
fd_screen_fence_ref(pctx->screen, fence, NULL); fd_screen_fence_ref(pctx->screen, fence, NULL);
*fence = fd_fence_create(pctx); *fence = fd_fence_create(pctx, fd_ringbuffer_timestamp(ring));
} }
} }

View File

@@ -78,7 +78,8 @@ boolean fd_screen_fence_finish(struct pipe_screen *screen,
return true; 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 pipe_fence_handle *fence;
struct fd_context *ctx = fd_context(pctx); 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->ctx = ctx;
fence->screen = ctx->screen; fence->screen = ctx->screen;
fence->timestamp = fd_ringbuffer_timestamp(ctx->ring); fence->timestamp = timestamp;
return fence; return fence;
} }

View File

@@ -39,6 +39,7 @@ boolean fd_screen_fence_signalled(struct pipe_screen *screen,
boolean fd_screen_fence_finish(struct pipe_screen *screen, boolean fd_screen_fence_finish(struct pipe_screen *screen,
struct pipe_fence_handle *pfence, struct pipe_fence_handle *pfence,
uint64_t timeout); 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_ */ #endif /* FREEDRENO_FENCE_H_ */