<div dir="ltr">Ping.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 8, 2017 at 3:25 PM, Gurchetan Singh <span dir="ltr"><<a href="mailto:gurchetansingh@chromium.org" target="_blank">gurchetansingh@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Use the same fence implementation for drisw.c as dri2.c by making<br>
</span>dri2FenceExtension an external variable. Since the fence implementation<br>
is not dri2.c specific, put it in a separate file. This is desirable for<br>
synchronization in virtual machines.<br>
<br>
v2: Don't depend on dri2.c for extensions (Emil)<br>
---<br>
 src/gallium/state_trackers/<wbr>dri/Makefile.sources |   2 +<br>
 src/gallium/state_trackers/<wbr>dri/dri2.c           | 203 +--------------------<br>
 src/gallium/state_trackers/<wbr>dri/dri_extensions.c | 229 ++++++++++++++++++++++++<br>
 src/gallium/state_trackers/<wbr>dri/dri_extensions.h |  30 ++++<br>
 src/gallium/state_trackers/<wbr>dri/drisw.c          |   2 +<br>
 5 files changed, 264 insertions(+), 202 deletions(-)<br>
 create mode 100644 src/gallium/state_trackers/<wbr>dri/dri_extensions.c<br>
 create mode 100644 src/gallium/state_trackers/<wbr>dri/dri_extensions.h<br>
<br>
diff --git a/src/gallium/state_trackers/<wbr>dri/Makefile.sources b/src/gallium/state_trackers/<wbr>dri/Makefile.sources<br>
index 52d60ac928..46da886c00 100644<br>
--- a/src/gallium/state_trackers/<wbr>dri/Makefile.sources<br>
+++ b/src/gallium/state_trackers/<wbr>dri/Makefile.sources<br>
@@ -3,6 +3,8 @@ common_SOURCES := \<br>
        dri_context.h \<br>
        dri_drawable.c \<br>
        dri_drawable.h \<br>
+       dri_extensions.c \<br>
+       dri_extensions.h \<br>
        dri_query_renderer.c \<br>
        dri_query_renderer.h \<br>
        dri_screen.c \<br>
diff --git a/src/gallium/state_trackers/<wbr>dri/dri2.c b/src/gallium/state_trackers/<wbr>dri/dri2.c<br>
index ed6004f836..2d95e668f8 100644<br>
--- a/src/gallium/state_trackers/<wbr>dri/dri2.c<br>
+++ b/src/gallium/state_trackers/<wbr>dri/dri2.c<br>
@@ -49,6 +49,7 @@<br>
 #include "dri_screen.h"<br>
 #include "dri_context.h"<br>
 #include "dri_drawable.h"<br>
+#include "dri_extensions.h"<br>
 #include "dri_query_renderer.h"<br>
 #include "dri2_buffer.h"<br>
<br>
@@ -1415,208 +1416,6 @@ static __DRIimageExtension dri2ImageExtension = {<br>
     .unmapImage                   = dri2_unmap_image,<br>
 };<br>
<br>
-<br>
-static bool<br>
-dri2_is_opencl_interop_<wbr>loaded_locked(struct dri_screen *screen)<br>
-{<br>
-   return screen->opencl_dri_event_add_<wbr>ref &&<br>
-          screen->opencl_dri_event_<wbr>release &&<br>
-          screen->opencl_dri_event_wait &&<br>
-          screen->opencl_dri_event_get_<wbr>fence;<br>
-}<br>
-<br>
-static bool<br>
-dri2_load_opencl_interop(<wbr>struct dri_screen *screen)<br>
-{<br>
-#if defined(RTLD_DEFAULT)<br>
-   bool success;<br>
-<br>
-   mtx_lock(&screen->opencl_func_<wbr>mutex);<br>
-<br>
-   if (dri2_is_opencl_interop_<wbr>loaded_locked(screen)) {<br>
-      mtx_unlock(&screen->opencl_<wbr>func_mutex);<br>
-      return true;<br>
-   }<br>
-<br>
-   screen->opencl_dri_event_add_<wbr>ref =<br>
-      dlsym(RTLD_DEFAULT, "opencl_dri_event_add_ref");<br>
-   screen->opencl_dri_event_<wbr>release =<br>
-      dlsym(RTLD_DEFAULT, "opencl_dri_event_release");<br>
-   screen->opencl_dri_event_wait =<br>
-      dlsym(RTLD_DEFAULT, "opencl_dri_event_wait");<br>
-   screen->opencl_dri_event_get_<wbr>fence =<br>
-      dlsym(RTLD_DEFAULT, "opencl_dri_event_get_fence");<br>
-<br>
-   success = dri2_is_opencl_interop_loaded_<wbr>locked(screen);<br>
-   mtx_unlock(&screen->opencl_<wbr>func_mutex);<br>
-   return success;<br>
-#else<br>
-   return false;<br>
-#endif<br>
-}<br>
-<br>
-struct dri2_fence {<br>
-   struct dri_screen *driscreen;<br>
-   struct pipe_fence_handle *pipe_fence;<br>
-   void *cl_event;<br>
-};<br>
-<br>
-static unsigned dri2_fence_get_caps(__<wbr>DRIscreen *_screen)<br>
-{<br>
-   struct dri_screen *driscreen = dri_screen(_screen);<br>
-   struct pipe_screen *screen = driscreen->base.screen;<br>
-   unsigned caps = 0;<br>
-<br>
-   if (screen->get_param(screen, PIPE_CAP_NATIVE_FENCE_FD))<br>
-      caps |= __DRI_FENCE_CAP_NATIVE_FD;<br>
-<br>
-   return caps;<br>
-}<br>
-<br>
-static void *<br>
-dri2_create_fence(__<wbr>DRIcontext *_ctx)<br>
-{<br>
-   struct pipe_context *ctx = dri_context(_ctx)->st->pipe;<br>
-   struct dri2_fence *fence = CALLOC_STRUCT(dri2_fence);<br>
-<br>
-   if (!fence)<br>
-      return NULL;<br>
-<br>
-   ctx->flush(ctx, &fence->pipe_fence, 0);<br>
-<br>
-   if (!fence->pipe_fence) {<br>
-      FREE(fence);<br>
-      return NULL;<br>
-   }<br>
-<br>
-   fence->driscreen = dri_screen(_ctx-><wbr>driScreenPriv);<br>
-   return fence;<br>
-}<br>
-<br>
-static void *<br>
-dri2_create_fence_fd(__<wbr>DRIcontext *_ctx, int fd)<br>
-{<br>
-   struct pipe_context *ctx = dri_context(_ctx)->st->pipe;<br>
-   struct dri2_fence *fence = CALLOC_STRUCT(dri2_fence);<br>
-<br>
-   if (fd == -1) {<br>
-      /* exporting driver created fence, flush: */<br>
-      ctx->flush(ctx, &fence->pipe_fence,<br>
-                 PIPE_FLUSH_DEFERRED | PIPE_FLUSH_FENCE_FD);<br>
-   } else {<br>
-      /* importing a foreign fence fd: */<br>
-      ctx->create_fence_fd(ctx, &fence->pipe_fence, fd);<br>
-   }<br>
-   if (!fence->pipe_fence) {<br>
-      FREE(fence);<br>
-      return NULL;<br>
-   }<br>
-<br>
-   fence->driscreen = dri_screen(_ctx-><wbr>driScreenPriv);<br>
-   return fence;<br>
-}<br>
-<br>
-static int<br>
-dri2_get_fence_fd(__DRIscreen *_screen, void *_fence)<br>
-{<br>
-   struct dri_screen *driscreen = dri_screen(_screen);<br>
-   struct pipe_screen *screen = driscreen->base.screen;<br>
-   struct dri2_fence *fence = (struct dri2_fence*)_fence;<br>
-<br>
-   return screen->fence_get_fd(screen, fence->pipe_fence);<br>
-}<br>
-<br>
-static void *<br>
-dri2_get_fence_from_cl_event(<wbr>__DRIscreen *_screen, intptr_t cl_event)<br>
-{<br>
-   struct dri_screen *driscreen = dri_screen(_screen);<br>
-   struct dri2_fence *fence;<br>
-<br>
-   if (!dri2_load_opencl_interop(<wbr>driscreen))<br>
-      return NULL;<br>
-<br>
-   fence = CALLOC_STRUCT(dri2_fence);<br>
-   if (!fence)<br>
-      return NULL;<br>
-<br>
-   fence->cl_event = (void*)cl_event;<br>
-<br>
-   if (!driscreen->opencl_dri_event_<wbr>add_ref(fence->cl_event)) {<br>
-      free(fence);<br>
-      return NULL;<br>
-   }<br>
-<br>
-   fence->driscreen = driscreen;<br>
-   return fence;<br>
-}<br>
-<br>
-static void<br>
-dri2_destroy_fence(__<wbr>DRIscreen *_screen, void *_fence)<br>
-{<br>
-   struct dri_screen *driscreen = dri_screen(_screen);<br>
-   struct pipe_screen *screen = driscreen->base.screen;<br>
-   struct dri2_fence *fence = (struct dri2_fence*)_fence;<br>
-<br>
-   if (fence->pipe_fence)<br>
-      screen->fence_reference(<wbr>screen, &fence->pipe_fence, NULL);<br>
-   else if (fence->cl_event)<br>
-      driscreen->opencl_dri_event_<wbr>release(fence->cl_event);<br>
-   else<br>
-      assert(0);<br>
-<br>
-   FREE(fence);<br>
-}<br>
-<br>
-static GLboolean<br>
-dri2_client_wait_sync(__<wbr>DRIcontext *_ctx, void *_fence, unsigned flags,<br>
-                      uint64_t timeout)<br>
-{<br>
-   struct dri2_fence *fence = (struct dri2_fence*)_fence;<br>
-   struct dri_screen *driscreen = fence->driscreen;<br>
-   struct pipe_screen *screen = driscreen->base.screen;<br>
-<br>
-   /* No need to flush. The context was flushed when the fence was created. */<br>
-<br>
-   if (fence->pipe_fence)<br>
-      return screen->fence_finish(screen, NULL, fence->pipe_fence, timeout);<br>
-   else if (fence->cl_event) {<br>
-      struct pipe_fence_handle *pipe_fence =<br>
-         driscreen->opencl_dri_event_<wbr>get_fence(fence->cl_event);<br>
-<br>
-      if (pipe_fence)<br>
-         return screen->fence_finish(screen, NULL, pipe_fence, timeout);<br>
-      else<br>
-         return driscreen->opencl_dri_event_<wbr>wait(fence->cl_event, timeout);<br>
-   }<br>
-   else {<br>
-      assert(0);<br>
-      return false;<br>
-   }<br>
-}<br>
-<br>
-static void<br>
-dri2_server_wait_sync(__<wbr>DRIcontext *_ctx, void *_fence, unsigned flags)<br>
-{<br>
-   struct pipe_context *ctx = dri_context(_ctx)->st->pipe;<br>
-   struct dri2_fence *fence = (struct dri2_fence*)_fence;<br>
-<br>
-   if (ctx->fence_server_sync)<br>
-      ctx->fence_server_sync(ctx, fence->pipe_fence);<br>
-}<br>
-<br>
-static __DRI2fenceExtension dri2FenceExtension = {<br>
-   .base = { __DRI2_FENCE, 2 },<br>
-<br>
-   .create_fence = dri2_create_fence,<br>
-   .get_fence_from_cl_event = dri2_get_fence_from_cl_event,<br>
-   .destroy_fence = dri2_destroy_fence,<br>
-   .client_wait_sync = dri2_client_wait_sync,<br>
-   .server_wait_sync = dri2_server_wait_sync,<br>
-   .get_capabilities = dri2_fence_get_caps,<br>
-   .create_fence_fd = dri2_create_fence_fd,<br>
-   .get_fence_fd = dri2_get_fence_fd,<br>
-};<br>
-<br>
 static const __DRIrobustnessExtension dri2Robustness = {<br>
    .base = { __DRI2_ROBUSTNESS, 1 }<br>
 };<br>
diff --git a/src/gallium/state_trackers/<wbr>dri/dri_extensions.c b/src/gallium/state_trackers/<wbr>dri/dri_extensions.c<br>
new file mode 100644<br>
index 0000000000..2fa7233aab<br>
--- /dev/null<br>
+++ b/src/gallium/state_trackers/<wbr>dri/dri_extensions.c<br>
@@ -0,0 +1,229 @@<br>
+/*<br>
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a<br>
+ * copy of this software and associated documentation files (the "Software"),<br>
+ * to deal in the Software without restriction, including without limitation<br>
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+ * and/or sell copies of the Software, and to permit persons to whom the<br>
+ * Software is furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice shall be included<br>
+ * in all copies or substantial portions of the Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS<br>
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR<br>
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
+ * OTHER DEALINGS IN THE SOFTWARE.<br>
+ */<br>
+<br>
+#include "dri_context.h"<br>
+#include "dri_screen.h"<br>
+#include "pipe/p_screen.h"<br>
+#include "util/u_memory.h"<br>
+<br>
+static bool<br>
+dri2_is_opencl_interop_<wbr>loaded_locked(struct dri_screen *screen)<br>
+{<br>
+   return screen->opencl_dri_event_add_<wbr>ref &&<br>
+          screen->opencl_dri_event_<wbr>release &&<br>
+          screen->opencl_dri_event_wait &&<br>
+          screen->opencl_dri_event_get_<wbr>fence;<br>
+}<br>
+<br>
+static bool<br>
+dri2_load_opencl_interop(<wbr>struct dri_screen *screen)<br>
+{<br>
+#if defined(RTLD_DEFAULT)<br>
+   bool success;<br>
+<br>
+   pipe_mutex_lock(screen-><wbr>opencl_func_mutex);<br>
+<br>
+   if (dri2_is_opencl_interop_<wbr>loaded_locked(screen)) {<br>
+      pipe_mutex_unlock(screen-><wbr>opencl_func_mutex);<br>
+      return true;<br>
+   }<br>
+<br>
+   screen->opencl_dri_event_add_<wbr>ref =<br>
+      dlsym(RTLD_DEFAULT, "opencl_dri_event_add_ref");<br>
+   screen->opencl_dri_event_<wbr>release =<br>
+      dlsym(RTLD_DEFAULT, "opencl_dri_event_release");<br>
+   screen->opencl_dri_event_wait =<br>
+      dlsym(RTLD_DEFAULT, "opencl_dri_event_wait");<br>
+   screen->opencl_dri_event_get_<wbr>fence =<br>
+      dlsym(RTLD_DEFAULT, "opencl_dri_event_get_fence");<br>
+<br>
+   success = dri2_is_opencl_interop_loaded_<wbr>locked(screen);<br>
+   pipe_mutex_unlock(screen-><wbr>opencl_func_mutex);<br>
+   return success;<br>
+#else<br>
+   return false;<br>
+#endif<br>
+}<br>
+<br>
+struct dri2_fence {<br>
+   struct dri_screen *driscreen;<br>
+   struct pipe_fence_handle *pipe_fence;<br>
+   void *cl_event;<br>
+};<br>
+<br>
+static unsigned dri2_fence_get_caps(__<wbr>DRIscreen *_screen)<br>
+{<br>
+   struct dri_screen *driscreen = dri_screen(_screen);<br>
+   struct pipe_screen *screen = driscreen->base.screen;<br>
+   unsigned caps = 0;<br>
+<br>
+   if (screen->get_param(screen, PIPE_CAP_NATIVE_FENCE_FD))<br>
+      caps |= __DRI_FENCE_CAP_NATIVE_FD;<br>
+<br>
+   return caps;<br>
+}<br>
+<br>
+static void *<br>
+dri2_create_fence(__<wbr>DRIcontext *_ctx)<br>
+{<br>
+   struct pipe_context *ctx = dri_context(_ctx)->st->pipe;<br>
+   struct dri2_fence *fence = CALLOC_STRUCT(dri2_fence);<br>
+<br>
+   if (!fence)<br>
+      return NULL;<br>
+<br>
+   ctx->flush(ctx, &fence->pipe_fence, 0);<br>
+<br>
+   if (!fence->pipe_fence) {<br>
+      FREE(fence);<br>
+      return NULL;<br>
+   }<br>
+<br>
+   fence->driscreen = dri_screen(_ctx-><wbr>driScreenPriv);<br>
+   return fence;<br>
+}<br>
+<br>
+static void *<br>
+dri2_create_fence_fd(__<wbr>DRIcontext *_ctx, int fd)<br>
+{<br>
+   struct pipe_context *ctx = dri_context(_ctx)->st->pipe;<br>
+   struct dri2_fence *fence = CALLOC_STRUCT(dri2_fence);<br>
+<br>
+   if (fd == -1) {<br>
+      /* exporting driver created fence, flush: */<br>
+      ctx->flush(ctx, &fence->pipe_fence,<br>
+                 PIPE_FLUSH_DEFERRED | PIPE_FLUSH_FENCE_FD);<br>
+   } else {<br>
+      /* importing a foreign fence fd: */<br>
+      ctx->create_fence_fd(ctx, &fence->pipe_fence, fd);<br>
+   }<br>
+   if (!fence->pipe_fence) {<br>
+      FREE(fence);<br>
+      return NULL;<br>
+   }<br>
+<br>
+   fence->driscreen = dri_screen(_ctx-><wbr>driScreenPriv);<br>
+   return fence;<br>
+}<br>
+<br>
+static int<br>
+dri2_get_fence_fd(__DRIscreen *_screen, void *_fence)<br>
+{<br>
+   struct dri_screen *driscreen = dri_screen(_screen);<br>
+   struct pipe_screen *screen = driscreen->base.screen;<br>
+   struct dri2_fence *fence = (struct dri2_fence*)_fence;<br>
+<br>
+   return screen->fence_get_fd(screen, fence->pipe_fence);<br>
+}<br>
+<br>
+static void *<br>
+dri2_get_fence_from_cl_event(<wbr>__DRIscreen *_screen, intptr_t cl_event)<br>
+{<br>
+   struct dri_screen *driscreen = dri_screen(_screen);<br>
+   struct dri2_fence *fence;<br>
+<br>
+   if (!dri2_load_opencl_interop(<wbr>driscreen))<br>
+      return NULL;<br>
+<br>
+   fence = CALLOC_STRUCT(dri2_fence);<br>
+   if (!fence)<br>
+      return NULL;<br>
+<br>
+   fence->cl_event = (void*)cl_event;<br>
+<br>
+   if (!driscreen->opencl_dri_event_<wbr>add_ref(fence->cl_event)) {<br>
+      free(fence);<br>
+      return NULL;<br>
+   }<br>
+<br>
+   fence->driscreen = driscreen;<br>
+   return fence;<br>
+}<br>
+<br>
+static void<br>
+dri2_destroy_fence(__<wbr>DRIscreen *_screen, void *_fence)<br>
+{<br>
+   struct dri_screen *driscreen = dri_screen(_screen);<br>
+   struct pipe_screen *screen = driscreen->base.screen;<br>
+   struct dri2_fence *fence = (struct dri2_fence*)_fence;<br>
+<br>
+   if (fence->pipe_fence)<br>
+      screen->fence_reference(<wbr>screen, &fence->pipe_fence, NULL);<br>
+   else if (fence->cl_event)<br>
+      driscreen->opencl_dri_event_<wbr>release(fence->cl_event);<br>
+   else<br>
+      assert(0);<br>
+<br>
+   FREE(fence);<br>
+}<br>
+<br>
+static GLboolean<br>
+dri2_client_wait_sync(__<wbr>DRIcontext *_ctx, void *_fence, unsigned flags,<br>
+                      uint64_t timeout)<br>
+{<br>
+   struct dri2_fence *fence = (struct dri2_fence*)_fence;<br>
+   struct dri_screen *driscreen = fence->driscreen;<br>
+   struct pipe_screen *screen = driscreen->base.screen;<br>
+<br>
+   /* No need to flush. The context was flushed when the fence was created. */<br>
+<br>
+   if (fence->pipe_fence)<br>
+      return screen->fence_finish(screen, NULL, fence->pipe_fence, timeout);<br>
+   else if (fence->cl_event) {<br>
+      struct pipe_fence_handle *pipe_fence =<br>
+         driscreen->opencl_dri_event_<wbr>get_fence(fence->cl_event);<br>
+<br>
+      if (pipe_fence)<br>
+         return screen->fence_finish(screen, NULL, pipe_fence, timeout);<br>
+      else<br>
+         return driscreen->opencl_dri_event_<wbr>wait(fence->cl_event, timeout);<br>
+   }<br>
+   else {<br>
+      assert(0);<br>
+      return false;<br>
+   }<br>
+}<br>
+<br>
+static void<br>
+dri2_server_wait_sync(__<wbr>DRIcontext *_ctx, void *_fence, unsigned flags)<br>
+{<br>
+   struct pipe_context *ctx = dri_context(_ctx)->st->pipe;<br>
+   struct dri2_fence *fence = (struct dri2_fence*)_fence;<br>
+<br>
+   if (ctx->fence_server_sync)<br>
+      ctx->fence_server_sync(ctx, fence->pipe_fence);<br>
+}<br>
+<br>
+const __DRI2fenceExtension dri2FenceExtension = {<br>
+   .base = { __DRI2_FENCE, 2 },<br>
+<br>
+   .create_fence = dri2_create_fence,<br>
+   .get_fence_from_cl_event = dri2_get_fence_from_cl_event,<br>
+   .destroy_fence = dri2_destroy_fence,<br>
+   .client_wait_sync = dri2_client_wait_sync,<br>
+   .server_wait_sync = dri2_server_wait_sync,<br>
+   .get_capabilities = dri2_fence_get_caps,<br>
+   .create_fence_fd = dri2_create_fence_fd,<br>
+   .get_fence_fd = dri2_get_fence_fd,<br>
+};<br>
+<br>
+/* vim: set sw=3 ts=8 sts=3 expandtab: */<br>
diff --git a/src/gallium/state_trackers/<wbr>dri/dri_extensions.h b/src/gallium/state_trackers/<wbr>dri/dri_extensions.h<br>
new file mode 100644<br>
index 0000000000..89b01cd3ed<br>
--- /dev/null<br>
+++ b/src/gallium/state_trackers/<wbr>dri/dri_extensions.h<br>
@@ -0,0 +1,30 @@<br>
+/*<br>
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a<br>
+ * copy of this software and associated documentation files (the "Software"),<br>
+ * to deal in the Software without restriction, including without limitation<br>
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+ * and/or sell copies of the Software, and to permit persons to whom the<br>
+ * Software is furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice shall be included<br>
+ * in all copies or substantial portions of the Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS<br>
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR<br>
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
+ * OTHER DEALINGS IN THE SOFTWARE.<br>
+ */<br>
+<br>
+#ifndef DRI_EXTENSIONS_H<br>
+#define DRI_EXTENSIONS_H<br>
+<br>
+extern const __DRI2fenceExtension dri2FenceExtension;<br>
+<br>
+#endif<br>
+<br>
+/* vim: set sw=3 ts=8 sts=3 expandtab: */<br>
diff --git a/src/gallium/state_trackers/<wbr>dri/drisw.c b/src/gallium/state_trackers/<wbr>dri/drisw.c<br>
index b85a73c57d..8fbfa9ecea 100644<br>
--- a/src/gallium/state_trackers/<wbr>dri/drisw.c<br>
+++ b/src/gallium/state_trackers/<wbr>dri/drisw.c<br>
@@ -46,6 +46,7 @@<br>
 #include "dri_screen.h"<br>
 #include "dri_context.h"<br>
 #include "dri_drawable.h"<br>
+#include "dri_extensions.h"<br>
 #include "dri_query_renderer.h"<br>
<br>
 DEBUG_GET_ONCE_BOOL_OPTION(<wbr>swrast_no_present, "SWRAST_NO_PRESENT", FALSE);<br>
@@ -369,6 +370,7 @@ static const __DRIextension *drisw_screen_extensions[] = {<br>
<div class="HOEnZb"><div class="h5">    &driTexBufferExtension.base,<br>
    &dri2RendererQueryExtension.<wbr>base,<br>
    &dri2ConfigQueryExtension.<wbr>base,<br>
+   &dri2FenceExtension.base,<br>
    NULL<br>
 };<br>
<br>
--<br>
2.12.2<br>
<br>
</div></div></blockquote></div><br></div>