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 | |
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')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/Makefile | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c | 72 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.h | 29 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 2 |
4 files changed, 104 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/Makefile b/drivers/gpu/nvgpu/gm20b/Makefile index b779373d..4c1db0c2 100644 --- a/drivers/gpu/nvgpu/gm20b/Makefile +++ b/drivers/gpu/nvgpu/gm20b/Makefile | |||
@@ -9,4 +9,5 @@ obj-$(CONFIG_GK20A) = \ | |||
9 | gr_gm20b.o \ | 9 | gr_gm20b.o \ |
10 | fb_gm20b.o \ | 10 | fb_gm20b.o \ |
11 | fifo_gm20b.o \ | 11 | fifo_gm20b.o \ |
12 | gr_ctx_gm20b.o \ | ||
12 | gm20b_gating_reglist.o | 13 | gm20b_gating_reglist.o |
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 | } | ||
diff --git a/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.h b/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.h new file mode 100644 index 00000000..7f2d0c06 --- /dev/null +++ b/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * GM20B Graphics Context | ||
3 | * | ||
4 | * Copyright (c) 2014, 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_GM20B_H__ | ||
19 | #define __GR_CTX_GM20B_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 | #define GM20B_NETLIST_IMAGE_FW_NAME GK20A_NETLIST_IMAGE_C | ||
26 | |||
27 | void gm20b_init_gr_ctx(struct gpu_ops *gops); | ||
28 | |||
29 | #endif /*__GR_CTX_GM20B_H__*/ | ||
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index da633b9f..7e390c37 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "fb_gm20b.h" | 23 | #include "fb_gm20b.h" |
24 | #include "gm20b_gating_reglist.h" | 24 | #include "gm20b_gating_reglist.h" |
25 | #include "fifo_gm20b.h" | 25 | #include "fifo_gm20b.h" |
26 | #include "gr_ctx_gm20b.h" | ||
26 | 27 | ||
27 | struct gpu_ops gm20b_ops = { | 28 | struct gpu_ops gm20b_ops = { |
28 | .clock_gating = { | 29 | .clock_gating = { |
@@ -47,6 +48,7 @@ int gm20b_init_hal(struct gpu_ops *gops) | |||
47 | gm20b_init_ltc(gops); | 48 | gm20b_init_ltc(gops); |
48 | gm20b_init_fb(gops); | 49 | gm20b_init_fb(gops); |
49 | gm20b_init_fifo(gops); | 50 | gm20b_init_fifo(gops); |
51 | gm20b_init_gr_ctx(gops); | ||
50 | gops->name = "gm20b"; | 52 | gops->name = "gm20b"; |
51 | 53 | ||
52 | return 0; | 54 | return 0; |