summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2017-11-15 17:35:43 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-29 16:17:18 -0500
commit7a4cb4a6ab6c861a94e9105360967894df749f03 (patch)
treeacfcfa1f607a66b18a579f7d06a48b7746abdabf /drivers/gpu/nvgpu/gv11b/gr_gv11b.c
parentdda9d80a852e099a6304abb07936b4250cf1a141 (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/gr_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.c34
1 files changed, 34 insertions, 0 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}