summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux
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/common/linux
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/common/linux')
-rw-r--r--drivers/gpu/nvgpu/common/linux/sysfs.c6
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c4
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c4
3 files changed, 12 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/sysfs.c b/drivers/gpu/nvgpu/common/linux/sysfs.c
index b1e7d1ed..053c1a12 100644
--- a/drivers/gpu/nvgpu/common/linux/sysfs.c
+++ b/drivers/gpu/nvgpu/common/linux/sysfs.c
@@ -965,8 +965,10 @@ static ssize_t gfxp_wfi_timeout_count_store(struct device *dev,
965 if (kstrtoul(buf, 10, &val) < 0) 965 if (kstrtoul(buf, 10, &val) < 0)
966 return -EINVAL; 966 return -EINVAL;
967 967
968 if (val >= 100*1000*1000) /* 100ms @ 1Ghz */ 968 if (g->ops.gr.get_max_gfxp_wfi_timeout_count) {
969 return -EINVAL; 969 if (val >= g->ops.gr.get_max_gfxp_wfi_timeout_count(g))
970 return -EINVAL;
971 }
970 972
971 gr->gfxp_wfi_timeout_count = val; 973 gr->gfxp_wfi_timeout_count = val;
972 974
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c
index b35cac90..acd0ad5d 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c
@@ -209,6 +209,10 @@ static const struct gpu_ops vgpu_gp10b_ops = {
209 .set_ctxsw_preemption_mode = 209 .set_ctxsw_preemption_mode =
210 vgpu_gr_gp10b_set_ctxsw_preemption_mode, 210 vgpu_gr_gp10b_set_ctxsw_preemption_mode,
211 .init_ctxsw_hdr_data = gr_gp10b_init_ctxsw_hdr_data, 211 .init_ctxsw_hdr_data = gr_gp10b_init_ctxsw_hdr_data,
212 .init_gfxp_wfi_timeout_count =
213 gr_gp10b_init_gfxp_wfi_timeout_count,
214 .get_max_gfxp_wfi_timeout_count =
215 gr_gp10b_get_max_gfxp_wfi_timeout_count,
212 }, 216 },
213 .fb = { 217 .fb = {
214 .reset = fb_gk20a_reset, 218 .reset = fb_gk20a_reset,
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c
index a7491b20..a470377c 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c
@@ -248,6 +248,10 @@ static const struct gpu_ops vgpu_gv11b_ops = {
248 gr_gv11b_handle_tpc_sm_ecc_exception, 248 gr_gv11b_handle_tpc_sm_ecc_exception,
249 .decode_egpc_addr = gv11b_gr_decode_egpc_addr, 249 .decode_egpc_addr = gv11b_gr_decode_egpc_addr,
250 .init_ctxsw_hdr_data = gr_gp10b_init_ctxsw_hdr_data, 250 .init_ctxsw_hdr_data = gr_gp10b_init_ctxsw_hdr_data,
251 .init_gfxp_wfi_timeout_count =
252 gr_gv11b_init_gfxp_wfi_timeout_count,
253 .get_max_gfxp_wfi_timeout_count =
254 gr_gv11b_get_max_gfxp_wfi_timeout_count,
251 }, 255 },
252 .fb = { 256 .fb = {
253 .reset = gv11b_fb_reset, 257 .reset = gv11b_fb_reset,