diff options
author | Marek Olšák <[email protected]> | 2018-07-05 18:15:31 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-07-06 16:23:37 -0400 |
commit | 0eaf069679ccf86de6739d5eaa439db075f02903 (patch) | |
tree | 093d24c6b9fc11e7009bdab49f51321fefe67588 /src/gallium | |
parent | b39bdb07164211c483a3c8a8625689169be09cc4 (diff) |
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]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/dri/dri_helpers.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 @@ -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); } |