From c84ddceda648d6e47828115654ca7745010ec09f Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Thu, 14 Apr 2016 13:01:58 -0700 Subject: gpu: nvgpu: gv11b: sm priv reg related changes Included all basic ops for gv11b and updated sm related functions to include new priv register addresses. Bug 1735757 Change-Id: Ie48651f918ee97fba00487111e4b28d6c95747f5 Signed-off-by: Seshendra Gadagottu Reviewed-on: http://git-master/r/1126961 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c | 72 ++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c (limited to 'drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c new file mode 100644 index 00000000..3fb0fa23 --- /dev/null +++ b/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c @@ -0,0 +1,72 @@ +/* + * + * GV11B Graphics Context + * + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "gk20a/gk20a.h" +#include "gr_ctx_gv11b.h" + +static int gr_gv11b_get_netlist_name(int index, char *name) +{ + switch (index) { +#ifdef GV11B_NETLIST_IMAGE_FW_NAME + case NETLIST_FINAL: + sprintf(name, GV11B_NETLIST_IMAGE_FW_NAME); + return 0; +#endif +#ifdef GK20A_NETLIST_IMAGE_A + case NETLIST_SLOT_A: + sprintf(name, GK20A_NETLIST_IMAGE_A); + return 0; +#endif +#ifdef GK20A_NETLIST_IMAGE_B + case NETLIST_SLOT_B: + sprintf(name, GK20A_NETLIST_IMAGE_B); + return 0; +#endif +#ifdef GK20A_NETLIST_IMAGE_C + case NETLIST_SLOT_C: + sprintf(name, GK20A_NETLIST_IMAGE_C); + return 0; +#endif +#ifdef GK20A_NETLIST_IMAGE_D + case NETLIST_SLOT_D: + sprintf(name, GK20A_NETLIST_IMAGE_D); + return 0; +#endif + default: + return -1; + } + + return -1; +} + +static bool gr_gv11b_is_firmware_defined(void) +{ +#ifdef GV11B_NETLIST_IMAGE_FW_NAME + return true; +#else + return false; +#endif +} + +void gv11b_init_gr_ctx(struct gpu_ops *gops) { + gops->gr_ctx.get_netlist_name = gr_gv11b_get_netlist_name; + gops->gr_ctx.is_fw_defined = gr_gv11b_is_firmware_defined; + gops->gr_ctx.use_dma_for_fw_bootstrap = false; +} -- cgit v1.2.2 From 4e476b2f9a4d877f105139b14bcc3f682a97df45 Mon Sep 17 00:00:00 2001 From: Mahantesh Kumbar Date: Fri, 17 Jun 2016 16:33:28 +0530 Subject: gpu: nvgpu: update gr_gv11b_get_netlist_name method update gr_gv11b_get_netlist_name method as per ops get_netlist_name declaration Change-Id: Ide79d999564f489a80cff748ff61e42aabd5662a Signed-off-by: Mahantesh Kumbar Reviewed-on: http://git-master/r/1166905 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c index 3fb0fa23..032e0c3e 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c @@ -21,7 +21,7 @@ #include "gk20a/gk20a.h" #include "gr_ctx_gv11b.h" -static int gr_gv11b_get_netlist_name(int index, char *name) +static int gr_gv11b_get_netlist_name(struct gk20a *g, int index, char *name) { switch (index) { #ifdef GV11B_NETLIST_IMAGE_FW_NAME -- cgit v1.2.2 From 4b09997772f406d16945016ff4581c7c992faeab Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 12 Jan 2017 13:01:36 -0800 Subject: nvgpu: gpu: HW header update for Volta Similar HW header update as has been done for all the other chips. HW header files are located under: drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/ And can be included like so: #include Bug 1799159 Change-Id: If39bd71480a34f85bf25f4c36aec0f8f6de4dc9f Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1284433 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c index 032e0c3e..6cb42baa 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c @@ -19,6 +19,7 @@ */ #include "gk20a/gk20a.h" + #include "gr_ctx_gv11b.h" static int gr_gv11b_get_netlist_name(struct gk20a *g, int index, char *name) -- cgit v1.2.2 From afa29933e45b2c3054db67065a0a68606bbc1f52 Mon Sep 17 00:00:00 2001 From: Sunny He Date: Wed, 26 Jul 2017 10:45:38 -0700 Subject: gpu: nvgpu: gv11b: Reorg gr_ctx HAL initialization Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the gr_ctx sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: Icc6b0f968f2e3209de190d445c878a4b20bfcf4a Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1527418 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c index 6cb42baa..920e4c16 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c @@ -2,7 +2,7 @@ * * GV11B Graphics Context * - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -22,7 +22,7 @@ #include "gr_ctx_gv11b.h" -static int gr_gv11b_get_netlist_name(struct gk20a *g, int index, char *name) +int gr_gv11b_get_netlist_name(struct gk20a *g, int index, char *name) { switch (index) { #ifdef GV11B_NETLIST_IMAGE_FW_NAME @@ -57,7 +57,7 @@ static int gr_gv11b_get_netlist_name(struct gk20a *g, int index, char *name) return -1; } -static bool gr_gv11b_is_firmware_defined(void) +bool gr_gv11b_is_firmware_defined(void) { #ifdef GV11B_NETLIST_IMAGE_FW_NAME return true; @@ -65,9 +65,3 @@ static bool gr_gv11b_is_firmware_defined(void) return false; #endif } - -void gv11b_init_gr_ctx(struct gpu_ops *gops) { - gops->gr_ctx.get_netlist_name = gr_gv11b_get_netlist_name; - gops->gr_ctx.is_fw_defined = gr_gv11b_is_firmware_defined; - gops->gr_ctx.use_dma_for_fw_bootstrap = false; -} -- cgit v1.2.2 From d61643c0200983dc340d37962bb0a3ca900a3e97 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 25 Sep 2017 08:59:28 -0700 Subject: gpu: nvgpu: gv11b: Change license for common files to MIT Change license of OS independent source code files to MIT. JIRA NVGPU-218 Change-Id: I93c0504f0544ee8ced4898c386b3f5fbaa6a99a9 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1567804 Reviewed-by: svc-mobile-coverity Reviewed-by: David Martinez Nieto Reviewed-by: Seshendra Gadagottu Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c index 920e4c16..514aadb1 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_ctx_gv11b.c @@ -4,18 +4,23 @@ * * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ #include "gk20a/gk20a.h" -- cgit v1.2.2