From 3197a918d5052c71ad854f6b22fdb35bfe7cebe2 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Thu, 10 Aug 2017 16:34:16 -0700 Subject: gpu: nvgpu: gv11b: add max_subctx_count to g->fifo.t19x - For better performance. It used to read register every time referencing max_subctx_count. - Avoid reading registers for vgpu. Jira VFND-3797 Change-Id: Id6e6b15a0d9a035795e8a9a2c6bb63524c5eb544 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1537009 Reviewed-by: svccoveritychecker Reviewed-by: Seshendra Gadagottu GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/fifo_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c index e210d40d..bd769f75 100644 --- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "fifo_gv11b.h" #include "subctx_gv11b.h" @@ -1717,16 +1718,20 @@ int gv11b_init_fifo_setup_hw(struct gk20a *g) struct fifo_gk20a *f = &g->fifo; f->t19x.usermode_regs = g->regs + usermode_cfg0_r(); + f->t19x.max_subctx_count = + gr_pri_fe_chip_def_info_max_veid_count_v( + gk20a_readl(g, gr_pri_fe_chip_def_info_r())); return 0; } static u32 gv11b_mmu_fault_id_to_gr_veid(struct gk20a *g, u32 gr_eng_fault_id, u32 mmu_fault_id) { + struct fifo_gk20a *f = &g->fifo; u32 num_subctx; u32 veid = FIFO_INVAL_VEID; - num_subctx = gv11b_get_max_subctx_count(g); + num_subctx = f->t19x.max_subctx_count; if (mmu_fault_id >= gr_eng_fault_id && mmu_fault_id < (gr_eng_fault_id + num_subctx)) -- cgit v1.2.2