Mesa (master): anv: Replace anv_bo::is_winsys_bo with a uint32_t flags

Jason Ekstrand jekstrand at kemper.freedesktop.org
Wed Apr 5 01:34:56 UTC 2017


Module: Mesa
Branch: master
Commit: 439da38d184b5e9dddcfb245a2454879e7632649
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=439da38d184b5e9dddcfb245a2454879e7632649

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Thu Mar 30 11:48:05 2017 -0700

anv: Replace anv_bo::is_winsys_bo with a uint32_t flags

Reviewed-by: Kristian H. Kristensen <krh at bitplanet.net>

---

 src/intel/vulkan/anv_batch_chain.c | 4 ++--
 src/intel/vulkan/anv_private.h     | 9 +++------
 src/intel/vulkan/anv_wsi.c         | 7 ++++++-
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 5a6c0ba1a9..5f0528fc8f 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -149,7 +149,7 @@ anv_reloc_list_add(struct anv_reloc_list *list,
    int index;
 
    const uint32_t domain =
-      target_bo->is_winsys_bo ? I915_GEM_DOMAIN_RENDER : 0;
+      (target_bo->flags & EXEC_OBJECT_WRITE) ? I915_GEM_DOMAIN_RENDER : 0;
 
    VkResult result = anv_reloc_list_grow(list, alloc, 1);
    if (result != VK_SUCCESS)
@@ -1036,7 +1036,7 @@ anv_execbuf_add_bo(struct anv_execbuf *exec,
       obj->relocs_ptr = 0;
       obj->alignment = 0;
       obj->offset = bo->offset;
-      obj->flags = bo->is_winsys_bo ? EXEC_OBJECT_WRITE : 0;
+      obj->flags = bo->flags;
       obj->rsvd1 = 0;
       obj->rsvd2 = 0;
    }
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index dc83b4ac44..ee0f79b6dd 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -295,11 +295,8 @@ struct anv_bo {
    uint64_t size;
    void *map;
 
-   /* We need to set the WRITE flag on winsys bos so GEM will know we're
-    * writing to them and synchronize uses on other rings (eg if the display
-    * server uses the blitter ring).
-    */
-   bool is_winsys_bo;
+   /** Flags to pass to the kernel through drm_i915_exec_object2::flags */
+   uint32_t flags;
 };
 
 static inline void
@@ -310,7 +307,7 @@ anv_bo_init(struct anv_bo *bo, uint32_t gem_handle, uint64_t size)
    bo->offset = -1;
    bo->size = size;
    bo->map = NULL;
-   bo->is_winsys_bo = false;
+   bo->flags = 0;
 }
 
 /* Represents a lock-free linked list of "free" things.  This is used by
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index 6a0203ac30..6ab0f20b3d 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -201,7 +201,12 @@ x11_anv_wsi_image_create(VkDevice device_h,
       goto fail_create_image;
 
    memory = anv_device_memory_from_handle(memory_h);
-   memory->bo.is_winsys_bo = true;
+
+   /* We need to set the WRITE flag on window system buffers so that GEM will
+    * know we're writing to them and synchronize uses on other rings (eg if
+    * the display server uses the blitter ring).
+    */
+   memory->bo.flags |= EXEC_OBJECT_WRITE;
 
    anv_BindImageMemory(device_h, image_h, memory_h, 0);
 




More information about the mesa-commit mailing list