From 7a4cb4a6ab6c861a94e9105360967894df749f03 Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Wed, 15 Nov 2017 14:35:43 -0800 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1599658 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 27a42a45..c232c4ab 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -46,6 +46,8 @@ #include #include +#define GFXP_WFI_TIMEOUT_COUNT_DEFAULT 100000 + bool gr_gp10b_is_valid_class(struct gk20a *g, u32 class_num) { bool valid = false; @@ -2351,3 +2353,16 @@ void gr_gp10b_init_ctxsw_hdr_data(struct gk20a *g, struct nvgpu_mem *mem) nvgpu_mem_wr(g, mem, ctxsw_prog_main_image_num_cilp_save_ops_o(), 0); } + +void gr_gp10b_init_gfxp_wfi_timeout_count(struct gk20a *g) +{ + struct gr_gk20a *gr = &g->gr; + + gr->gfxp_wfi_timeout_count = GFXP_WFI_TIMEOUT_COUNT_DEFAULT; +} + +unsigned long gr_gp10b_get_max_gfxp_wfi_timeout_count(struct gk20a *g) +{ + /* 100msec @ 1GHZ */ + return (100 * 1000 * 1000UL); +} -- cgit v1.2.2