diff options
author | Sunny He <suhe@nvidia.com> | 2017-07-26 13:47:16 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-27 19:34:43 -0400 |
commit | 6431ec360bf7b7baf6dd687b1525c40114ede189 (patch) | |
tree | f899b3e215bf87cc411cefaf54c9b6011e487eb4 /drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c | |
parent | 9907b97985c47003a179c4357274b737cc0699ee (diff) |
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 <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1527417
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_ctx_gm20b.c | 12 |
1 files changed, 3 insertions, 9 deletions
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 @@ | |||
3 | * | 3 | * |
4 | * GM20B Graphics Context | 4 | * GM20B Graphics Context |
5 | * | 5 | * |
6 | * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. | 6 | * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify it | 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, | 9 | * under the terms and conditions of the GNU General Public License, |
@@ -22,7 +22,7 @@ | |||
22 | #include "gk20a/gk20a.h" | 22 | #include "gk20a/gk20a.h" |
23 | #include "gr_ctx_gm20b.h" | 23 | #include "gr_ctx_gm20b.h" |
24 | 24 | ||
25 | static int gr_gm20b_get_netlist_name(struct gk20a *g, int index, char *name) | 25 | int gr_gm20b_get_netlist_name(struct gk20a *g, int index, char *name) |
26 | { | 26 | { |
27 | switch (index) { | 27 | switch (index) { |
28 | #ifdef GM20B_NETLIST_IMAGE_FW_NAME | 28 | #ifdef GM20B_NETLIST_IMAGE_FW_NAME |
@@ -57,7 +57,7 @@ static int gr_gm20b_get_netlist_name(struct gk20a *g, int index, char *name) | |||
57 | return -1; | 57 | return -1; |
58 | } | 58 | } |
59 | 59 | ||
60 | static bool gr_gm20b_is_firmware_defined(void) | 60 | bool gr_gm20b_is_firmware_defined(void) |
61 | { | 61 | { |
62 | #ifdef GM20B_NETLIST_IMAGE_FW_NAME | 62 | #ifdef GM20B_NETLIST_IMAGE_FW_NAME |
63 | return true; | 63 | return true; |
@@ -65,9 +65,3 @@ static bool gr_gm20b_is_firmware_defined(void) | |||
65 | return false; | 65 | return false; |
66 | #endif | 66 | #endif |
67 | } | 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 | gops->gr_ctx.use_dma_for_fw_bootstrap = true; | ||
73 | } | ||