diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/Makefile | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_ctrl_t19x.c | 31 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_ctrl_t19x.h | 23 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv100/hal_gv100.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gv11b.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/enabled_t19x.h | 29 |
6 files changed, 91 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 0909a010..2edfa1bb 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile | |||
@@ -3,6 +3,7 @@ nvgpu-t19x := ../../../../nvgpu-t19x/drivers/gpu/nvgpu | |||
3 | nvgpu-y += \ | 3 | nvgpu-y += \ |
4 | $(nvgpu-t19x)/common/mm/gmmu_t19x.o \ | 4 | $(nvgpu-t19x)/common/mm/gmmu_t19x.o \ |
5 | $(nvgpu-t19x)/common/linux/ioctl_tsg_t19x.o \ | 5 | $(nvgpu-t19x)/common/linux/ioctl_tsg_t19x.o \ |
6 | $(nvgpu-t19x)/common/linux/ioctl_ctrl_t19x.o \ | ||
6 | $(nvgpu-t19x)/common/linux/io_t19x.o \ | 7 | $(nvgpu-t19x)/common/linux/io_t19x.o \ |
7 | $(nvgpu-t19x)/common/linux/module_t19x.o \ | 8 | $(nvgpu-t19x)/common/linux/module_t19x.o \ |
8 | $(nvgpu-t19x)/common/linux/pci_t19x.o \ | 9 | $(nvgpu-t19x)/common/linux/pci_t19x.o \ |
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl_t19x.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl_t19x.c new file mode 100644 index 00000000..56756ac9 --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl_t19x.c | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (c) 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 | |||
14 | #include <nvgpu/types.h> | ||
15 | #include <nvgpu/enabled.h> | ||
16 | #include <nvgpu/enabled_t19x.h> | ||
17 | |||
18 | #include "ioctl_ctrl_t19x.h" | ||
19 | #include "common/linux/os_linux.h" | ||
20 | #include "gk20a/gk20a.h" | ||
21 | |||
22 | u64 nvgpu_ctrl_ioctl_gpu_characteristics_flags_t19x(struct gk20a *g) | ||
23 | { | ||
24 | u64 ioctl_flags = 0; | ||
25 | |||
26 | if (nvgpu_is_enabled(g, NVGPU_SUPPORT_TSG_SUBCONTEXTS)) | ||
27 | ioctl_flags |= NVGPU_GPU_FLAGS_SUPPORT_TSG_SUBCONTEXTS; | ||
28 | |||
29 | return ioctl_flags; | ||
30 | } | ||
31 | |||
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl_t19x.h b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl_t19x.h new file mode 100644 index 00000000..64141223 --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl_t19x.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright (c) 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 | |||
14 | #ifndef _NVGPU_IOCTL_CTRL_T19X | ||
15 | #define _NVGPU_IOCTL_CTRL_T19X | ||
16 | |||
17 | #include <nvgpu/types.h> | ||
18 | |||
19 | struct gk20a; | ||
20 | |||
21 | u64 nvgpu_ctrl_ioctl_gpu_characteristics_flags_t19x(struct gk20a *g); | ||
22 | |||
23 | #endif | ||
diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index e8be1a43..e51b4446 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c | |||
@@ -107,6 +107,7 @@ | |||
107 | #include <nvgpu/bus.h> | 107 | #include <nvgpu/bus.h> |
108 | #include <nvgpu/debug.h> | 108 | #include <nvgpu/debug.h> |
109 | #include <nvgpu/enabled.h> | 109 | #include <nvgpu/enabled.h> |
110 | #include <nvgpu/enabled_t19x.h> | ||
110 | 111 | ||
111 | #include <nvgpu/hw/gv100/hw_proj_gv100.h> | 112 | #include <nvgpu/hw/gv100/hw_proj_gv100.h> |
112 | #include <nvgpu/hw/gv100/hw_fifo_gv100.h> | 113 | #include <nvgpu/hw/gv100/hw_fifo_gv100.h> |
@@ -221,16 +222,13 @@ static int gv100_get_litter_value(struct gk20a *g, int value) | |||
221 | 222 | ||
222 | int gv100_init_gpu_characteristics(struct gk20a *g) | 223 | int gv100_init_gpu_characteristics(struct gk20a *g) |
223 | { | 224 | { |
224 | struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics; | ||
225 | |||
226 | int err; | 225 | int err; |
227 | 226 | ||
228 | err = gk20a_init_gpu_characteristics(g); | 227 | err = gk20a_init_gpu_characteristics(g); |
229 | if (err) | 228 | if (err) |
230 | return err; | 229 | return err; |
231 | 230 | ||
232 | gpu->flags |= | 231 | __nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG_SUBCONTEXTS, true); |
233 | NVGPU_GPU_FLAGS_SUPPORT_TSG_SUBCONTEXTS; | ||
234 | 232 | ||
235 | return 0; | 233 | return 0; |
236 | } | 234 | } |
diff --git a/drivers/gpu/nvgpu/gv11b/gv11b.c b/drivers/gpu/nvgpu/gv11b/gv11b.c index c8691ad5..211755e5 100644 --- a/drivers/gpu/nvgpu/gv11b/gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gv11b.c | |||
@@ -22,6 +22,9 @@ | |||
22 | * DEALINGS IN THE SOFTWARE. | 22 | * DEALINGS IN THE SOFTWARE. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <nvgpu/enabled.h> | ||
26 | #include <nvgpu/enabled_t19x.h> | ||
27 | |||
25 | #include "gk20a/gk20a.h" | 28 | #include "gk20a/gk20a.h" |
26 | 29 | ||
27 | #include "gv11b/gv11b.h" | 30 | #include "gv11b/gv11b.h" |
@@ -29,8 +32,7 @@ | |||
29 | int gv11b_init_gpu_characteristics(struct gk20a *g) | 32 | int gv11b_init_gpu_characteristics(struct gk20a *g) |
30 | { | 33 | { |
31 | gk20a_init_gpu_characteristics(g); | 34 | gk20a_init_gpu_characteristics(g); |
32 | g->gpu_characteristics.flags |= | 35 | __nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG_SUBCONTEXTS, true); |
33 | NVGPU_GPU_FLAGS_SUPPORT_TSG_SUBCONTEXTS | | 36 | __nvgpu_set_enabled(g, NVGPU_SUPPORT_IO_COHERENCE, true); |
34 | NVGPU_GPU_FLAGS_SUPPORT_IO_COHERENCE; | ||
35 | return 0; | 37 | return 0; |
36 | } | 38 | } |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/enabled_t19x.h new file mode 100644 index 00000000..9ef1dc30 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled_t19x.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | |||
23 | #ifndef __NVGPU_ENABLED_T19X_H__ | ||
24 | #define __NVGPU_ENABLED_T19X_H__ | ||
25 | |||
26 | /* subcontexts are available */ | ||
27 | #define NVGPU_SUPPORT_TSG_SUBCONTEXTS 63 | ||
28 | |||
29 | #endif | ||