summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-31 21:54:38 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-14 18:55:19 -0400
commit959c02d6757c3c40748f7d2db1515885a5066a12 (patch)
tree58b685a52bc8b543565645227219c1c9609a50b3 /drivers/gpu/nvgpu/gp10b/hal_gp10b.c
parentee60394abc9a52182892ab54554d3e9c841080bf (diff)
gpu: nvgpu: Reorg mm HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the mm 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: Ieb87a62f047510e51c52e6563d8e3fd5a65b5f28 Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1537753 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/hal_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index b0871155..a37295bb 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -17,6 +17,7 @@
17#include "gk20a/fifo_gk20a.h" 17#include "gk20a/fifo_gk20a.h"
18#include "gk20a/ctxsw_trace_gk20a.h" 18#include "gk20a/ctxsw_trace_gk20a.h"
19#include "gk20a/fecs_trace_gk20a.h" 19#include "gk20a/fecs_trace_gk20a.h"
20#include "gk20a/mm_gk20a.h"
20#include "gk20a/dbg_gpu_gk20a.h" 21#include "gk20a/dbg_gpu_gk20a.h"
21#include "gk20a/css_gr_gk20a.h" 22#include "gk20a/css_gr_gk20a.h"
22#include "gk20a/bus_gk20a.h" 23#include "gk20a/bus_gk20a.h"
@@ -47,8 +48,8 @@
47#include "gm20b/fifo_gm20b.h" 48#include "gm20b/fifo_gm20b.h"
48#include "gm20b/pmu_gm20b.h" 49#include "gm20b/pmu_gm20b.h"
49#include "gm20b/clk_gm20b.h" 50#include "gm20b/clk_gm20b.h"
50#include "gm20b/fifo_gm20b.h"
51#include "gm20b/fb_gm20b.h" 51#include "gm20b/fb_gm20b.h"
52#include "gm20b/mm_gm20b.h"
52 53
53#include "gp10b.h" 54#include "gp10b.h"
54#include "hal_gp10b.h" 55#include "hal_gp10b.h"
@@ -319,6 +320,30 @@ static const struct gpu_ops gp10b_ops = {
319 .max_entries = gk20a_gr_max_entries, 320 .max_entries = gk20a_gr_max_entries,
320 }, 321 },
321#endif /* CONFIG_GK20A_CTXSW_TRACE */ 322#endif /* CONFIG_GK20A_CTXSW_TRACE */
323 .mm = {
324 .support_sparse = gm20b_mm_support_sparse,
325 .gmmu_map = gk20a_locked_gmmu_map,
326 .gmmu_unmap = gk20a_locked_gmmu_unmap,
327 .vm_bind_channel = gk20a_vm_bind_channel,
328 .fb_flush = gk20a_mm_fb_flush,
329 .l2_invalidate = gk20a_mm_l2_invalidate,
330 .l2_flush = gk20a_mm_l2_flush,
331 .cbc_clean = gk20a_mm_cbc_clean,
332 .set_big_page_size = gm20b_mm_set_big_page_size,
333 .get_big_page_sizes = gm20b_mm_get_big_page_sizes,
334 .get_default_big_page_size = gp10b_mm_get_default_big_page_size,
335 .gpu_phys_addr = gm20b_gpu_phys_addr,
336 .get_physical_addr_bits = gp10b_mm_get_physical_addr_bits,
337 .get_mmu_levels = gp10b_mm_get_mmu_levels,
338 .init_pdb = gp10b_mm_init_pdb,
339 .init_mm_setup_hw = gp10b_init_mm_setup_hw,
340 .is_bar1_supported = gm20b_mm_is_bar1_supported,
341 .init_inst_block = gk20a_init_inst_block,
342 .mmu_fault_pending = gk20a_fifo_mmu_fault_pending,
343 .init_bar2_vm = gb10b_init_bar2_vm,
344 .init_bar2_mm_hw_setup = gb10b_init_bar2_mm_hw_setup,
345 .remove_bar2_vm = gp10b_remove_bar2_vm,
346 },
322 .pramin = { 347 .pramin = {
323 .enter = gk20a_pramin_enter, 348 .enter = gk20a_pramin_enter,
324 .exit = gk20a_pramin_exit, 349 .exit = gk20a_pramin_exit,
@@ -427,6 +452,7 @@ int gp10b_init_hal(struct gk20a *g)
427 gops->fifo = gp10b_ops.fifo; 452 gops->fifo = gp10b_ops.fifo;
428 gops->gr_ctx = gp10b_ops.gr_ctx; 453 gops->gr_ctx = gp10b_ops.gr_ctx;
429 gops->fecs_trace = gp10b_ops.fecs_trace; 454 gops->fecs_trace = gp10b_ops.fecs_trace;
455 gops->mm = gp10b_ops.mm;
430 gops->pramin = gp10b_ops.pramin; 456 gops->pramin = gp10b_ops.pramin;
431 gops->therm = gp10b_ops.therm; 457 gops->therm = gp10b_ops.therm;
432 gops->regops = gp10b_ops.regops; 458 gops->regops = gp10b_ops.regops;
@@ -489,7 +515,6 @@ int gp10b_init_hal(struct gk20a *g)
489 515
490 g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT; 516 g->bootstrap_owner = LSF_BOOTSTRAP_OWNER_DEFAULT;
491 gp10b_init_gr(g); 517 gp10b_init_gr(g);
492 gp10b_init_mm(gops);
493 gp10b_init_pmu_ops(g); 518 gp10b_init_pmu_ops(g);
494 519
495 gp10b_init_uncompressed_kind_map(); 520 gp10b_init_uncompressed_kind_map();