From 911f14e1f40f501922162e8e5df85a81b9a7e90e Mon Sep 17 00:00:00 2001 From: Peter Daifuku Date: Wed, 27 Apr 2016 16:47:54 -0700 Subject: gpu: nvgpu: use correct ltc cnt in hwpm offset map Fix the offset calculation code to save/restore proper number of LTCs to conform to FECS microcode Bug 1736910 Change-Id: I46ae1e0b45ffe354693db6ceb0aeeeac3d344b34 Signed-off-by: Peter Daifuku Reviewed-on: http://git-master/r/1133896 (cherry picked from commit 97751ee7a44537f5aa5198ac362d9ee416adc172) Reviewed-on: http://git-master/r/1146244 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index c61bb235..4e7c36ee 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -7524,6 +7524,7 @@ static int gr_gk20a_create_hwpm_ctxsw_buffer_offset_map(struct gk20a *g) u32 ltc_stride = nvgpu_get_litter_value(g, GPU_LIT_LTC_STRIDE); u32 num_fbpas = nvgpu_get_litter_value(g, GPU_LIT_NUM_FBPAS); u32 fbpa_stride = nvgpu_get_litter_value(g, GPU_LIT_FBPA_STRIDE); + u32 num_ltc = g->ops.gr.get_max_ltc_per_fbp(g) * g->gr.num_fbps; if (hwpm_ctxsw_buffer_size == 0) { gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, @@ -7579,7 +7580,7 @@ static int gr_gk20a_create_hwpm_ctxsw_buffer_offset_map(struct gk20a *g) &g->gr.ctx_vars.ctxsw_regs.pm_ltc, &count, &offset, hwpm_ctxsw_reg_count_max, 0, - g->ltc_count, ltc_stride, ~0)) + num_ltc, ltc_stride, ~0)) goto cleanup; offset = ALIGN(offset, 256); -- cgit v1.2.2