summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-28 15:28:11 -0400
committerMarge Bot <[email protected]>2020-04-29 15:18:38 +0000
commite3062edff42a3afe8029c7bc36136124036d3053 (patch)
tree04eeb96f40dcda4dbbe84ca17a7cb5141e20ae5f
parent22a4cb4937d40d3dbd34129c8c0e6cf8673c8f95 (diff)
panfrost: Fix BO reference counting
Typo. Fixes: 3283c7f4dad ("panfrost: Inline reference counting routines") Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4792>
-rw-r--r--src/panfrost/encoder/pan_bo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/panfrost/encoder/pan_bo.c b/src/panfrost/encoder/pan_bo.c
index 9e5ea7ed21e..32fc84e1363 100644
--- a/src/panfrost/encoder/pan_bo.c
+++ b/src/panfrost/encoder/pan_bo.c
@@ -482,7 +482,7 @@ panfrost_bo_import(struct panfrost_device *dev, int fd)
panfrost_bo_mmap(newbo);
} else {
ralloc_free(newbo);
- /* bo->refcnt != 0 can happen if the BO
+ /* bo->refcnt == 0 can happen if the BO
* was being released but panfrost_bo_import() acquired the
* lock before panfrost_bo_unreference(). In that case, refcnt
* is 0 and we can't use panfrost_bo_reference() directly, we
@@ -492,7 +492,7 @@ panfrost_bo_import(struct panfrost_device *dev, int fd)
* make sure the object is not freed if panfrost_bo_import()
* acquired it in the meantime.
*/
- if (p_atomic_read(&bo->refcnt))
+ if (p_atomic_read(&bo->refcnt) == 0)
p_atomic_set(&newbo->refcnt, 1);
else
panfrost_bo_reference(bo);