diff options
author | Rob Clark <[email protected]> | 2015-05-08 15:56:23 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2015-05-18 17:47:54 -0400 |
commit | e6f912f07e729649fb9e9e9a458482925552f778 (patch) | |
tree | f3dbb7d643fc128336394aa104a977b9c47ebc02 /src/gallium/drivers/freedreno | |
parent | 8427ad91252d22db6dbd45ae37c6d5a18de8fc68 (diff) |
freedreno: fence fix
A fence can outlive the ctx, so we shouldn't deref the ctx to get at the
screen. We need some updates in libdrm_freedreno API to completely
handle fences properly, but this is at least an improvement.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_fence.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_fence.c b/src/gallium/drivers/freedreno/freedreno_fence.c index 46b057d9062..375e58f7022 100644 --- a/src/gallium/drivers/freedreno/freedreno_fence.c +++ b/src/gallium/drivers/freedreno/freedreno_fence.c @@ -35,6 +35,7 @@ struct pipe_fence_handle { struct pipe_reference reference; struct fd_context *ctx; + struct fd_screen *screen; uint32_t timestamp; }; @@ -68,7 +69,7 @@ boolean fd_screen_fence_finish(struct pipe_screen *screen, struct pipe_fence_handle *fence, uint64_t timeout) { - if (fd_pipe_wait(fence->ctx->screen->pipe, fence->timestamp)) + if (fd_pipe_wait(fence->screen->pipe, fence->timestamp)) return false; return true; @@ -86,6 +87,7 @@ struct pipe_fence_handle * fd_fence_create(struct pipe_context *pctx) pipe_reference_init(&fence->reference, 1); fence->ctx = ctx; + fence->screen = ctx->screen; fence->timestamp = fd_ringbuffer_timestamp(ctx->ring); return fence; |