From 3a956a573d2ecb9a7520680ec6bcd6f626054488 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 11 Dec 2017 11:33:48 -0800 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1615985 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/tsg_gk20a.c') 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 @@ #include #include +#include #include "gk20a.h" #include "tsg_gk20a.h" @@ -286,7 +287,7 @@ struct tsg_gk20a *gk20a_tsg_open(struct gk20a *g) tsg->timeslice_timeout = 0; tsg->timeslice_scale = 0; tsg->runlist_id = ~0; - tsg->tgid = current->tgid; + tsg->tgid = nvgpu_current_pid(g); if (g->ops.fifo.init_eng_method_buffers) g->ops.fifo.init_eng_method_buffers(g, tsg); -- cgit v1.2.2