summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2014-09-04 09:39:26 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:13 -0400
commit18eee7effef0689a8b9dbd7c61703c52cbdb490e (patch)
tree158b592da651a9a4cd133264f6b6fdc5530a74af /drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
parentffd25f39055ed76b3d6488ea9d89b65860e56b5a (diff)
gpu: nvgpu: add refcounting for TSG
Add refcounting for TSGs and manage the refcounts as below : - initialize ref when TSG is opened - get ref when channel is bound to TSG - drop the ref when channel is unbound (i.e. during channel close) - drop the ref when TSG is closed - when refcount drops to zero, we free the TSG This refcounting makes it possible to close channels or TSG in any order Bug 1470692 Change-Id: Ia4b39164a4582c8169da62a91b9131094c67f5f8 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/495667 (cherry picked from commit be1e198a663d2102e9674978f3d2cca0f2327a6b) Reviewed-on: http://git-master/r/495955 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/tsg_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
index 67fa6508..c84e8d0b 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
@@ -27,6 +27,8 @@
27 27
28static void gk20a_tsg_release(struct kref *ref); 28static void gk20a_tsg_release(struct kref *ref);
29 29
30static void gk20a_tsg_release(struct kref *ref);
31
30bool gk20a_is_channel_marked_as_tsg(struct channel_gk20a *ch) 32bool gk20a_is_channel_marked_as_tsg(struct channel_gk20a *ch)
31{ 33{
32 return !(ch->tsgid == NVGPU_INVALID_TSG_ID); 34 return !(ch->tsgid == NVGPU_INVALID_TSG_ID);