diff options
author | Sunny He <suhe@nvidia.com> | 2017-08-17 19:11:34 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-24 12:34:43 -0400 |
commit | 4b5b67d6d83430d8d670660b1dfc9cf024d60d88 (patch) | |
tree | 541a421438fe849ee4b1ab9e6bdfa9e8b6ee4485 /drivers/gpu/nvgpu/gp10b/gr_gp10b.c | |
parent | 82ba1277f3da7379ed6b8288c04bb91db008549c (diff) |
gpu: nvgpu: Reorg gr HAL initialization
Reorganize HAL initialization to remove inheritance and construct
the gpu_ops struct at compile time. This patch only covers the
gr 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: Ie37638f442fd68aca8a7ade5f297118447bdc91e
Signed-off-by: Sunny He <suhe@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1542989
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 136 |
1 files changed, 40 insertions, 96 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 05fbeb21..74af9817 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c | |||
@@ -41,7 +41,7 @@ | |||
41 | 41 | ||
42 | #define NVGPU_GFXP_WFI_TIMEOUT_US 100LL | 42 | #define NVGPU_GFXP_WFI_TIMEOUT_US 100LL |
43 | 43 | ||
44 | static bool gr_gp10b_is_valid_class(struct gk20a *g, u32 class_num) | 44 | bool gr_gp10b_is_valid_class(struct gk20a *g, u32 class_num) |
45 | { | 45 | { |
46 | bool valid = false; | 46 | bool valid = false; |
47 | 47 | ||
@@ -67,7 +67,7 @@ static bool gr_gp10b_is_valid_class(struct gk20a *g, u32 class_num) | |||
67 | return valid; | 67 | return valid; |
68 | } | 68 | } |
69 | 69 | ||
70 | static bool gr_gp10b_is_valid_gfx_class(struct gk20a *g, u32 class_num) | 70 | bool gr_gp10b_is_valid_gfx_class(struct gk20a *g, u32 class_num) |
71 | { | 71 | { |
72 | if (class_num == PASCAL_A || class_num == MAXWELL_B) | 72 | if (class_num == PASCAL_A || class_num == MAXWELL_B) |
73 | return true; | 73 | return true; |
@@ -75,7 +75,7 @@ static bool gr_gp10b_is_valid_gfx_class(struct gk20a *g, u32 class_num) | |||
75 | return false; | 75 | return false; |
76 | } | 76 | } |
77 | 77 | ||
78 | static bool gr_gp10b_is_valid_compute_class(struct gk20a *g, u32 class_num) | 78 | bool gr_gp10b_is_valid_compute_class(struct gk20a *g, u32 class_num) |
79 | { | 79 | { |
80 | if (class_num == PASCAL_COMPUTE_A || class_num == MAXWELL_COMPUTE_B) | 80 | if (class_num == PASCAL_COMPUTE_A || class_num == MAXWELL_COMPUTE_B) |
81 | return true; | 81 | return true; |
@@ -119,7 +119,7 @@ static void gr_gp10b_sm_lrf_ecc_overcount_war(int single_err, | |||
119 | *count_to_adjust = 0; | 119 | *count_to_adjust = 0; |
120 | } | 120 | } |
121 | 121 | ||
122 | static int gr_gp10b_handle_sm_exception(struct gk20a *g, | 122 | int gr_gp10b_handle_sm_exception(struct gk20a *g, |
123 | u32 gpc, u32 tpc, u32 sm, | 123 | u32 gpc, u32 tpc, u32 sm, |
124 | bool *post_event, struct channel_gk20a *fault_ch, | 124 | bool *post_event, struct channel_gk20a *fault_ch, |
125 | u32 *hww_global_esr) | 125 | u32 *hww_global_esr) |
@@ -244,7 +244,7 @@ static int gr_gp10b_handle_sm_exception(struct gk20a *g, | |||
244 | return ret; | 244 | return ret; |
245 | } | 245 | } |
246 | 246 | ||
247 | static int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc, | 247 | int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc, |
248 | bool *post_event) | 248 | bool *post_event) |
249 | { | 249 | { |
250 | int ret = 0; | 250 | int ret = 0; |
@@ -380,7 +380,7 @@ static int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc, | |||
380 | return ret; | 380 | return ret; |
381 | } | 381 | } |
382 | 382 | ||
383 | static int gr_gp10b_commit_global_cb_manager(struct gk20a *g, | 383 | int gr_gp10b_commit_global_cb_manager(struct gk20a *g, |
384 | struct channel_gk20a *c, bool patch) | 384 | struct channel_gk20a *c, bool patch) |
385 | { | 385 | { |
386 | struct gr_gk20a *gr = &g->gr; | 386 | struct gr_gk20a *gr = &g->gr; |
@@ -481,7 +481,7 @@ static int gr_gp10b_commit_global_cb_manager(struct gk20a *g, | |||
481 | return 0; | 481 | return 0; |
482 | } | 482 | } |
483 | 483 | ||
484 | static void gr_gp10b_commit_global_pagepool(struct gk20a *g, | 484 | void gr_gp10b_commit_global_pagepool(struct gk20a *g, |
485 | struct channel_ctx_gk20a *ch_ctx, | 485 | struct channel_ctx_gk20a *ch_ctx, |
486 | u64 addr, u32 size, bool patch) | 486 | u64 addr, u32 size, bool patch) |
487 | { | 487 | { |
@@ -499,7 +499,7 @@ static void gr_gp10b_commit_global_pagepool(struct gk20a *g, | |||
499 | gr_gpcs_gcc_pagepool_total_pages_f(size), patch); | 499 | gr_gpcs_gcc_pagepool_total_pages_f(size), patch); |
500 | } | 500 | } |
501 | 501 | ||
502 | static int gr_gp10b_add_zbc_color(struct gk20a *g, struct gr_gk20a *gr, | 502 | int gr_gp10b_add_zbc_color(struct gk20a *g, struct gr_gk20a *gr, |
503 | struct zbc_entry *color_val, u32 index) | 503 | struct zbc_entry *color_val, u32 index) |
504 | { | 504 | { |
505 | u32 i; | 505 | u32 i; |
@@ -554,7 +554,7 @@ static int gr_gp10b_add_zbc_color(struct gk20a *g, struct gr_gk20a *gr, | |||
554 | return 0; | 554 | return 0; |
555 | } | 555 | } |
556 | 556 | ||
557 | static int gr_gp10b_add_zbc_depth(struct gk20a *g, struct gr_gk20a *gr, | 557 | int gr_gp10b_add_zbc_depth(struct gk20a *g, struct gr_gk20a *gr, |
558 | struct zbc_entry *depth_val, u32 index) | 558 | struct zbc_entry *depth_val, u32 index) |
559 | { | 559 | { |
560 | u32 zbc_z; | 560 | u32 zbc_z; |
@@ -592,12 +592,12 @@ static int gr_gp10b_add_zbc_depth(struct gk20a *g, struct gr_gk20a *gr, | |||
592 | return 0; | 592 | return 0; |
593 | } | 593 | } |
594 | 594 | ||
595 | static u32 gr_gp10b_pagepool_default_size(struct gk20a *g) | 595 | u32 gr_gp10b_pagepool_default_size(struct gk20a *g) |
596 | { | 596 | { |
597 | return gr_scc_pagepool_total_pages_hwmax_value_v(); | 597 | return gr_scc_pagepool_total_pages_hwmax_value_v(); |
598 | } | 598 | } |
599 | 599 | ||
600 | static int gr_gp10b_calc_global_ctx_buffer_size(struct gk20a *g) | 600 | int gr_gp10b_calc_global_ctx_buffer_size(struct gk20a *g) |
601 | { | 601 | { |
602 | struct gr_gk20a *gr = &g->gr; | 602 | struct gr_gk20a *gr = &g->gr; |
603 | int size; | 603 | int size; |
@@ -642,7 +642,7 @@ static void gr_gp10b_set_coalesce_buffer_size(struct gk20a *g, u32 data) | |||
642 | gk20a_dbg_fn("done"); | 642 | gk20a_dbg_fn("done"); |
643 | } | 643 | } |
644 | 644 | ||
645 | static void gr_gp10b_set_bes_crop_debug3(struct gk20a *g, u32 data) | 645 | void gr_gp10b_set_bes_crop_debug3(struct gk20a *g, u32 data) |
646 | { | 646 | { |
647 | u32 val; | 647 | u32 val; |
648 | 648 | ||
@@ -667,7 +667,7 @@ static void gr_gp10b_set_bes_crop_debug3(struct gk20a *g, u32 data) | |||
667 | gk20a_writel(g, gr_bes_crop_debug3_r(), val); | 667 | gk20a_writel(g, gr_bes_crop_debug3_r(), val); |
668 | } | 668 | } |
669 | 669 | ||
670 | static int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr, | 670 | int gr_gp10b_handle_sw_method(struct gk20a *g, u32 addr, |
671 | u32 class_num, u32 offset, u32 data) | 671 | u32 class_num, u32 offset, u32 data) |
672 | { | 672 | { |
673 | gk20a_dbg_fn(""); | 673 | gk20a_dbg_fn(""); |
@@ -718,7 +718,7 @@ fail: | |||
718 | return -EINVAL; | 718 | return -EINVAL; |
719 | } | 719 | } |
720 | 720 | ||
721 | static void gr_gp10b_cb_size_default(struct gk20a *g) | 721 | void gr_gp10b_cb_size_default(struct gk20a *g) |
722 | { | 722 | { |
723 | struct gr_gk20a *gr = &g->gr; | 723 | struct gr_gk20a *gr = &g->gr; |
724 | 724 | ||
@@ -728,7 +728,7 @@ static void gr_gp10b_cb_size_default(struct gk20a *g) | |||
728 | gr_gpc0_ppc0_cbm_alpha_cb_size_v_default_v(); | 728 | gr_gpc0_ppc0_cbm_alpha_cb_size_v_default_v(); |
729 | } | 729 | } |
730 | 730 | ||
731 | static void gr_gp10b_set_alpha_circular_buffer_size(struct gk20a *g, u32 data) | 731 | void gr_gp10b_set_alpha_circular_buffer_size(struct gk20a *g, u32 data) |
732 | { | 732 | { |
733 | struct gr_gk20a *gr = &g->gr; | 733 | struct gr_gk20a *gr = &g->gr; |
734 | u32 gpc_index, ppc_index, stride, val; | 734 | u32 gpc_index, ppc_index, stride, val; |
@@ -776,7 +776,7 @@ static void gr_gp10b_set_alpha_circular_buffer_size(struct gk20a *g, u32 data) | |||
776 | } | 776 | } |
777 | } | 777 | } |
778 | 778 | ||
779 | static void gr_gp10b_set_circular_buffer_size(struct gk20a *g, u32 data) | 779 | void gr_gp10b_set_circular_buffer_size(struct gk20a *g, u32 data) |
780 | { | 780 | { |
781 | struct gr_gk20a *gr = &g->gr; | 781 | struct gr_gk20a *gr = &g->gr; |
782 | u32 gpc_index, ppc_index, stride, val; | 782 | u32 gpc_index, ppc_index, stride, val; |
@@ -843,7 +843,7 @@ static void gr_gp10b_set_circular_buffer_size(struct gk20a *g, u32 data) | |||
843 | } | 843 | } |
844 | } | 844 | } |
845 | 845 | ||
846 | static int gr_gp10b_init_ctx_state(struct gk20a *g) | 846 | int gr_gp10b_init_ctx_state(struct gk20a *g) |
847 | { | 847 | { |
848 | struct fecs_method_op_gk20a op = { | 848 | struct fecs_method_op_gk20a op = { |
849 | .mailbox = { .id = 0, .data = 0, | 849 | .mailbox = { .id = 0, .data = 0, |
@@ -910,7 +910,7 @@ fail_free: | |||
910 | return err; | 910 | return err; |
911 | } | 911 | } |
912 | 912 | ||
913 | static int gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g, | 913 | int gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g, |
914 | struct gr_ctx_desc *gr_ctx, | 914 | struct gr_ctx_desc *gr_ctx, |
915 | struct vm_gk20a *vm, u32 class, | 915 | struct vm_gk20a *vm, u32 class, |
916 | u32 graphics_preempt_mode, | 916 | u32 graphics_preempt_mode, |
@@ -1034,7 +1034,7 @@ fail: | |||
1034 | return err; | 1034 | return err; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | static int gr_gp10b_alloc_gr_ctx(struct gk20a *g, | 1037 | int gr_gp10b_alloc_gr_ctx(struct gk20a *g, |
1038 | struct gr_ctx_desc **gr_ctx, struct vm_gk20a *vm, | 1038 | struct gr_ctx_desc **gr_ctx, struct vm_gk20a *vm, |
1039 | u32 class, | 1039 | u32 class, |
1040 | u32 flags) | 1040 | u32 flags) |
@@ -1131,7 +1131,7 @@ static void dump_ctx_switch_stats(struct gk20a *g, struct vm_gk20a *vm, | |||
1131 | nvgpu_mem_end(g, mem); | 1131 | nvgpu_mem_end(g, mem); |
1132 | } | 1132 | } |
1133 | 1133 | ||
1134 | static void gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm, | 1134 | void gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm, |
1135 | struct gr_ctx_desc *gr_ctx) | 1135 | struct gr_ctx_desc *gr_ctx) |
1136 | { | 1136 | { |
1137 | gk20a_dbg_fn(""); | 1137 | gk20a_dbg_fn(""); |
@@ -1151,7 +1151,7 @@ static void gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm, | |||
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | 1153 | ||
1154 | static void gr_gp10b_update_ctxsw_preemption_mode(struct gk20a *g, | 1154 | void gr_gp10b_update_ctxsw_preemption_mode(struct gk20a *g, |
1155 | struct channel_ctx_gk20a *ch_ctx, | 1155 | struct channel_ctx_gk20a *ch_ctx, |
1156 | struct nvgpu_mem *mem) | 1156 | struct nvgpu_mem *mem) |
1157 | { | 1157 | { |
@@ -1256,7 +1256,7 @@ out: | |||
1256 | gk20a_dbg_fn("done"); | 1256 | gk20a_dbg_fn("done"); |
1257 | } | 1257 | } |
1258 | 1258 | ||
1259 | static int gr_gp10b_dump_gr_status_regs(struct gk20a *g, | 1259 | int gr_gp10b_dump_gr_status_regs(struct gk20a *g, |
1260 | struct gk20a_debug_output *o) | 1260 | struct gk20a_debug_output *o) |
1261 | { | 1261 | { |
1262 | struct gr_gk20a *gr = &g->gr; | 1262 | struct gr_gk20a *gr = &g->gr; |
@@ -1402,7 +1402,7 @@ static bool gr_activity_empty_or_preempted(u32 val) | |||
1402 | return true; | 1402 | return true; |
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | static int gr_gp10b_wait_empty(struct gk20a *g, unsigned long duration_ms, | 1405 | int gr_gp10b_wait_empty(struct gk20a *g, unsigned long duration_ms, |
1406 | u32 expect_delay) | 1406 | u32 expect_delay) |
1407 | { | 1407 | { |
1408 | u32 delay = expect_delay; | 1408 | u32 delay = expect_delay; |
@@ -1453,7 +1453,7 @@ static int gr_gp10b_wait_empty(struct gk20a *g, unsigned long duration_ms, | |||
1453 | return -EAGAIN; | 1453 | return -EAGAIN; |
1454 | } | 1454 | } |
1455 | 1455 | ||
1456 | static void gr_gp10b_commit_global_attrib_cb(struct gk20a *g, | 1456 | void gr_gp10b_commit_global_attrib_cb(struct gk20a *g, |
1457 | struct channel_ctx_gk20a *ch_ctx, | 1457 | struct channel_ctx_gk20a *ch_ctx, |
1458 | u64 addr, bool patch) | 1458 | u64 addr, bool patch) |
1459 | { | 1459 | { |
@@ -1481,7 +1481,7 @@ static void gr_gp10b_commit_global_attrib_cb(struct gk20a *g, | |||
1481 | gr_gpcs_tpcs_tex_rm_cb_1_valid_true_f(), patch); | 1481 | gr_gpcs_tpcs_tex_rm_cb_1_valid_true_f(), patch); |
1482 | } | 1482 | } |
1483 | 1483 | ||
1484 | static void gr_gp10b_commit_global_bundle_cb(struct gk20a *g, | 1484 | void gr_gp10b_commit_global_bundle_cb(struct gk20a *g, |
1485 | struct channel_ctx_gk20a *ch_ctx, | 1485 | struct channel_ctx_gk20a *ch_ctx, |
1486 | u64 addr, u64 size, bool patch) | 1486 | u64 addr, u64 size, bool patch) |
1487 | { | 1487 | { |
@@ -1516,7 +1516,7 @@ static void gr_gp10b_commit_global_bundle_cb(struct gk20a *g, | |||
1516 | gr_pd_ab_dist_cfg2_state_limit_f(data), patch); | 1516 | gr_pd_ab_dist_cfg2_state_limit_f(data), patch); |
1517 | } | 1517 | } |
1518 | 1518 | ||
1519 | static int gr_gp10b_load_smid_config(struct gk20a *g) | 1519 | int gr_gp10b_load_smid_config(struct gk20a *g) |
1520 | { | 1520 | { |
1521 | u32 *tpc_sm_id; | 1521 | u32 *tpc_sm_id; |
1522 | u32 i, j; | 1522 | u32 i, j; |
@@ -1586,7 +1586,7 @@ int gr_gp10b_init_fs_state(struct gk20a *g) | |||
1586 | return gr_gm20b_init_fs_state(g); | 1586 | return gr_gm20b_init_fs_state(g); |
1587 | } | 1587 | } |
1588 | 1588 | ||
1589 | static void gr_gp10b_init_cyclestats(struct gk20a *g) | 1589 | void gr_gp10b_init_cyclestats(struct gk20a *g) |
1590 | { | 1590 | { |
1591 | #if defined(CONFIG_GK20A_CYCLE_STATS) | 1591 | #if defined(CONFIG_GK20A_CYCLE_STATS) |
1592 | g->gpu_characteristics.flags |= | 1592 | g->gpu_characteristics.flags |= |
@@ -1598,7 +1598,7 @@ static void gr_gp10b_init_cyclestats(struct gk20a *g) | |||
1598 | #endif | 1598 | #endif |
1599 | } | 1599 | } |
1600 | 1600 | ||
1601 | static void gr_gp10b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index) | 1601 | void gr_gp10b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index) |
1602 | { | 1602 | { |
1603 | nvgpu_tegra_fuse_write_bypass(g, 0x1); | 1603 | nvgpu_tegra_fuse_write_bypass(g, 0x1); |
1604 | nvgpu_tegra_fuse_write_access_sw(g, 0x0); | 1604 | nvgpu_tegra_fuse_write_access_sw(g, 0x0); |
@@ -1611,7 +1611,7 @@ static void gr_gp10b_set_gpc_tpc_mask(struct gk20a *g, u32 gpc_index) | |||
1611 | nvgpu_tegra_fuse_write_opt_gpu_tpc0_disable(g, 0x0); | 1611 | nvgpu_tegra_fuse_write_opt_gpu_tpc0_disable(g, 0x0); |
1612 | } | 1612 | } |
1613 | 1613 | ||
1614 | static void gr_gp10b_get_access_map(struct gk20a *g, | 1614 | void gr_gp10b_get_access_map(struct gk20a *g, |
1615 | u32 **whitelist, int *num_entries) | 1615 | u32 **whitelist, int *num_entries) |
1616 | { | 1616 | { |
1617 | static u32 wl_addr_gp10b[] = { | 1617 | static u32 wl_addr_gp10b[] = { |
@@ -1801,7 +1801,7 @@ static int gr_gp10b_clear_cilp_preempt_pending(struct gk20a *g, | |||
1801 | * | 1801 | * |
1802 | * On Pascal, if we are in CILP preemtion mode, preempt the channel and handle errors with special processing | 1802 | * On Pascal, if we are in CILP preemtion mode, preempt the channel and handle errors with special processing |
1803 | */ | 1803 | */ |
1804 | static int gr_gp10b_pre_process_sm_exception(struct gk20a *g, | 1804 | int gr_gp10b_pre_process_sm_exception(struct gk20a *g, |
1805 | u32 gpc, u32 tpc, u32 sm, u32 global_esr, u32 warp_esr, | 1805 | u32 gpc, u32 tpc, u32 sm, u32 global_esr, u32 warp_esr, |
1806 | bool sm_debugger_attached, struct channel_gk20a *fault_ch, | 1806 | bool sm_debugger_attached, struct channel_gk20a *fault_ch, |
1807 | bool *early_exit, bool *ignore_debugger) | 1807 | bool *early_exit, bool *ignore_debugger) |
@@ -1988,7 +1988,7 @@ clean_up: | |||
1988 | return gk20a_gr_handle_fecs_error(g, __ch, isr_data); | 1988 | return gk20a_gr_handle_fecs_error(g, __ch, isr_data); |
1989 | } | 1989 | } |
1990 | 1990 | ||
1991 | static u32 gp10b_gr_get_sm_hww_warp_esr(struct gk20a *g, | 1991 | u32 gp10b_gr_get_sm_hww_warp_esr(struct gk20a *g, |
1992 | u32 gpc, u32 tpc, u32 sm) | 1992 | u32 gpc, u32 tpc, u32 sm) |
1993 | { | 1993 | { |
1994 | u32 offset = gk20a_gr_gpc_offset(g, gpc) + gk20a_gr_tpc_offset(g, tpc); | 1994 | u32 offset = gk20a_gr_gpc_offset(g, gpc) + gk20a_gr_tpc_offset(g, tpc); |
@@ -2003,7 +2003,7 @@ static u32 gp10b_gr_get_sm_hww_warp_esr(struct gk20a *g, | |||
2003 | return hww_warp_esr; | 2003 | return hww_warp_esr; |
2004 | } | 2004 | } |
2005 | 2005 | ||
2006 | static u32 get_ecc_override_val(struct gk20a *g) | 2006 | u32 get_ecc_override_val(struct gk20a *g) |
2007 | { | 2007 | { |
2008 | u32 val; | 2008 | u32 val; |
2009 | 2009 | ||
@@ -2046,7 +2046,7 @@ static bool gr_gp10b_suspend_context(struct channel_gk20a *ch, | |||
2046 | return ctx_resident; | 2046 | return ctx_resident; |
2047 | } | 2047 | } |
2048 | 2048 | ||
2049 | static int gr_gp10b_suspend_contexts(struct gk20a *g, | 2049 | int gr_gp10b_suspend_contexts(struct gk20a *g, |
2050 | struct dbg_session_gk20a *dbg_s, | 2050 | struct dbg_session_gk20a *dbg_s, |
2051 | int *ctx_resident_ch_fd) | 2051 | int *ctx_resident_ch_fd) |
2052 | { | 2052 | { |
@@ -2122,7 +2122,7 @@ clean_up: | |||
2122 | return err; | 2122 | return err; |
2123 | } | 2123 | } |
2124 | 2124 | ||
2125 | static int gr_gp10b_set_boosted_ctx(struct channel_gk20a *ch, | 2125 | int gr_gp10b_set_boosted_ctx(struct channel_gk20a *ch, |
2126 | bool boost) | 2126 | bool boost) |
2127 | { | 2127 | { |
2128 | struct gr_ctx_desc *gr_ctx = ch->ch_ctx.gr_ctx; | 2128 | struct gr_ctx_desc *gr_ctx = ch->ch_ctx.gr_ctx; |
@@ -2156,7 +2156,7 @@ unmap_ctx: | |||
2156 | return err; | 2156 | return err; |
2157 | } | 2157 | } |
2158 | 2158 | ||
2159 | static void gr_gp10b_update_boosted_ctx(struct gk20a *g, struct nvgpu_mem *mem, | 2159 | void gr_gp10b_update_boosted_ctx(struct gk20a *g, struct nvgpu_mem *mem, |
2160 | struct gr_ctx_desc *gr_ctx) { | 2160 | struct gr_ctx_desc *gr_ctx) { |
2161 | u32 v; | 2161 | u32 v; |
2162 | 2162 | ||
@@ -2165,7 +2165,7 @@ static void gr_gp10b_update_boosted_ctx(struct gk20a *g, struct nvgpu_mem *mem, | |||
2165 | nvgpu_mem_wr(g, mem, ctxsw_prog_main_image_pmu_options_o(), v); | 2165 | nvgpu_mem_wr(g, mem, ctxsw_prog_main_image_pmu_options_o(), v); |
2166 | } | 2166 | } |
2167 | 2167 | ||
2168 | static int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch, | 2168 | int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch, |
2169 | u32 graphics_preempt_mode, | 2169 | u32 graphics_preempt_mode, |
2170 | u32 compute_preempt_mode) | 2170 | u32 compute_preempt_mode) |
2171 | { | 2171 | { |
@@ -2261,7 +2261,7 @@ unamp_ctx_header: | |||
2261 | return err; | 2261 | return err; |
2262 | } | 2262 | } |
2263 | 2263 | ||
2264 | static int gr_gp10b_get_preemption_mode_flags(struct gk20a *g, | 2264 | int gr_gp10b_get_preemption_mode_flags(struct gk20a *g, |
2265 | struct nvgpu_preemption_modes_rec *preemption_modes_rec) | 2265 | struct nvgpu_preemption_modes_rec *preemption_modes_rec) |
2266 | { | 2266 | { |
2267 | preemption_modes_rec->graphics_preemption_mode_flags = ( | 2267 | preemption_modes_rec->graphics_preemption_mode_flags = ( |
@@ -2279,7 +2279,7 @@ static int gr_gp10b_get_preemption_mode_flags(struct gk20a *g, | |||
2279 | 2279 | ||
2280 | return 0; | 2280 | return 0; |
2281 | } | 2281 | } |
2282 | static int gp10b_gr_fuse_override(struct gk20a *g) | 2282 | int gp10b_gr_fuse_override(struct gk20a *g) |
2283 | { | 2283 | { |
2284 | struct device_node *np = dev_from_gk20a(g)->of_node; | 2284 | struct device_node *np = dev_from_gk20a(g)->of_node; |
2285 | u32 *fuses; | 2285 | u32 *fuses; |
@@ -2319,7 +2319,7 @@ static int gp10b_gr_fuse_override(struct gk20a *g) | |||
2319 | return 0; | 2319 | return 0; |
2320 | } | 2320 | } |
2321 | 2321 | ||
2322 | static int gr_gp10b_init_preemption_state(struct gk20a *g) | 2322 | int gr_gp10b_init_preemption_state(struct gk20a *g) |
2323 | { | 2323 | { |
2324 | u32 debug_2; | 2324 | u32 debug_2; |
2325 | u64 sysclk_rate; | 2325 | u64 sysclk_rate; |
@@ -2341,7 +2341,7 @@ static int gr_gp10b_init_preemption_state(struct gk20a *g) | |||
2341 | return 0; | 2341 | return 0; |
2342 | } | 2342 | } |
2343 | 2343 | ||
2344 | static void gr_gp10b_set_preemption_buffer_va(struct gk20a *g, | 2344 | void gr_gp10b_set_preemption_buffer_va(struct gk20a *g, |
2345 | struct nvgpu_mem *mem, u64 gpu_va) | 2345 | struct nvgpu_mem *mem, u64 gpu_va) |
2346 | { | 2346 | { |
2347 | u32 va = u64_lo32(gpu_va >> 8); | 2347 | u32 va = u64_lo32(gpu_va >> 8); |
@@ -2367,59 +2367,3 @@ int gr_gp10b_set_czf_bypass(struct gk20a *g, struct channel_gk20a *ch) | |||
2367 | 2367 | ||
2368 | return __gr_gk20a_exec_ctx_ops(ch, &ops, 1, 1, 0, false); | 2368 | return __gr_gk20a_exec_ctx_ops(ch, &ops, 1, 1, 0, false); |
2369 | } | 2369 | } |
2370 | |||
2371 | void gp10b_init_gr(struct gk20a *g) | ||
2372 | { | ||
2373 | struct gpu_ops *gops = &g->ops; | ||
2374 | |||
2375 | gm20b_init_gr(g); | ||
2376 | gops->gr.init_fs_state = gr_gp10b_init_fs_state; | ||
2377 | gops->gr.init_preemption_state = gr_gp10b_init_preemption_state; | ||
2378 | gops->gr.is_valid_class = gr_gp10b_is_valid_class; | ||
2379 | gops->gr.is_valid_gfx_class = gr_gp10b_is_valid_gfx_class; | ||
2380 | gops->gr.is_valid_compute_class = gr_gp10b_is_valid_compute_class; | ||
2381 | gops->gr.commit_global_cb_manager = gr_gp10b_commit_global_cb_manager; | ||
2382 | gops->gr.commit_global_pagepool = gr_gp10b_commit_global_pagepool; | ||
2383 | gops->gr.set_preemption_buffer_va = gr_gp10b_set_preemption_buffer_va; | ||
2384 | gops->gr.add_zbc_color = gr_gp10b_add_zbc_color; | ||
2385 | gops->gr.add_zbc_depth = gr_gp10b_add_zbc_depth; | ||
2386 | gops->gr.pagepool_default_size = gr_gp10b_pagepool_default_size; | ||
2387 | gops->gr.calc_global_ctx_buffer_size = | ||
2388 | gr_gp10b_calc_global_ctx_buffer_size; | ||
2389 | gops->gr.commit_global_attrib_cb = gr_gp10b_commit_global_attrib_cb; | ||
2390 | gops->gr.commit_global_bundle_cb = gr_gp10b_commit_global_bundle_cb; | ||
2391 | gops->gr.handle_sw_method = gr_gp10b_handle_sw_method; | ||
2392 | gops->gr.cb_size_default = gr_gp10b_cb_size_default; | ||
2393 | gops->gr.set_alpha_circular_buffer_size = | ||
2394 | gr_gp10b_set_alpha_circular_buffer_size; | ||
2395 | gops->gr.set_circular_buffer_size = | ||
2396 | gr_gp10b_set_circular_buffer_size; | ||
2397 | gops->gr.set_bes_crop_debug3 = gr_gp10b_set_bes_crop_debug3; | ||
2398 | gops->gr.init_ctx_state = gr_gp10b_init_ctx_state; | ||
2399 | gops->gr.alloc_gr_ctx = gr_gp10b_alloc_gr_ctx; | ||
2400 | gops->gr.free_gr_ctx = gr_gp10b_free_gr_ctx; | ||
2401 | gops->gr.update_ctxsw_preemption_mode = | ||
2402 | gr_gp10b_update_ctxsw_preemption_mode; | ||
2403 | gops->gr.dump_gr_regs = gr_gp10b_dump_gr_status_regs; | ||
2404 | gops->gr.wait_empty = gr_gp10b_wait_empty; | ||
2405 | gops->gr.init_cyclestats = gr_gp10b_init_cyclestats; | ||
2406 | gops->gr.set_gpc_tpc_mask = gr_gp10b_set_gpc_tpc_mask; | ||
2407 | gops->gr.get_access_map = gr_gp10b_get_access_map; | ||
2408 | gops->gr.handle_sm_exception = gr_gp10b_handle_sm_exception; | ||
2409 | gops->gr.handle_tex_exception = gr_gp10b_handle_tex_exception; | ||
2410 | gops->gr.pre_process_sm_exception = | ||
2411 | gr_gp10b_pre_process_sm_exception; | ||
2412 | gops->gr.handle_fecs_error = gr_gp10b_handle_fecs_error; | ||
2413 | gops->gr.create_gr_sysfs = gr_gp10b_create_sysfs; | ||
2414 | gops->gr.get_lrf_tex_ltc_dram_override = get_ecc_override_val; | ||
2415 | gops->gr.suspend_contexts = gr_gp10b_suspend_contexts; | ||
2416 | gops->gr.set_preemption_mode = gr_gp10b_set_preemption_mode; | ||
2417 | gops->gr.set_ctxsw_preemption_mode = gr_gp10b_set_ctxsw_preemption_mode; | ||
2418 | gops->gr.get_preemption_mode_flags = gr_gp10b_get_preemption_mode_flags; | ||
2419 | gops->gr.fuse_override = gp10b_gr_fuse_override; | ||
2420 | gops->gr.load_smid_config = gr_gp10b_load_smid_config; | ||
2421 | gops->gr.set_boosted_ctx = gr_gp10b_set_boosted_ctx; | ||
2422 | gops->gr.update_boosted_ctx = gr_gp10b_update_boosted_ctx; | ||
2423 | gops->gr.set_czf_bypass = gr_gp10b_set_czf_bypass; | ||
2424 | gops->gr.get_sm_hww_warp_esr = gp10b_gr_get_sm_hww_warp_esr; | ||
2425 | } | ||