From 9eac0fd84921359ded2acdf920de5592322ad93c Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Fri, 29 Apr 2016 17:03:03 -0700 Subject: gpu: nvgpu: Add debugging to the semaphore code Add GPU debugging to the semaphore code. Bug 1732449 JIRA DNVGPU-12 Change-Id: I98466570cf8d234b49a7f85d88c834648ddaaaee Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1198594 (cherry picked from commit 420809cc31fcdddde32b8e59721676c67b45f592) Reviewed-on: http://git-master/r/1153671 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index 9c8911e9..e4972610 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c @@ -428,9 +428,12 @@ static void add_sema_cmd(struct gk20a *g, struct channel_gk20a *c, struct gk20a_semaphore *s, struct priv_cmd_entry *cmd, int cmd_size, bool acquire, bool wfi) { - u32 off = cmd->off; + int ch = c->hw_chid; + u32 ob, off = cmd->off; u64 va; + ob = off; + /* * RO for acquire (since we just need to read the mem) and RW for * release since we will need to write back to the semaphore memory. @@ -480,6 +483,19 @@ static void add_sema_cmd(struct gk20a *g, struct channel_gk20a *c, /* ignored */ gk20a_mem_wr32(g, cmd->mem, off++, 0); } + + if (acquire) + gpu_sema_verbose_dbg("(A) c=%d ACQ_GE %-4u owner=%-3d" + "va=0x%llx cmd_mem=0x%llx b=0x%llx off=%u", + ch, gk20a_semaphore_get_value(s), + s->hw_sema->ch->hw_chid, va, cmd->gva, + cmd->mem->gpu_va, ob); + else + gpu_sema_verbose_dbg("(R) c=%d INCR %u (%u) va=0x%llx " + "cmd_mem=0x%llx b=0x%llx off=%u", + ch, gk20a_semaphore_get_value(s), + readl(s->hw_sema->value), va, cmd->gva, + cmd->mem->gpu_va, ob); } static int gk20a_channel_semaphore_wait_syncpt( -- cgit v1.2.2