Module: Mesa
Branch: master
Commit: 0eaf069679ccf86de6739d5eaa439db075f02903
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0eaf069679ccf86de6739d5eaa439db075f02903

Author: Marek Olšák <[email protected]>
Date:   Thu Jul  5 18:15:31 2018 -0400

st/dri: fix a crash in server_wait_sync

Ported from i965 including the comment.

This fixes:
    dEQP-EGL.functional.reusable_sync.valid.wait_server

Cc: 18.1 <[email protected]>
Reviewed-by: Michel Dänzer <[email protected]>

---

 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 f1501bfb81..5d42873a20 100644
--- a/src/gallium/state_trackers/dri/dri_helpers.c
+++ b/src/gallium/state_trackers/dri/dri_helpers.c
@@ -214,6 +214,12 @@ 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);
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to