diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/driver_common.c | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/driver_common.h | 22 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/pci.c | 2 |
4 files changed, 38 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c index b7444a9e..0dd0d62c 100644 --- a/drivers/gpu/nvgpu/common/linux/driver_common.c +++ b/drivers/gpu/nvgpu/common/linux/driver_common.c | |||
@@ -274,3 +274,15 @@ void nvgpu_wait_for_deferred_interrupts(struct gk20a *g) | |||
274 | atomic_read(&l->sw_irq_nonstall_last_handled)) | 274 | atomic_read(&l->sw_irq_nonstall_last_handled)) |
275 | <= 0, 0); | 275 | <= 0, 0); |
276 | } | 276 | } |
277 | |||
278 | static void nvgpu_free_gk20a(struct gk20a *g) | ||
279 | { | ||
280 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | ||
281 | |||
282 | kfree(l); | ||
283 | } | ||
284 | |||
285 | void nvgpu_init_gk20a(struct gk20a *g) | ||
286 | { | ||
287 | g->free = nvgpu_free_gk20a; | ||
288 | } | ||
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.h b/drivers/gpu/nvgpu/common/linux/driver_common.h new file mode 100644 index 00000000..6f42f775 --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/driver_common.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
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, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef NVGPU_LINUX_DRIVER_COMMON | ||
18 | #define NVGPU_LINUX_DRIVER_COMMON | ||
19 | |||
20 | void nvgpu_init_gk20a(struct gk20a *g); | ||
21 | |||
22 | #endif | ||
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index 4aff6a2d..4841b032 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include "cde_gm20b.h" | 53 | #include "cde_gm20b.h" |
54 | #include "cde_gp10b.h" | 54 | #include "cde_gp10b.h" |
55 | #include "ctxsw_trace.h" | 55 | #include "ctxsw_trace.h" |
56 | #include "driver_common.h" | ||
56 | 57 | ||
57 | #define CLASS_NAME "nvidia-gpu" | 58 | #define CLASS_NAME "nvidia-gpu" |
58 | /* TODO: Change to e.g. "nvidia-gpu%s" once we have symlinks in place. */ | 59 | /* TODO: Change to e.g. "nvidia-gpu%s" once we have symlinks in place. */ |
@@ -1027,6 +1028,7 @@ static int gk20a_probe(struct platform_device *dev) | |||
1027 | } | 1028 | } |
1028 | 1029 | ||
1029 | gk20a = &l->g; | 1030 | gk20a = &l->g; |
1031 | nvgpu_init_gk20a(gk20a); | ||
1030 | set_gk20a(dev, gk20a); | 1032 | set_gk20a(dev, gk20a); |
1031 | l->dev = &dev->dev; | 1033 | l->dev = &dev->dev; |
1032 | gk20a->log_mask = NVGPU_DEFAULT_DBG_MASK; | 1034 | gk20a->log_mask = NVGPU_DEFAULT_DBG_MASK; |
diff --git a/drivers/gpu/nvgpu/common/linux/pci.c b/drivers/gpu/nvgpu/common/linux/pci.c index 118567e5..296d0a7c 100644 --- a/drivers/gpu/nvgpu/common/linux/pci.c +++ b/drivers/gpu/nvgpu/common/linux/pci.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #include "os_linux.h" | 39 | #include "os_linux.h" |
40 | #include "driver_common.h" | ||
40 | 41 | ||
41 | #define PCI_INTERFACE_NAME "card-%s%%s" | 42 | #define PCI_INTERFACE_NAME "card-%s%%s" |
42 | 43 | ||
@@ -457,6 +458,7 @@ static int nvgpu_pci_probe(struct pci_dev *pdev, | |||
457 | } | 458 | } |
458 | 459 | ||
459 | g = &l->g; | 460 | g = &l->g; |
461 | nvgpu_init_gk20a(g); | ||
460 | 462 | ||
461 | nvgpu_kmem_init(g); | 463 | nvgpu_kmem_init(g); |
462 | 464 | ||