diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-12-27 05:01:00 -0500 |
---|---|---|
committer | Deepak Nibade <dnibade@nvidia.com> | 2016-12-27 05:35:06 -0500 |
commit | 7a81883a0d70c3a43ad2841ac235f6dc344c60fb (patch) | |
tree | 92923d2efccf90d1961071fa9acde59178a0d688 /drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c | |
parent | 505b442551a2e27aa3bc9e608c5a2bc9fccecbc4 (diff) | |
parent | 2aa3c85f8e82b3c07c39e677663abd3687c1822a (diff) |
Merge remote-tracking branch 'remotes/origin/dev/merge-nvgpu-t18x-into-nvgpu' into dev-kernel
Merge T186 - gp10b/gp106 code into common nvgpu repo
Bug 200266498
Change-Id: Ibf100ee38010cbed85c149b69b99147256f9a005
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c | 73 |
1 files changed, 73 insertions, 0 deletions
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..2bb4a313 --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * drivers/video/tegra/host/gp10b/gr_ctx_gp10b.c | ||
3 | * | ||
4 | * GM20B Graphics Context | ||
5 | * | ||
6 | * Copyright (c) 2015, 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(struct gk20a *g, 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 GP10B_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 | gops->gr_ctx.use_dma_for_fw_bootstrap = true; | ||
73 | } | ||