From baa1a8fbbad0f1b3d9cfd51905993f74955de058 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 26 May 2020 13:07:23 -0400 Subject: [PATCH] panfrost: Merge PAN_BO_IMPORTED/PAN_BO_EXPORTED Always checked together and really signal the same property from different perspectives. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/pan_resource.c | 2 +- src/panfrost/encoder/pan_bo.c | 6 +++--- src/panfrost/encoder/pan_bo.h | 7 ++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index d9c481fd482..84371c34e44 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -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); diff --git a/src/panfrost/encoder/pan_bo.c b/src/panfrost/encoder/pan_bo.c index d24c21ae623..3087387d54a 100644 --- a/src/panfrost/encoder/pan_bo.c +++ b/src/panfrost/encoder/pan_bo.c @@ -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; } diff --git a/src/panfrost/encoder/pan_bo.h b/src/panfrost/encoder/pan_bo.h index 7773b2baaab..dba3a402ea7 100644 --- a/src/panfrost/encoder/pan_bo.h +++ b/src/panfrost/encoder/pan_bo.h @@ -55,11 +55,8 @@ * 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 */ -- 2.30.2