From 744f7f049867c83ecb2c76681cb80ec789459491 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Wed, 18 Apr 2018 16:18:59 -0700 Subject: gpu: nvgpu: add gr hal for fecs_ctxsw_mailbox size fecs_ctxsw_mailbox_size varies per chip. Use hal to get the size. Also dump fecs_ctxsw_status_1 to help debug Bug 2093809 Change-Id: I5a50281e9d78fe0e4a75d03971169e3e9679967a Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1698026 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 1 + drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 65750a15..e48af08c 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -474,6 +474,7 @@ struct gpu_ops { u32 num_fbpas, u32 *priv_addr_table, u32 *priv_addr_table_index); + u32 (*fecs_ctxsw_mailbox_size)(void); } gr; struct { void (*init_hw)(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 51bb2551..d26d8a93 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -155,8 +155,10 @@ void gk20a_fecs_dump_falcon_stats(struct gk20a *g) gk20a_readl(g, gr_fecs_debug1_r())); nvgpu_err(g, "gr_fecs_debuginfo_r : 0x%x", gk20a_readl(g, gr_fecs_debuginfo_r())); + nvgpu_err(g, "gr_fecs_ctxsw_status_1_r : 0x%x", + gk20a_readl(g, gr_fecs_ctxsw_status_1_r())); - for (i = 0; i < gr_fecs_ctxsw_mailbox__size_1_v(); i++) + for (i = 0; i < g->ops.gr.fecs_ctxsw_mailbox_size(); i++) nvgpu_err(g, "gr_fecs_ctxsw_mailbox_r(%d) : 0x%x", i, gk20a_readl(g, gr_fecs_ctxsw_mailbox_r(i))); -- cgit v1.2.2