diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/Makefile | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c | 72 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.h | 28 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 4 |
4 files changed, 103 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/Makefile b/drivers/gpu/nvgpu/gp10b/Makefile index b2c143a6..3575d414 100644 --- a/drivers/gpu/nvgpu/gp10b/Makefile +++ b/drivers/gpu/nvgpu/gp10b/Makefile | |||
@@ -10,6 +10,7 @@ ccflags-$(CONFIG_GK20A) += -Wno-multichar | |||
10 | 10 | ||
11 | obj-$(CONFIG_GK20A) += \ | 11 | obj-$(CONFIG_GK20A) += \ |
12 | gr_gp10b.o \ | 12 | gr_gp10b.o \ |
13 | gr_ctx_gp10b.o \ | ||
13 | mc_gp10b.o \ | 14 | mc_gp10b.o \ |
14 | ltc_gp10b.o \ | 15 | ltc_gp10b.o \ |
15 | mm_gp10b.o \ | 16 | mm_gp10b.o \ |
diff --git a/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c new file mode 100644 index 00000000..1d77ad65 --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * drivers/video/tegra/host/gp10b/gr_ctx_gp10b.c | ||
3 | * | ||
4 | * GM20B Graphics Context | ||
5 | * | ||
6 | * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms and conditions of the GNU General Public License, | ||
10 | * version 2, as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
15 | * more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along with | ||
18 | * this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
20 | */ | ||
21 | |||
22 | #include "gk20a/gk20a.h" | ||
23 | #include "gr_ctx_gp10b.h" | ||
24 | |||
25 | static int gr_gp10b_get_netlist_name(int index, char *name) | ||
26 | { | ||
27 | switch (index) { | ||
28 | #ifdef GP10B_NETLIST_IMAGE_FW_NAME | ||
29 | case NETLIST_FINAL: | ||
30 | sprintf(name, GP10B_NETLIST_IMAGE_FW_NAME); | ||
31 | return 0; | ||
32 | #endif | ||
33 | #ifdef GK20A_NETLIST_IMAGE_A | ||
34 | case NETLIST_SLOT_A: | ||
35 | sprintf(name, GK20A_NETLIST_IMAGE_A); | ||
36 | return 0; | ||
37 | #endif | ||
38 | #ifdef GK20A_NETLIST_IMAGE_B | ||
39 | case NETLIST_SLOT_B: | ||
40 | sprintf(name, GK20A_NETLIST_IMAGE_B); | ||
41 | return 0; | ||
42 | #endif | ||
43 | #ifdef GK20A_NETLIST_IMAGE_C | ||
44 | case NETLIST_SLOT_C: | ||
45 | sprintf(name, GK20A_NETLIST_IMAGE_C); | ||
46 | return 0; | ||
47 | #endif | ||
48 | #ifdef GK20A_NETLIST_IMAGE_D | ||
49 | case NETLIST_SLOT_D: | ||
50 | sprintf(name, GK20A_NETLIST_IMAGE_D); | ||
51 | return 0; | ||
52 | #endif | ||
53 | default: | ||
54 | return -1; | ||
55 | } | ||
56 | |||
57 | return -1; | ||
58 | } | ||
59 | |||
60 | static bool gr_gp10b_is_firmware_defined(void) | ||
61 | { | ||
62 | #ifdef GM20B_NETLIST_IMAGE_FW_NAME | ||
63 | return true; | ||
64 | #else | ||
65 | return false; | ||
66 | #endif | ||
67 | } | ||
68 | |||
69 | void gp10b_init_gr_ctx(struct gpu_ops *gops) { | ||
70 | gops->gr_ctx.get_netlist_name = gr_gp10b_get_netlist_name; | ||
71 | gops->gr_ctx.is_fw_defined = gr_gp10b_is_firmware_defined; | ||
72 | } | ||
diff --git a/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.h new file mode 100644 index 00000000..b1184f9d --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * GP10B Graphics Context | ||
3 | * | ||
4 | * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
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, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | #ifndef __GR_CTX_GM10B_H__ | ||
19 | #define __GR_CTX_GM10B_H__ | ||
20 | |||
21 | #include "gk20a/gr_ctx_gk20a.h" | ||
22 | |||
23 | /* production netlist, one and only one from below */ | ||
24 | /*#undef GM20B_NETLIST_IMAGE_FW_NAME*/ | ||
25 | |||
26 | void gp10b_init_gr_ctx(struct gpu_ops *gops); | ||
27 | |||
28 | #endif /*__GR_CTX_GP10B_H__*/ | ||
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 526caff1..161c20c6 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c | |||
@@ -26,11 +26,11 @@ | |||
26 | #include "gp10b/mm_gp10b.h" | 26 | #include "gp10b/mm_gp10b.h" |
27 | #include "gp10b/fb_gp10b.h" | 27 | #include "gp10b/fb_gp10b.h" |
28 | #include "gp10b/pmu_gp10b.h" | 28 | #include "gp10b/pmu_gp10b.h" |
29 | #include "gp10b/gr_ctx_gp10b.h" | ||
29 | 30 | ||
30 | #include "gm20b/gr_gm20b.h" | 31 | #include "gm20b/gr_gm20b.h" |
31 | #include "gm20b/gm20b_gating_reglist.h" | 32 | #include "gm20b/gm20b_gating_reglist.h" |
32 | #include "gm20b/fifo_gm20b.h" | 33 | #include "gm20b/fifo_gm20b.h" |
33 | #include "gm20b/gr_ctx_gm20b.h" | ||
34 | #include "gm20b/pmu_gm20b.h" | 34 | #include "gm20b/pmu_gm20b.h" |
35 | #include "gm20b/clk_gm20b.h" | 35 | #include "gm20b/clk_gm20b.h" |
36 | 36 | ||
@@ -94,7 +94,7 @@ int gp10b_init_hal(struct gk20a *g) | |||
94 | gp10b_init_ltc(gops); | 94 | gp10b_init_ltc(gops); |
95 | gp10b_init_fb(gops); | 95 | gp10b_init_fb(gops); |
96 | gm20b_init_fifo(gops); | 96 | gm20b_init_fifo(gops); |
97 | gm20b_init_gr_ctx(gops); | 97 | gp10b_init_gr_ctx(gops); |
98 | gp10b_init_mm(gops); | 98 | gp10b_init_mm(gops); |
99 | gp10b_init_pmu_ops(gops); | 99 | gp10b_init_pmu_ops(gops); |
100 | gm20b_init_clk_ops(gops); | 100 | gm20b_init_clk_ops(gops); |