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 <robclark@freedesktop.org>
struct pipe_fence_handle {
struct pipe_reference reference;
struct fd_context *ctx;
+ struct fd_screen *screen;
uint32_t timestamp;
};
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;
pipe_reference_init(&fence->reference, 1);
fence->ctx = ctx;
+ fence->screen = ctx->screen;
fence->timestamp = fd_ringbuffer_timestamp(ctx->ring);
return fence;