summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-26 13:47:16 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-27 19:34:43 -0400
commit6431ec360bf7b7baf6dd687b1525c40114ede189 (patch)
treef899b3e215bf87cc411cefaf54c9b6011e487eb4 /drivers/gpu/nvgpu/gk20a
parent9907b97985c47003a179c4357274b737cc0699ee (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/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c4
2 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 8135f05e..90c35a7b 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -663,7 +663,6 @@ struct gpu_ops {
663 struct { 663 struct {
664 int (*get_netlist_name)(struct gk20a *g, int index, char *name); 664 int (*get_netlist_name)(struct gk20a *g, int index, char *name);
665 bool (*is_fw_defined)(void); 665 bool (*is_fw_defined)(void);
666 bool use_dma_for_fw_bootstrap;
667 } gr_ctx; 666 } gr_ctx;
668 struct { 667 struct {
669 int (*init)(struct gk20a *g); 668 int (*init)(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index d7c80b91..037f0df4 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -2367,7 +2367,7 @@ int gr_gk20a_load_ctxsw_ucode(struct gk20a *g)
2367 * In case bootloader is not supported, revert to the old way of 2367 * In case bootloader is not supported, revert to the old way of
2368 * loading gr ucode, without the faster bootstrap routine. 2368 * loading gr ucode, without the faster bootstrap routine.
2369 */ 2369 */
2370 if (!g->ops.gr_ctx.use_dma_for_fw_bootstrap) { 2370 if (!nvgpu_is_enabled(g, NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP)) {
2371 gr_gk20a_load_falcon_dmem(g); 2371 gr_gk20a_load_falcon_dmem(g);
2372 gr_gk20a_load_falcon_imem(g); 2372 gr_gk20a_load_falcon_imem(g);
2373 gr_gk20a_start_falcon_ucode(g); 2373 gr_gk20a_start_falcon_ucode(g);
@@ -2400,7 +2400,7 @@ static int gr_gk20a_wait_ctxsw_ready(struct gk20a *g)
2400 return ret; 2400 return ret;
2401 } 2401 }
2402 2402
2403 if (g->ops.gr_ctx.use_dma_for_fw_bootstrap || 2403 if (nvgpu_is_enabled(g, NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP) ||
2404 nvgpu_is_enabled(g, NVGPU_SEC_SECUREGPCCS)) 2404 nvgpu_is_enabled(g, NVGPU_SEC_SECUREGPCCS))
2405 gk20a_writel(g, gr_fecs_current_ctx_r(), 2405 gk20a_writel(g, gr_fecs_current_ctx_r(),
2406 gr_fecs_current_ctx_valid_false_f()); 2406 gr_fecs_current_ctx_valid_false_f());