From 00e52529a8431a6520b8e1bbcbfa44b4cc86be80 Mon Sep 17 00:00:00 2001 From: Jonathan McCaffrey Date: Thu, 17 Aug 2017 23:51:03 -0700 Subject: gpu: gp10b: add gfxp_wfi_timeout sysfs node Add a sysfs node to allow root user to set PRI_FE_GFXP_WFI_TIMEOUT, for gp10b only, in units of sysclk cycles. Store the set value in a variable, and write the set value to register after GPU is un-railgated. NV_PGRAPH_PRI_FE_GFXP_WFI_TIMEOUT is engine_reset after Bug 1623341. Change default value to be specified in cycles, rather than time. This value is almost the current value in cycles calculated each boot. Bug 1932782 Change-Id: I0a4207e637cd1413a1be95abe2bcce3adccf76fa Reviewed-on: https://git-master.nvidia.com/r/1540939 Signed-off-by: Jonathan McCaffrey Reviewed-on: https://git-master.nvidia.com/r/1580999 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 3 +++ drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 1 + 2 files changed, 4 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 2fd6f72c..71fe44a3 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -78,6 +78,7 @@ #define CTXSW_MEM_SCRUBBING_TIMEOUT_DEFAULT 10 #define FECS_ARB_CMD_TIMEOUT_MAX 40 #define FECS_ARB_CMD_TIMEOUT_DEFAULT 2 +#define GFXP_WFI_TIMEOUT_COUNT_DEFAULT 100000 static int gk20a_init_gr_bind_fecs_elpg(struct gk20a *g); @@ -4841,6 +4842,8 @@ static int gk20a_init_gr_setup_sw(struct gk20a *g) if (g->ops.gr.init_czf_bypass) g->ops.gr.init_czf_bypass(g); + gr->gfxp_wfi_timeout_count = GFXP_WFI_TIMEOUT_COUNT_DEFAULT; + nvgpu_mutex_init(&gr->ctx_mutex); nvgpu_spinlock_init(&gr->ch_tlb_lock); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 22fc40d1..0a685d01 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -343,6 +343,7 @@ struct gr_gk20a { u32 timeslice_mode; u32 czf_bypass; u32 pd_max_batches; + u32 gfxp_wfi_timeout_count; struct gr_ctx_buffer_desc global_ctx_buffer[NR_GLOBAL_CTX_BUF]; -- cgit v1.2.2