st/dri: don't use _ctx in client_wait_sync
authorMarek Olšák <marek.olsak@amd.com>
Fri, 25 Sep 2015 20:44:41 +0000 (22:44 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 3 Oct 2015 20:06:08 +0000 (22:06 +0200)
Not needed and it can be NULL.

v2: fix dri2_get_fence_from_cl_event - thanks Albert

Cc: 10.6 11.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Albert Freeman <albertwdfreeman@gmail.com>
src/gallium/state_trackers/dri/dri2.c

index 91b443147d64a4f65209a97eec579abbf7570e46..712203b9db9b18bd4933d965a03d0ff3b3b7b400 100644 (file)
@@ -1293,6 +1293,7 @@ dri2_load_opencl_interop(struct dri_screen *screen)
 }
 
 struct dri2_fence {
+   struct dri_screen *driscreen;
    struct pipe_fence_handle *pipe_fence;
    void *cl_event;
 };
@@ -1313,6 +1314,7 @@ dri2_create_fence(__DRIcontext *_ctx)
       return NULL;
    }
 
+   fence->driscreen = dri_screen(_ctx->driScreenPriv);
    return fence;
 }
 
@@ -1336,6 +1338,7 @@ dri2_get_fence_from_cl_event(__DRIscreen *_screen, intptr_t cl_event)
       return NULL;
    }
 
+   fence->driscreen = driscreen;
    return fence;
 }
 
@@ -1360,9 +1363,9 @@ static GLboolean
 dri2_client_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags,
                       uint64_t timeout)
 {
-   struct dri_screen *driscreen = dri_screen(_ctx->driScreenPriv);
-   struct pipe_screen *screen = driscreen->base.screen;
    struct dri2_fence *fence = (struct dri2_fence*)_fence;
+   struct dri_screen *driscreen = fence->driscreen;
+   struct pipe_screen *screen = driscreen->base.screen;
 
    /* No need to flush. The context was flushed when the fence was created. */