From: Alyssa Rosenzweig Date: Tue, 26 May 2020 17:07:23 +0000 (-0400) Subject: panfrost: Merge PAN_BO_IMPORTED/PAN_BO_EXPORTED X-Git-Tag: upstream/21.0.0~7684 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=baa1a8fbbad0f1b3d9cfd51905993f74955de058;p=platform%2Fupstream%2Fmesa.git 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: --- diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index d9c481f..84371c3 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 d24c21a..3087387 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 7773b2b..dba3a40 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 */