panfrost: Merge PAN_BO_IMPORTED/PAN_BO_EXPORTED
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 26 May 2020 17:07:23 +0000 (13:07 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Jul 2020 14:42:33 +0000 (14:42 +0000)
Always checked together and really signal the same property from
different perspectives.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>

src/gallium/drivers/panfrost/pan_resource.c
src/panfrost/encoder/pan_bo.c
src/panfrost/encoder/pan_bo.h

index d9c481f..84371c3 100644 (file)
@@ -632,7 +632,7 @@ panfrost_transfer_map(struct pipe_context *pctx,
                          * importer/exporter wouldn't see the change we're
                          * doing to it.
                          */
-                        if (!(bo->flags & (PAN_BO_IMPORTED | PAN_BO_EXPORTED)))
+                        if (!(bo->flags & PAN_BO_SHARED))
                                 newbo = panfrost_bo_create(dev, bo->size,
                                                            flags);
 
index d24c21a..3087387 100644 (file)
@@ -128,7 +128,7 @@ panfrost_bo_wait(struct panfrost_bo *bo, int64_t timeout_ns,
         /* If the BO has been exported or imported we can't rely on the cached
          * state, we need to call the WAIT_BO ioctl.
          */
-        if (!(bo->flags & (PAN_BO_IMPORTED | PAN_BO_EXPORTED))) {
+        if (!(bo->flags & PAN_BO_SHARED)) {
                 /* If ->gpu_access is 0, the BO is idle, no need to wait. */
                 if (!bo->gpu_access)
                         return true;
@@ -477,7 +477,7 @@ panfrost_bo_import(struct panfrost_device *dev, int fd)
                 bo->dev = dev;
                 bo->gpu = (mali_ptr) get_bo_offset.offset;
                 bo->size = lseek(fd, 0, SEEK_END);
-                bo->flags = PAN_BO_DONT_REUSE | PAN_BO_IMPORTED;
+                bo->flags = PAN_BO_DONT_REUSE | PAN_BO_SHARED;
                 bo->gem_handle = gem_handle;
                 assert(bo->size > 0);
                 p_atomic_set(&bo->refcnt, 1);
@@ -517,7 +517,7 @@ panfrost_bo_export(struct panfrost_bo *bo)
         if (ret == -1)
                 return -1;
 
-        bo->flags |= PAN_BO_DONT_REUSE | PAN_BO_EXPORTED;
+        bo->flags |= PAN_BO_DONT_REUSE | PAN_BO_SHARED;
         return args.fd;
 }
 
index 7773b2b..dba3a40 100644 (file)
  * let the BO logic know about this contraint. */
 #define PAN_BO_DONT_REUSE         (1 << 5)
 
-/* BO has been imported */
-#define PAN_BO_IMPORTED           (1 << 6)
-
-/* BO has been exported */
-#define PAN_BO_EXPORTED           (1 << 7)
+/* BO is shared across processes (imported or exported) */
+#define PAN_BO_SHARED             (1 << 6)
 
 /* GPU access flags */