From 4607098c3a889b815dc85035649856f225fffb0b Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 28 May 2018 17:21:12 -0700 Subject: gpu: nvgpu: support CAU ctxsw list CAU (Counter Aggregation Unit) registers might be split out from SMPC registers and moved into their own list on some platforms In gr_gk20a_init_ctx_vars_fw() add support to check if pm_cau list is available If list is available, count will be set to non-zero here In add_ctxsw_buffer_map_entries_gpcs(), parse the pm_cau list if count is non-zero Bug 2139870 Change-Id: Ia630e7d03481a6f927c6739d28ebfe49f221326f Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1733208 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Matthew Braun (SW-GPU) Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c index f829cb3a..3f22a1b7 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c @@ -343,6 +343,14 @@ static int gr_gk20a_init_ctx_vars_fw(struct gk20a *g, struct gr_gk20a *gr) if (err) goto clean_up; break; + case NETLIST_REGIONID_NVPERF_PMCAU: + nvgpu_log_info(g, "NETLIST_REGIONID_NVPERF_PMCAU"); + err = gr_gk20a_alloc_load_netlist_aiv(g, + src, size, + &g->gr.ctx_vars.ctxsw_regs.pm_cau); + if (err) + goto clean_up; + break; default: nvgpu_log_info(g, "unrecognized region %d skipped", i); @@ -395,6 +403,7 @@ clean_up: nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.pm_rop.l); nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.pm_ucgpc.l); nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.etpc.l); + nvgpu_kfree(g, g->gr.ctx_vars.ctxsw_regs.pm_cau.l); nvgpu_release_firmware(g, netlist_fw); err = -ENOENT; } -- cgit v1.2.2