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

Louis-Francis Ratté-Boulianne lfrb at collabora.com
Mon Oct 16 07:04:15 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 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 1b50d0998a..be6c5aafd4 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -1295,8 +1295,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,
@@ -1319,6 +1325,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
@@ -2511,6 +2519,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