summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-01-22 11:02:21 -0500
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:52:03 -0500
commit667143ed939494f311ba45e3cfd89546e625bbca (patch)
tree5fae3d0947590272c86980aad26899ca0f4ec2a6 /drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c
parent0cb992afd76e2748d5ae5759914352d1a3ece7e7 (diff)
gpu: nvgpu: gp10b: Enable cycling through ctx bins
Remove hard coded NETB for gp10b. This enables cycling through available firmware files. Change-Id: I60765a05b1cf6c2e6003341f611c5ecc3f16e9b7 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/676557 Reviewed-by: Peng Du <pdu@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c72
1 files changed, 72 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..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
25static 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
60static 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
69void 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}