summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2018-04-12 19:06:02 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-04-16 13:49:43 -0400
commitcc9f3d80e32c63ae003a8dc66016a035100a6359 (patch)
tree50fc79abb1c314a76f576ba3571e877d9c84e2d7 /drivers/gpu/nvgpu/common/linux
parenta0dfb2b91112a766fb4b3e2aaafa99167151c3da (diff)
gpu: nvgpu: pass pid/tid from os specific code to common code
linux driver runs in user's process but qnx driver has dedicate driver process, so they have different way to get user pid. nvgpu common code expect calls from os specific code pass pid/tid. ce/cde open channel for internal use, we use driver pid. Jira VQRM-3534 Change-Id: I892372ac5f1dc4d25f9928d16992bcc659d12a56 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1694145 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r--drivers/gpu/nvgpu/common/linux/cde.c3
-rw-r--r--drivers/gpu/nvgpu/common/linux/channel.c6
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_channel.c6
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_tsg.c3
4 files changed, 12 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/cde.c b/drivers/gpu/nvgpu/common/linux/cde.c
index 4911afa1..f3895d5c 100644
--- a/drivers/gpu/nvgpu/common/linux/cde.c
+++ b/drivers/gpu/nvgpu/common/linux/cde.c
@@ -31,6 +31,7 @@
31#include <nvgpu/log.h> 31#include <nvgpu/log.h>
32#include <nvgpu/bug.h> 32#include <nvgpu/bug.h>
33#include <nvgpu/firmware.h> 33#include <nvgpu/firmware.h>
34#include <nvgpu/os_sched.h>
34 35
35#include <nvgpu/linux/vm.h> 36#include <nvgpu/linux/vm.h>
36 37
@@ -1287,7 +1288,7 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx)
1287 return -ENOSYS; 1288 return -ENOSYS;
1288 } 1289 }
1289 1290
1290 tsg = gk20a_tsg_open(g); 1291 tsg = gk20a_tsg_open(g, nvgpu_current_pid(g));
1291 if (!tsg) { 1292 if (!tsg) {
1292 nvgpu_err(g, "cde: could not create TSG"); 1293 nvgpu_err(g, "cde: could not create TSG");
1293 err = -ENOMEM; 1294 err = -ENOMEM;
diff --git a/drivers/gpu/nvgpu/common/linux/channel.c b/drivers/gpu/nvgpu/common/linux/channel.c
index 70baeb2d..a360d0df 100644
--- a/drivers/gpu/nvgpu/common/linux/channel.c
+++ b/drivers/gpu/nvgpu/common/linux/channel.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA Corporation. All rights reserved. 2 * Copyright (c) 2017-2018, NVIDIA Corporation. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -18,6 +18,7 @@
18#include <nvgpu/debug.h> 18#include <nvgpu/debug.h>
19#include <nvgpu/ltc.h> 19#include <nvgpu/ltc.h>
20#include <nvgpu/error_notifier.h> 20#include <nvgpu/error_notifier.h>
21#include <nvgpu/os_sched.h>
21 22
22/* 23/*
23 * This is required for nvgpu_vm_find_buf() which is used in the tracing 24 * This is required for nvgpu_vm_find_buf() which is used in the tracing
@@ -251,7 +252,8 @@ struct channel_gk20a *gk20a_open_new_channel_with_cb(struct gk20a *g,
251 struct channel_gk20a *ch; 252 struct channel_gk20a *ch;
252 struct nvgpu_channel_linux *priv; 253 struct nvgpu_channel_linux *priv;
253 254
254 ch = gk20a_open_new_channel(g, runlist_id, is_privileged_channel); 255 ch = gk20a_open_new_channel(g, runlist_id, is_privileged_channel,
256 nvgpu_current_pid(g), nvgpu_current_tid(g));
255 257
256 if (ch) { 258 if (ch) {
257 priv = ch->os_priv; 259 priv = ch->os_priv;
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
index 5b4dda6c..b4d7d501 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Graphics channel 2 * GK20A Graphics channel
3 * 3 *
4 * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2018, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -33,6 +33,7 @@
33#include <nvgpu/error_notifier.h> 33#include <nvgpu/error_notifier.h>
34#include <nvgpu/barrier.h> 34#include <nvgpu/barrier.h>
35#include <nvgpu/nvhost.h> 35#include <nvgpu/nvhost.h>
36#include <nvgpu/os_sched.h>
36 37
37#include "gk20a/gk20a.h" 38#include "gk20a/gk20a.h"
38#include "gk20a/dbg_gpu_gk20a.h" 39#include "gk20a/dbg_gpu_gk20a.h"
@@ -495,7 +496,8 @@ static int __gk20a_channel_open(struct gk20a *g,
495 goto fail_busy; 496 goto fail_busy;
496 } 497 }
497 /* All the user space channel should be non privilege */ 498 /* All the user space channel should be non privilege */
498 ch = gk20a_open_new_channel(g, runlist_id, false); 499 ch = gk20a_open_new_channel(g, runlist_id, false,
500 nvgpu_current_pid(g), nvgpu_current_tid(g));
499 gk20a_idle(g); 501 gk20a_idle(g);
500 if (!ch) { 502 if (!ch) {
501 nvgpu_err(g, 503 nvgpu_err(g,
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c b/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c
index 60aca5ec..be2315bd 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_tsg.c
@@ -24,6 +24,7 @@
24 24
25#include <nvgpu/kmem.h> 25#include <nvgpu/kmem.h>
26#include <nvgpu/log.h> 26#include <nvgpu/log.h>
27#include <nvgpu/os_sched.h>
27 28
28#include "gk20a/gk20a.h" 29#include "gk20a/gk20a.h"
29#include "gk20a/tsg_gk20a.h" 30#include "gk20a/tsg_gk20a.h"
@@ -370,7 +371,7 @@ int nvgpu_ioctl_tsg_open(struct gk20a *g, struct file *filp)
370 goto free_ref; 371 goto free_ref;
371 } 372 }
372 373
373 tsg = gk20a_tsg_open(g); 374 tsg = gk20a_tsg_open(g, nvgpu_current_pid(g));
374 if (!tsg) { 375 if (!tsg) {
375 nvgpu_kfree(g, priv); 376 nvgpu_kfree(g, priv);
376 err = -ENOMEM; 377 err = -ENOMEM;