summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/t20/debug_t20.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra/host/t20/debug_t20.c')
-rw-r--r--drivers/video/tegra/host/t20/debug_t20.c43
1 files changed, 33 insertions, 10 deletions
diff --git a/drivers/video/tegra/host/t20/debug_t20.c b/drivers/video/tegra/host/t20/debug_t20.c
index 5acad0d43132..84267c9a9018 100644
--- a/drivers/video/tegra/host/t20/debug_t20.c
+++ b/drivers/video/tegra/host/t20/debug_t20.c
@@ -104,10 +104,6 @@ static int show_channel_command(struct output *o, u32 addr, u32 val, int *count)
}
}
-/*
- * TODO: This uses ioremap_xxx on memory which is deprecated.
- * Also, it won't work properly with SMMU.
- */
static void show_channel_gather(struct output *o, u32 addr,
phys_addr_t phys_addr,
u32 words, struct nvhost_cdma *cdma);
@@ -115,6 +111,8 @@ static void show_channel_gather(struct output *o, u32 addr,
static void show_channel_word(struct output *o, int *state, int *count,
u32 addr, u32 val, struct nvhost_cdma *cdma)
{
+ static int start_count, dont_print;
+
switch (*state) {
case NVHOST_DBG_STATE_CMD:
if (addr)
@@ -123,6 +121,8 @@ static void show_channel_word(struct output *o, int *state, int *count,
nvhost_debug_output(o, "%08x:", val);
*state = show_channel_command(o, addr, val, count);
+ dont_print = 0;
+ start_count = *count;
if (*state == NVHOST_DBG_STATE_DATA && *count == 0) {
*state = NVHOST_DBG_STATE_CMD;
nvhost_debug_output(o, "])\n");
@@ -131,7 +131,14 @@ static void show_channel_word(struct output *o, int *state, int *count,
case NVHOST_DBG_STATE_DATA:
(*count)--;
- nvhost_debug_output(o, "%08x%s", val, *count > 0 ? ", " : "])\n");
+ if (start_count - *count < 64)
+ nvhost_debug_output(o, "%08x%s",
+ val, *count > 0 ? ", " : "])\n");
+ else if (!dont_print && (*count > 0)) {
+ nvhost_debug_output(o, "[truncated; %d more words]\n",
+ *count);
+ dont_print = 1;
+ }
if (*count == 0)
*state = NVHOST_DBG_STATE_CMD;
break;
@@ -139,8 +146,10 @@ static void show_channel_word(struct output *o, int *state, int *count,
case NVHOST_DBG_STATE_GATHER:
*state = NVHOST_DBG_STATE_CMD;
nvhost_debug_output(o, "%08x]):\n", val);
- if (cdma)
- show_channel_gather(o, addr, val, *count, cdma);
+ if (cdma) {
+ show_channel_gather(o, addr, val,
+ *count, cdma);
+ }
break;
}
}
@@ -158,6 +167,11 @@ static void show_channel_gather(struct output *o, u32 addr,
phys_addr_t pin_addr;
int state, count, i;
+ if ((u32)nvmap->handle == NVHOST_CDMA_PUSH_GATHER_CTXSAVE) {
+ nvhost_debug_output(o, "[context save]\n");
+ return;
+ }
+
if (!nvmap->handle || !nvmap->client
|| atomic_read(&nvmap->handle->ref) < 1) {
nvhost_debug_output(o, "[already deallocated]\n");
@@ -285,6 +299,10 @@ static void t20_debug_show_channel_cdma(struct nvhost_master *m,
break;
}
+ nvhost_debug_output(o, "DMAPUT %08x, DMAGET %08x, DMACTL %08x\n",
+ dmaput, dmaget, dmactrl);
+ nvhost_debug_output(o, "CBREAD %08x, CBSTAT %08x\n", cbread, cbstat);
+
cdma_peek(cdma, dmaget, -1, pbw);
show_channel_pair(o, previous_oppair(cdma, dmaget), pbw[0], pbw[1], &channel->cdma);
nvhost_debug_output(o, "\n");
@@ -294,11 +312,17 @@ void t20_debug_show_channel_fifo(struct nvhost_master *m,
struct output *o, int chid)
{
u32 val, rd_ptr, wr_ptr, start, end;
+ struct nvhost_channel *channel = m->channels + chid;
int state, count;
- val = readl(m->aperture + HOST1X_CHANNEL_FIFOSTAT);
- if (val & (1 << 10))
+ nvhost_debug_output(o, "%d: fifo:\n", chid);
+
+ val = readl(channel->aperture + HOST1X_CHANNEL_FIFOSTAT);
+ nvhost_debug_output(o, "FIFOSTAT %08x\n", val);
+ if (val & (1 << 10)) {
+ nvhost_debug_output(o, "[empty]\n");
return;
+ }
writel(0x0, m->aperture + HOST1X_SYNC_CFPEEK_CTRL);
writel((1 << 31) | (chid << 16),
@@ -313,7 +337,6 @@ void t20_debug_show_channel_fifo(struct nvhost_master *m,
end = (val >> 16) & 0x1ff;
state = NVHOST_DBG_STATE_CMD;
- nvhost_debug_output(o, "%d: fifo:\n", chid);
do {
writel(0x0, m->aperture + HOST1X_SYNC_CFPEEK_CTRL);