[Mesa-dev] [RFC v3 05/23] i965: Implement EGL_EXT_image_implicit_sync_control

Louis-Francis Ratté-Boulianne lfrb at collabora.com
Thu Sep 28 07:54:45 UTC 2017


From: Daniel Stone <daniels at collabora.com>

---
 src/mesa/drivers/dri/i965/brw_bufmgr.h   |  3 +++
 src/mesa/drivers/dri/i965/intel_screen.c | 16 ++++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.h b/src/mesa/drivers/dri/i965/brw_bufmgr.h
index de0ba1dad1..f44696f69a 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.h
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.h
@@ -120,6 +120,9 @@ struct brw_bo {
    int refcount;
    const char *name;
 
+#ifndef EXEC_OBJECT_ASYNC
+#define EXEC_OBJECT_ASYNC              (1<<6)
+#endif
 #ifndef EXEC_OBJECT_CAPTURE
 #define EXEC_OBJECT_CAPTURE            (1<<7)
 #endif
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 0bf0144ea3..58f8576cad 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -1297,8 +1297,14 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
     return image;
 }
 
-static const __DRIimageExtension intelImageExtension = {
-    .base = { __DRI_IMAGE, 16 },
+static void
+intel_image_suppress_implicit_sync(__DRIimage *image)
+{
+    image->bo->kflags |= EXEC_OBJECT_ASYNC;
+}
+
+static __DRIimageExtension intelImageExtension = {
+    .base = { __DRI_IMAGE, 17 },
 
     .createImageFromName                = intel_create_image_from_name,
     .createImageFromRenderbuffer        = intel_create_image_from_renderbuffer,
@@ -1321,6 +1327,7 @@ static const __DRIimageExtension intelImageExtension = {
     .queryDmaBufFormats                 = intel_query_dma_buf_formats,
     .queryDmaBufModifiers               = intel_query_dma_buf_modifiers,
     .queryDmaBufFormatModifierAttribs   = intel_query_format_modifier_attribs,
+    .suppressImplicitSync               = NULL,
 };
 
 static uint64_t
@@ -2510,6 +2517,11 @@ __DRIconfig **intelInitScreen2(__DRIscreen *dri_screen)
          (ret != -1 || errno != EINVAL);
    }
 
+   if (intel_get_boolean(screen, I915_PARAM_HAS_EXEC_ASYNC)) {
+      intelImageExtension.suppressImplicitSync =
+         intel_image_suppress_implicit_sync;
+   }
+
    dri_screen->extensions = !screen->has_context_reset_notification
       ? screenExtensions : intelRobustScreenExtensions;
 
-- 
2.13.0



More information about the mesa-dev mailing list