[Mesa-dev] [PATCH] st/dri: fix a crash in server_wait_Sync
Marek Olšák
maraeo at gmail.com
Thu Jul 5 22:15:31 UTC 2018
From: Marek Olšák <marek.olsak at amd.com>
Ported from i965 including the comment.
This fixes:
dEQP-EGL.functional.reusable_sync.valid.wait_server
Cc: 18.1 <mesa-stable at lists.freedesktop.org>
---
src/gallium/state_trackers/dri/dri_helpers.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/gallium/state_trackers/dri/dri_helpers.c b/src/gallium/state_trackers/dri/dri_helpers.c
index f1501bfb815..5d42873a208 100644
--- a/src/gallium/state_trackers/dri/dri_helpers.c
+++ b/src/gallium/state_trackers/dri/dri_helpers.c
@@ -207,20 +207,26 @@ dri2_client_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags,
return false;
}
}
static void
dri2_server_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags)
{
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);
}
const __DRI2fenceExtension dri2FenceExtension = {
.base = { __DRI2_FENCE, 2 },
.create_fence = dri2_create_fence,
.get_fence_from_cl_event = dri2_get_fence_from_cl_event,
.destroy_fence = dri2_destroy_fence,
--
2.17.1
More information about the mesa-dev
mailing list