From 6431ec360bf7b7baf6dd687b1525c40114ede189 Mon Sep 17 00:00:00 2001 From: Sunny He Date: Wed, 26 Jul 2017 10:47:16 -0700 Subject: gpu: nvgpu: 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: I783d8e8919d8694ad2aa0d285e4c5a2b62580f48 Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1527417 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c index e22acbe3..555c1409 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c @@ -3,7 +3,7 @@ * * GM20B Graphics Context * - * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-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 "gk20a/gk20a.h" #include "gr_ctx_gm20b.h" -static int gr_gm20b_get_netlist_name(struct gk20a *g, int index, char *name) +int gr_gm20b_get_netlist_name(struct gk20a *g, int index, char *name) { switch (index) { #ifdef GM20B_NETLIST_IMAGE_FW_NAME @@ -57,7 +57,7 @@ static int gr_gm20b_get_netlist_name(struct gk20a *g, int index, char *name) return -1; } -static bool gr_gm20b_is_firmware_defined(void) +bool gr_gm20b_is_firmware_defined(void) { #ifdef GM20B_NETLIST_IMAGE_FW_NAME return true; @@ -65,9 +65,3 @@ static bool gr_gm20b_is_firmware_defined(void) return false; #endif } - -void gm20b_init_gr_ctx(struct gpu_ops *gops) { - gops->gr_ctx.get_netlist_name = gr_gm20b_get_netlist_name; - gops->gr_ctx.is_fw_defined = gr_gm20b_is_firmware_defined; - gops->gr_ctx.use_dma_for_fw_bootstrap = true; -} -- cgit v1.2.2