diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/os_sched.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/os_sched.h | 6 |
3 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/os_sched.c b/drivers/gpu/nvgpu/common/linux/os_sched.c index ddaaad0f..586b35eb 100644 --- a/drivers/gpu/nvgpu/common/linux/os_sched.c +++ b/drivers/gpu/nvgpu/common/linux/os_sched.c | |||
@@ -15,6 +15,11 @@ | |||
15 | 15 | ||
16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
17 | 17 | ||
18 | int nvgpu_current_tid(struct gk20a *g) | ||
19 | { | ||
20 | return current->pid; | ||
21 | } | ||
22 | |||
18 | int nvgpu_current_pid(struct gk20a *g) | 23 | int nvgpu_current_pid(struct gk20a *g) |
19 | { | 24 | { |
20 | return current->tgid; | 25 | return current->tgid; |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 07ae5a16..f4a49a4b 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <nvgpu/barrier.h> | 44 | #include <nvgpu/barrier.h> |
45 | #include <nvgpu/ctxsw_trace.h> | 45 | #include <nvgpu/ctxsw_trace.h> |
46 | #include <nvgpu/error_notifier.h> | 46 | #include <nvgpu/error_notifier.h> |
47 | #include <nvgpu/os_sched.h> | ||
47 | 48 | ||
48 | #include "gk20a.h" | 49 | #include "gk20a.h" |
49 | #include "dbg_gpu_gk20a.h" | 50 | #include "dbg_gpu_gk20a.h" |
@@ -726,8 +727,8 @@ struct channel_gk20a *gk20a_open_new_channel(struct gk20a *g, | |||
726 | /* now the channel is in a limbo out of the free list but not marked as | 727 | /* now the channel is in a limbo out of the free list but not marked as |
727 | * alive and used (i.e. get-able) yet */ | 728 | * alive and used (i.e. get-able) yet */ |
728 | 729 | ||
729 | ch->pid = current->pid; | 730 | ch->pid = nvgpu_current_tid(g); |
730 | ch->tgid = current->tgid; /* process granularity for FECS traces */ | 731 | ch->tgid = nvgpu_current_pid(g); /* process granularity for FECS traces */ |
731 | 732 | ||
732 | /* By default, channel is regular (non-TSG) channel */ | 733 | /* By default, channel is regular (non-TSG) channel */ |
733 | ch->tsgid = NVGPU_INVALID_TSG_ID; | 734 | ch->tsgid = NVGPU_INVALID_TSG_ID; |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/os_sched.h b/drivers/gpu/nvgpu/include/nvgpu/os_sched.h index 61cee4ad..97dc9a57 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/os_sched.h +++ b/drivers/gpu/nvgpu/include/nvgpu/os_sched.h | |||
@@ -26,6 +26,12 @@ | |||
26 | struct gk20a; | 26 | struct gk20a; |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * nvgpu_current_tid - Query the id of current thread | ||
30 | * | ||
31 | */ | ||
32 | int nvgpu_current_tid(struct gk20a *g); | ||
33 | |||
34 | /** | ||
29 | * nvgpu_current_pid - Query the id of current process | 35 | * nvgpu_current_pid - Query the id of current process |
30 | * | 36 | * |
31 | */ | 37 | */ |