[Mesa-dev] [RFC v5 05/19] i965: Implement EGL_EXT_image_implicit_sync_control

Louis-Francis Ratté-Boulianne lfrb at collabora.com
Mon Nov 6 22:02:35 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 | 17 +++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.h b/src/mesa/drivers/dri/i965/brw_bufmgr.h
index ee91324043..254d247eab 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 b87ccab0a8..88bc41ed64 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -1290,8 +1290,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, 18 },
 
     .createImageFromName                = intel_create_image_from_name,
     .createImageFromRenderbuffer        = intel_create_image_from_renderbuffer,
@@ -1314,6 +1320,8 @@ static const __DRIimageExtension intelImageExtension = {
     .queryDmaBufFormats                 = intel_query_dma_buf_formats,
     .queryDmaBufModifiers               = intel_query_dma_buf_modifiers,
     .queryDmaBufFormatModifierAttribs   = intel_query_format_modifier_attribs,
+    .createImageFromRenderbuffer2       = NULL,
+    .suppressImplicitSync               = NULL,
 };
 
 static uint64_t
@@ -2519,6 +2527,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