summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/t20/debug_t20.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2011-08-17 14:36:51 +0300
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:10 -0800
commit8cbed0f1c144bbb20b3d1dcf74d4caca7af0c620 (patch)
tree36d59f938c11341d752829661c63a8bc212bc740 /drivers/video/tegra/host/t20/debug_t20.c
parentab7815ed3c05a87b6a1b9d09ebe373ef2f784e54 (diff)
tegra: nvhost: Retrieve phys address from nvmap
Debug code used to rely on being able to calculate the base address of a pinned page by masking it. Now we always retrieve the physical address from nvmap and find the correct command buffer using that. Bug 840976 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/48105 Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> (cherry picked from commit 0ef5f2d4d94464b8d5562327c9cf5b56fe93fff5) Change-Id: I1a17665cf19d8758f154d4fd05f6a5ec6c07caff Reviewed-on: http://git-master/r/56266 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R12cdbf7b335ca46cd063cdf9dd7783b18255a3f1
Diffstat (limited to 'drivers/video/tegra/host/t20/debug_t20.c')
-rw-r--r--drivers/video/tegra/host/t20/debug_t20.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/video/tegra/host/t20/debug_t20.c b/drivers/video/tegra/host/t20/debug_t20.c
index fb101230cd8b..ed4a5e1de21c 100644
--- a/drivers/video/tegra/host/t20/debug_t20.c
+++ b/drivers/video/tegra/host/t20/debug_t20.c
@@ -146,32 +146,33 @@ static void show_channel_gather(struct output *o, u32 addr,
phys_addr_t phys_addr,
u32 words, struct nvhost_cdma *cdma)
{
- /* Calculate page boundary and offset */
- phys_addr_t map_base = phys_addr & PAGE_MASK;
- phys_addr_t map_offset = phys_addr - map_base;
-
/* Map dmaget cursor to corresponding nvmap_handle */
struct push_buffer *pb = &cdma->push_buffer;
u32 cur = addr - pb->phys;
- struct nvmap_handle *h = pb->handles[cur/8];
+ struct nvmap_client_handle *nvmap = &pb->nvmap[cur/8];
/* Create a fake nvmap_handle_ref - nvmap_mmap requires it
* but accesses only the first field - nvmap_handle */
- struct nvmap_handle_ref ref = {.handle = h};
+ struct nvmap_handle_ref ref = {.handle = nvmap->handle};
- u32 *map_addr;
+ u32 *map_addr, pin_addr, offset;
int state, count, i;
map_addr = nvmap_mmap(&ref);
if (!map_addr)
return;
+ /* Get base address from nvmap */
+ pin_addr = nvmap_pin(nvmap->client, &ref);
+ offset = phys_addr - pin_addr;
+ nvmap_unpin(nvmap->client, &ref);
+
/* GATHER buffer starts always with commands */
state = NVHOST_DBG_STATE_CMD;
for (i = 0; i < words; i++)
show_channel_word(o, &state, &count,
phys_addr + i * 4,
- *(map_addr + map_offset/4 + i), cdma);
+ *(map_addr + offset/4 + i), cdma);
nvmap_munmap(&ref, map_addr);
}