summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase_fence.c
diff options
context:
space:
mode:
authorSidath Senanayake <sidaths@google.com>2018-09-27 14:34:14 +0200
committerSidath Senanayake <sidaths@google.com>2018-09-27 14:34:14 +0200
commitf10b3de5283d0c196459f18160161e48cfadae81 (patch)
tree7123dda75768c8b90b15c58523a7509a7c93a35b /mali_kbase/mali_kbase_fence.c
parentf32af5a9ba3c2b556d92827a96dbeec3df200968 (diff)
downloadgpu-f10b3de5283d0c196459f18160161e48cfadae81.tar.gz
Mali Bifrost DDK r15p0 KMD
Provenance: c4c373c4f (collaborate/EAC/b_r15p0) BX304L01B-BU-00000-r15p0-01rel0 BX304L06A-BU-00000-r15p0-01rel0 BX304X07X-BU-00000-r15p0-01rel0 Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: I09fe49ca693dfde616dd8d6b8c3e5b178a47e9f8
Diffstat (limited to 'mali_kbase/mali_kbase_fence.c')
-rw-r--r--mali_kbase/mali_kbase_fence.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mali_kbase/mali_kbase_fence.c b/mali_kbase/mali_kbase_fence.c
index ac8272c..3272836 100644
--- a/mali_kbase/mali_kbase_fence.c
+++ b/mali_kbase/mali_kbase_fence.c
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2011-2017 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2011-2018 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -177,6 +177,7 @@ kbase_fence_add_callback(struct kbase_jd_atom *katom,
kbase_fence_cb->fence = fence;
kbase_fence_cb->katom = katom;
INIT_LIST_HEAD(&kbase_fence_cb->node);
+ atomic_inc(&katom->dma_fence.dep_count);
err = dma_fence_add_callback(fence, &kbase_fence_cb->fence_cb,
callback);
@@ -189,15 +190,16 @@ kbase_fence_add_callback(struct kbase_jd_atom *katom,
err = 0;
kfree(kbase_fence_cb);
+ atomic_dec(&katom->dma_fence.dep_count);
} else if (err) {
kfree(kbase_fence_cb);
+ atomic_dec(&katom->dma_fence.dep_count);
} else {
/*
* Get reference to fence that will be kept until callback gets
* cleaned up in kbase_fence_free_callbacks().
*/
dma_fence_get(fence);
- atomic_inc(&katom->dma_fence.dep_count);
/* Add callback to katom's list of callbacks */
list_add(&kbase_fence_cb->node, &katom->dma_fence.callbacks);
}