diff options
author | Kevin Huang <kevinh@nvidia.com> | 2014-03-26 20:40:27 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:09:40 -0400 |
commit | c66d70c8699b948da5ca22501a29643c31b5348a (patch) | |
tree | 4c102c6d87e64de0875ed71049df3b7520548c01 /drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c | |
parent | f66cb9093d3ec74f18cc52ee44de88c9501e2cca (diff) |
video: tegra: host: select NETC for gm20b
Change-Id: I6e7b5e77907033c7e7cbcc32cae200d46a3700ea
Signed-off-by: Kevin Huang <kevinh@nvidia.com>
Reviewed-on: http://git-master/r/387381
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/397712
Reviewed-by: Bo Yan <byan@nvidia.com>
Tested-by: Bo Yan <byan@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c new file mode 100644 index 00000000..0309e110 --- /dev/null +++ b/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * drivers/video/tegra/host/gm20b/gr_ctx_gm20b.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_gm20b.h" | ||
24 | |||
25 | static int gr_gm20b_get_netlist_name(int index, char *name) | ||
26 | { | ||
27 | switch (index) { | ||
28 | #ifdef GM20B_NETLIST_IMAGE_FW_NAME | ||
29 | case NETLIST_FINAL: | ||
30 | sprintf(name, GM20B_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 | bool gr_gm20b_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 gm20b_init_gr_ctx(struct gpu_ops *gops) { | ||
70 | gops->gr_ctx.get_netlist_name = gr_gm20b_get_netlist_name; | ||
71 | gops->gr_ctx.is_fw_defined = gr_gm20b_is_firmware_defined; | ||
72 | } | ||