summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/nvhost_cdma.c
diff options
context:
space:
mode:
authorAndrew Howe <ahowe@nvidia.com>2011-03-22 18:38:23 +0200
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:44:59 -0800
commit92be709bc9862ea968a1cc8ca006427bb787b57c (patch)
tree834901fd8a80711ca1420f5e2c6bca4a3bb15851 /drivers/video/tegra/host/nvhost_cdma.c
parent5dd93c6b6029ec95ed39b4a3dd76a0aff85c64b0 (diff)
video: tegra: host: Renovate debug code
Bring in changes to enable dumping the debug state to the kernel log (used when module suspend times out). Rewrote debug code to get that working more cleanly (no 16K buffer). Refactored & cleaned up debug code to make it easier to understand. Original-Change-Id: I22db36a627bfb1815a46866dfe23a5d3aa693edc Reviewed-on: http://git-master/r/24157 Reviewed-by: Scott Williams <scwilliams@nvidia.com> Tested-by: Scott Williams <scwilliams@nvidia.com> Original-Change-Id: I92d7dcc4ede088179a5a1bca982fdfba1eeb3553 Rebase-Id: Ra013bf33c1002d2e37a7c97b7d4b441ad51f7211
Diffstat (limited to 'drivers/video/tegra/host/nvhost_cdma.c')
-rw-r--r--drivers/video/tegra/host/nvhost_cdma.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/video/tegra/host/nvhost_cdma.c b/drivers/video/tegra/host/nvhost_cdma.c
index ad5b3853c8dc..05d563c31c8f 100644
--- a/drivers/video/tegra/host/nvhost_cdma.c
+++ b/drivers/video/tegra/host/nvhost_cdma.c
@@ -3,7 +3,7 @@
*
* Tegra Graphics Host Command DMA
*
- * Copyright (c) 2010, NVIDIA Corporation.
+ * Copyright (c) 2010-2011, NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -627,22 +627,15 @@ void nvhost_cdma_flush(struct nvhost_cdma *cdma)
}
/**
- * Find the currently executing gather in the push buffer and return
- * its physical address and size.
+ * Retrieve the op pair at a slot offset from a DMA address
*/
-void nvhost_cdma_find_gather(struct nvhost_cdma *cdma, u32 dmaget, u32 *addr, u32 *size)
+void nvhost_cdma_peek(struct nvhost_cdma *cdma,
+ u32 dmaget, int slot, u32 *out)
{
u32 offset = dmaget - cdma->push_buffer.phys;
+ u32 *p = cdma->push_buffer.mapped;
- *addr = *size = 0;
-
- if (offset >= 8 && offset < cdma->push_buffer.cur) {
- u32 *p = cdma->push_buffer.mapped + (offset - 8) / 4;
-
- /* Make sure we have a gather */
- if ((p[0] >> 28) == 6) {
- *addr = p[1];
- *size = p[0] & 0x3fff;
- }
- }
+ offset = ((offset + slot * 8) & (PUSH_BUFFER_SIZE - 1)) >> 2;
+ out[0] = p[offset];
+ out[1] = p[offset + 1];
}