Ported from i965 including the comment.
This fixes:
dEQP-EGL.functional.reusable_sync.valid.wait_server
Cc: 18.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
struct pipe_context *ctx = dri_context(_ctx)->st->pipe;
struct dri2_fence *fence = (struct dri2_fence*)_fence;
+ /* We might be called here with a NULL fence as a result of WaitSyncKHR
+ * on a EGL_KHR_reusable_sync fence. Nothing to do here in such case.
+ */
+ if (!fence)
+ return;
+
if (ctx->fence_server_sync)
ctx->fence_server_sync(ctx, fence->pipe_fence);
}