diff options
author | seshendra Gadagottu <sgadagottu@nvidia.com> | 2017-11-15 17:35:43 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-29 16:17:18 -0500 |
commit | 7a4cb4a6ab6c861a94e9105360967894df749f03 (patch) | |
tree | acfcfa1f607a66b18a579f7d06a48b7746abdabf /drivers/gpu/nvgpu/gv11b | |
parent | dda9d80a852e099a6304abb07936b4250cf1a141 (diff) |
gpu: nvgpu: gv11b: gfxp wfi timeout
For gv11b, configured gfx preemption wfi timeout in usec.
Set timeout unit as usec in gr_gv11b_init_preemption_state.
Used default timeout as 1msec and this timeout value can
be modified through sysfs node:
/sys/devices/gpu.0/gfxp_wfi_timeout_count
For gp10b:
gfxp_wfi_timeout_count is in syclk cycles
For gv11b:
gfxp_wfi_timeout_count is in usec
Bug 2003668
Change-Id: I68d52ce996a83df90b8b3a8164debb07e5cb370f
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1599658
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 34 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gr_gv11b.h | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 6 |
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 | |||
57 | bool gr_gv11b_is_valid_class(struct gk20a *g, u32 class_num) | 59 | bool 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 | |||
3631 | int 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 | } | ||
3650 | void 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 | |||
3657 | unsigned 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); |
214 | u32 gv11b_gr_get_egpc_base(struct gk20a *g); | 214 | u32 gv11b_gr_get_egpc_base(struct gk20a *g); |
215 | void gr_gv11b_init_gpc_mmu(struct gk20a *g); | 215 | void gr_gv11b_init_gpc_mmu(struct gk20a *g); |
216 | int gr_gv11b_init_preemption_state(struct gk20a *g); | ||
217 | void gr_gv11b_init_gfxp_wfi_timeout_count(struct gk20a *g); | ||
218 | unsigned 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, |