summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b')
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.c34
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.h3
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c6
3 files changed, 42 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
index f2397108..9d6d8d05 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
@@ -54,6 +54,8 @@
54#include <nvgpu/hw/gv11b/hw_therm_gv11b.h> 54#include <nvgpu/hw/gv11b/hw_therm_gv11b.h>
55#include <nvgpu/hw/gv11b/hw_fb_gv11b.h> 55#include <nvgpu/hw/gv11b/hw_fb_gv11b.h>
56 56
57#define GFXP_WFI_TIMEOUT_COUNT_IN_USEC_DEFAULT 1000
58
57bool gr_gv11b_is_valid_class(struct gk20a *g, u32 class_num) 59bool gr_gv11b_is_valid_class(struct gk20a *g, u32 class_num)
58{ 60{
59 bool valid = false; 61 bool valid = false;
@@ -3625,3 +3627,35 @@ void gr_gv11b_init_gpc_mmu(struct gk20a *g)
3625 gk20a_writel(g, gr_gpcs_pri_mmu_debug_rd_r(), 3627 gk20a_writel(g, gr_gpcs_pri_mmu_debug_rd_r(),
3626 gk20a_readl(g, fb_mmu_debug_rd_r())); 3628 gk20a_readl(g, fb_mmu_debug_rd_r()));
3627} 3629}
3630
3631int gr_gv11b_init_preemption_state(struct gk20a *g)
3632{
3633 u32 debug_2;
3634 struct gr_gk20a *gr = &g->gr;
3635
3636 nvgpu_log_fn(g, " ");
3637
3638 gk20a_writel(g, gr_fe_gfxp_wfi_timeout_r(),
3639 gr_fe_gfxp_wfi_timeout_count_f(
3640 gr->gfxp_wfi_timeout_count));
3641
3642 debug_2 = gk20a_readl(g, gr_debug_2_r());
3643 debug_2 = set_field(debug_2,
3644 gr_debug_2_gfxp_wfi_timeout_unit_m(),
3645 gr_debug_2_gfxp_wfi_timeout_unit_usec_f());
3646 gk20a_writel(g, gr_debug_2_r(), debug_2);
3647
3648 return 0;
3649}
3650void gr_gv11b_init_gfxp_wfi_timeout_count(struct gk20a *g)
3651{
3652 struct gr_gk20a *gr = &g->gr;
3653
3654 gr->gfxp_wfi_timeout_count = GFXP_WFI_TIMEOUT_COUNT_IN_USEC_DEFAULT;
3655}
3656
3657unsigned long gr_gv11b_get_max_gfxp_wfi_timeout_count(struct gk20a *g)
3658{
3659 /* 100 msec in usec count */
3660 return (100 * 1000UL);
3661}
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
index 1941f239..7c56f62d 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
@@ -213,5 +213,8 @@ void gv11b_gr_egpc_etpc_priv_addr_table(struct gk20a *g, u32 addr,
213 u32 gpc, u32 broadcast_flags, u32 *priv_addr_table, u32 *t); 213 u32 gpc, u32 broadcast_flags, u32 *priv_addr_table, u32 *t);
214u32 gv11b_gr_get_egpc_base(struct gk20a *g); 214u32 gv11b_gr_get_egpc_base(struct gk20a *g);
215void gr_gv11b_init_gpc_mmu(struct gk20a *g); 215void gr_gv11b_init_gpc_mmu(struct gk20a *g);
216int gr_gv11b_init_preemption_state(struct gk20a *g);
217void gr_gv11b_init_gfxp_wfi_timeout_count(struct gk20a *g);
218unsigned long gr_gv11b_get_max_gfxp_wfi_timeout_count(struct gk20a *g);
216 219
217#endif 220#endif
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
index 5649d758..e6cf0e62 100644
--- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
@@ -361,7 +361,7 @@ static const struct gpu_ops gv11b_ops = {
361 .set_czf_bypass = NULL, 361 .set_czf_bypass = NULL,
362 .pre_process_sm_exception = gr_gv11b_pre_process_sm_exception, 362 .pre_process_sm_exception = gr_gv11b_pre_process_sm_exception,
363 .set_preemption_buffer_va = gr_gv11b_set_preemption_buffer_va, 363 .set_preemption_buffer_va = gr_gv11b_set_preemption_buffer_va,
364 .init_preemption_state = NULL, 364 .init_preemption_state = gr_gv11b_init_preemption_state,
365 .update_boosted_ctx = gr_gp10b_update_boosted_ctx, 365 .update_boosted_ctx = gr_gp10b_update_boosted_ctx,
366 .set_bes_crop_debug3 = gr_gp10b_set_bes_crop_debug3, 366 .set_bes_crop_debug3 = gr_gp10b_set_bes_crop_debug3,
367 .create_gr_sysfs = gr_gv11b_create_sysfs, 367 .create_gr_sysfs = gr_gv11b_create_sysfs,
@@ -388,6 +388,10 @@ static const struct gpu_ops gv11b_ops = {
388 gr_gv11b_handle_tpc_sm_ecc_exception, 388 gr_gv11b_handle_tpc_sm_ecc_exception,
389 .decode_egpc_addr = gv11b_gr_decode_egpc_addr, 389 .decode_egpc_addr = gv11b_gr_decode_egpc_addr,
390 .init_ctxsw_hdr_data = gr_gp10b_init_ctxsw_hdr_data, 390 .init_ctxsw_hdr_data = gr_gp10b_init_ctxsw_hdr_data,
391 .init_gfxp_wfi_timeout_count =
392 gr_gv11b_init_gfxp_wfi_timeout_count,
393 .get_max_gfxp_wfi_timeout_count =
394 gr_gv11b_get_max_gfxp_wfi_timeout_count,
391 }, 395 },
392 .fb = { 396 .fb = {
393 .reset = gv11b_fb_reset, 397 .reset = gv11b_fb_reset,