summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2018-03-29 19:52:16 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-04-10 04:11:44 -0400
commit31432919cac8fc4ddad3b9245cf61ffd47d5db82 (patch)
tree4121f32495f8ccd92be8a38071e33d8918e1fa88
parent546e77812150fbcab601b529b053758f58d02bc1 (diff)
gpu: nvgpu: vgpu: fix build errors on qnx
- Declare global functions before reaching the implementation. - avoid using current (current process). - assign ch->pid/tgid before using them. Jira VFND-4870 Change-Id: I688a1b89ef4d5dcf046929eab11d7e523caba0a5 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1687142 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Nirav Patel <nipatel@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/vgpu/fifo_vgpu.c2
-rw-r--r--drivers/gpu/nvgpu/vgpu/gp10b/vgpu_fuse_gp10b.c1
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c1
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.c1
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c1
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c3
7 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index a68968fe..f50c37a7 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -645,6 +645,9 @@ struct channel_gk20a *gk20a_open_new_channel(struct gk20a *g,
645 /* Channel privilege level */ 645 /* Channel privilege level */
646 ch->is_privileged_channel = is_privileged_channel; 646 ch->is_privileged_channel = is_privileged_channel;
647 647
648 ch->pid = nvgpu_current_tid(g);
649 ch->tgid = nvgpu_current_pid(g); /* process granularity for FECS traces */
650
648 if (g->ops.fifo.alloc_inst(g, ch)) { 651 if (g->ops.fifo.alloc_inst(g, ch)) {
649 ch->g = NULL; 652 ch->g = NULL;
650 free_channel(f, ch); 653 free_channel(f, ch);
@@ -656,9 +659,6 @@ struct channel_gk20a *gk20a_open_new_channel(struct gk20a *g,
656 /* now the channel is in a limbo out of the free list but not marked as 659 /* now the channel is in a limbo out of the free list but not marked as
657 * alive and used (i.e. get-able) yet */ 660 * alive and used (i.e. get-able) yet */
658 661
659 ch->pid = nvgpu_current_tid(g);
660 ch->tgid = nvgpu_current_pid(g); /* process granularity for FECS traces */
661
662 /* By default, channel is regular (non-TSG) channel */ 662 /* By default, channel is regular (non-TSG) channel */
663 ch->tsgid = NVGPU_INVALID_TSG_ID; 663 ch->tsgid = NVGPU_INVALID_TSG_ID;
664 664
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
index c8a8ce49..d077f329 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
@@ -89,7 +89,7 @@ int vgpu_channel_alloc_inst(struct gk20a *g, struct channel_gk20a *ch)
89 msg.cmd = TEGRA_VGPU_CMD_CHANNEL_ALLOC_HWCTX; 89 msg.cmd = TEGRA_VGPU_CMD_CHANNEL_ALLOC_HWCTX;
90 msg.handle = vgpu_get_handle(g); 90 msg.handle = vgpu_get_handle(g);
91 p->id = ch->chid; 91 p->id = ch->chid;
92 p->pid = (u64)current->tgid; 92 p->pid = (u64)ch->pid;
93 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); 93 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
94 if (err || msg.ret) { 94 if (err || msg.ret) {
95 nvgpu_err(g, "fail"); 95 nvgpu_err(g, "fail");
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_fuse_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_fuse_gp10b.c
index 52b2aee5..0d3c6bc1 100644
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_fuse_gp10b.c
+++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_fuse_gp10b.c
@@ -23,6 +23,7 @@
23#include <nvgpu/enabled.h> 23#include <nvgpu/enabled.h>
24 24
25#include "gk20a/gk20a.h" 25#include "gk20a/gk20a.h"
26#include "vgpu_fuse_gp10b.h"
26 27
27int vgpu_gp10b_fuse_check_priv_security(struct gk20a *g) 28int vgpu_gp10b_fuse_check_priv_security(struct gk20a *g)
28{ 29{
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c
index 18d2de70..9b689699 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c
@@ -26,6 +26,7 @@
26#include <nvgpu/vgpu/tegra_vgpu.h> 26#include <nvgpu/vgpu/tegra_vgpu.h>
27 27
28#include "gv11b/fifo_gv11b.h" 28#include "gv11b/fifo_gv11b.h"
29#include "vgpu_fifo_gv11b.h"
29 30
30#ifdef CONFIG_TEGRA_GK20A_NVHOST 31#ifdef CONFIG_TEGRA_GK20A_NVHOST
31 32
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.c
index 3c93c581..df4d87da 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.c
+++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.c
@@ -23,6 +23,7 @@
23#include "gk20a/gk20a.h" 23#include "gk20a/gk20a.h"
24#include "vgpu/gr_vgpu.h" 24#include "vgpu/gr_vgpu.h"
25#include "vgpu_subctx_gv11b.h" 25#include "vgpu_subctx_gv11b.h"
26#include "vgpu_gr_gv11b.h"
26 27
27int vgpu_gr_gv11b_commit_inst(struct channel_gk20a *c, u64 gpu_va) 28int vgpu_gr_gv11b_commit_inst(struct channel_gk20a *c, u64 gpu_va)
28{ 29{
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c
index ba92c8d5..2372b9c4 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c
+++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c
@@ -21,6 +21,7 @@
21 */ 21 */
22 22
23#include "gk20a/gk20a.h" 23#include "gk20a/gk20a.h"
24#include "vgpu_subctx_gv11b.h"
24 25
25#include <nvgpu/vgpu/vgpu.h> 26#include <nvgpu/vgpu/vgpu.h>
26#include <nvgpu/vgpu/tegra_vgpu.h> 27#include <nvgpu/vgpu/tegra_vgpu.h>
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index 21496906..c10a1982 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -31,9 +31,6 @@
31#include <nvgpu/vgpu/vm.h> 31#include <nvgpu/vgpu/vm.h>
32#include <nvgpu/vgpu/vgpu.h> 32#include <nvgpu/vgpu/vgpu.h>
33 33
34#include <nvgpu/linux/vm.h>
35#include <nvgpu/linux/nvgpu_mem.h>
36
37#include "mm_vgpu.h" 34#include "mm_vgpu.h"
38#include "gk20a/gk20a.h" 35#include "gk20a/gk20a.h"
39#include "gk20a/mm_gk20a.h" 36#include "gk20a/mm_gk20a.h"