diff options
Diffstat (limited to 'drivers/video/tegra/host/t20')
-rw-r--r-- | drivers/video/tegra/host/t20/3dctx_t20.c | 19 | ||||
-rw-r--r-- | drivers/video/tegra/host/t20/debug_t20.c | 43 |
2 files changed, 46 insertions, 16 deletions
diff --git a/drivers/video/tegra/host/t20/3dctx_t20.c b/drivers/video/tegra/host/t20/3dctx_t20.c index 7ac1b5e118cd..d0609fb61976 100644 --- a/drivers/video/tegra/host/t20/3dctx_t20.c +++ b/drivers/video/tegra/host/t20/3dctx_t20.c @@ -138,8 +138,8 @@ static void save_push_v0(struct nvhost_cdma *cdma, struct nvhost_hwctx *ctx) { nvhost_cdma_push_gather(cdma, - cdma_to_channel(cdma)->dev->nvmap, - nvmap_ref_to_handle(nvhost_3dctx_save_buf), + (void *)NVHOST_CDMA_PUSH_GATHER_CTXSAVE, + (void *)NVHOST_CDMA_PUSH_GATHER_CTXSAVE, nvhost_opcode_gather(save_size), save_phys); } @@ -260,7 +260,17 @@ static void __init setup_save_regs(struct save_info *info, break; } if (ptr) { - memset(ptr, 0, count * 4); + /* SAVE cases only: reserve room for incoming data */ + u32 k = 0; + /* + * Create a signature pattern for indirect data (which + * will be overwritten by true incoming data) for + * better deducing where we are in a long command + * sequence, when given only a FIFO snapshot for debug + * purposes. + */ + for (k = 0; k < count; k++) + *(ptr + k) = 0xd000d000 | (offset << 16) | k; ptr += count; } save_count += count; @@ -332,9 +342,6 @@ static void ctx3d_save_service(struct nvhost_hwctx *ctx) nvhost_syncpt_cpu_incr(&ctx->channel->dev->syncpt, NVSYNCPT_3D); } - -/*** savers ***/ - int __init t20_nvhost_3dctx_handler_init(struct nvhost_hwctx_handler *h) { struct nvhost_channel *ch; 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); |