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