summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2019-09-14 17:11:03 +0200
committerBoris Brezillon <boris.brezillon@collabora.com>2019-10-03 16:55:38 -0400
commit22190bc27b93b8314db481dbf6002eeae6e39f62 (patch)
tree38bd030309f3d0f7b77be18d5760517b03c780a3 /src
parent82399b58d3250d974cb6a74c3aa96f6f2fbafef0 (diff)
panfrost: Add flags to reflect the BO imported/exported state
Will be useful to make the ioctl(WAIT_BO) call conditional on BOs that are not exported/imported (meaning that all GPU accesses are known by the context). Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/panfrost/pan_bo.c4
-rw-r--r--src/gallium/drivers/panfrost/pan_bo.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/pan_bo.c b/src/gallium/drivers/panfrost/pan_bo.c
index 209d1e0d71e..9daddf9d0cc 100644
--- a/src/gallium/drivers/panfrost/pan_bo.c
+++ b/src/gallium/drivers/panfrost/pan_bo.c
@@ -355,7 +355,7 @@ panfrost_bo_import(struct panfrost_screen *screen, int fd)
bo->gem_handle = gem_handle;
bo->gpu = (mali_ptr) get_bo_offset.offset;
bo->size = lseek(fd, 0, SEEK_END);
- bo->flags |= PAN_BO_DONT_REUSE;
+ bo->flags |= PAN_BO_DONT_REUSE | PAN_BO_IMPORTED;
assert(bo->size > 0);
pipe_reference_init(&bo->reference, 1);
@@ -376,7 +376,7 @@ panfrost_bo_export(struct panfrost_bo *bo)
if (ret == -1)
return -1;
- bo->flags |= PAN_BO_DONT_REUSE;
+ bo->flags |= PAN_BO_DONT_REUSE | PAN_BO_EXPORTED;
return args.fd;
}
diff --git a/src/gallium/drivers/panfrost/pan_bo.h b/src/gallium/drivers/panfrost/pan_bo.h
index 73cc74a260d..e4743f820ae 100644
--- a/src/gallium/drivers/panfrost/pan_bo.h
+++ b/src/gallium/drivers/panfrost/pan_bo.h
@@ -56,6 +56,12 @@ struct panfrost_screen;
* 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)
+
/* GPU access flags */
/* BO is either shared (can be accessed by more than one GPU batch) or private