summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-12-11 14:33:48 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-12-27 05:21:07 -0500
commit3a956a573d2ecb9a7520680ec6bcd6f626054488 (patch)
treecf51039d11a54a6c99694cf6c0ad638275ece8c3 /drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
parent6f0b6ef9caec50fd4aa0ffa11e1751eb38c92d56 (diff)
gpu: nvgpu: Implement abstraction for finding TGID
Implement abstraction for finding the process ID of thread currently being run. This is tracked for context switch tracing. In Linux kernel this is implemented by returning TGID. Change-Id: Ia6bcbd92c8cc25467694a35476e5d5f717194105 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1615985 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/tsg_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
index 4efcfda8..64d521a0 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
@@ -22,6 +22,7 @@
22 22
23#include <nvgpu/kmem.h> 23#include <nvgpu/kmem.h>
24#include <nvgpu/log.h> 24#include <nvgpu/log.h>
25#include <nvgpu/os_sched.h>
25 26
26#include "gk20a.h" 27#include "gk20a.h"
27#include "tsg_gk20a.h" 28#include "tsg_gk20a.h"
@@ -286,7 +287,7 @@ struct tsg_gk20a *gk20a_tsg_open(struct gk20a *g)
286 tsg->timeslice_timeout = 0; 287 tsg->timeslice_timeout = 0;
287 tsg->timeslice_scale = 0; 288 tsg->timeslice_scale = 0;
288 tsg->runlist_id = ~0; 289 tsg->runlist_id = ~0;
289 tsg->tgid = current->tgid; 290 tsg->tgid = nvgpu_current_pid(g);
290 291
291 if (g->ops.fifo.init_eng_method_buffers) 292 if (g->ops.fifo.init_eng_method_buffers)
292 g->ops.fifo.init_eng_method_buffers(g, tsg); 293 g->ops.fifo.init_eng_method_buffers(g, tsg);