Commit ff41dd27 authored by Thierry Reding's avatar Thierry Reding

gpu: host1x: debug: Use dma_addr_t more consistently

The host1x debug code uses a mix of phys_addr_t, dma_addr_t and u32 to
represent addresses. However, these addresses are always DMA addresses
so use the appropriate type.

This fixes some issues with how these addresses are displayed, because
they could be truncated in some cases and not show the full address.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent ad85b084
...@@ -156,9 +156,9 @@ static unsigned int show_channel_command(struct output *o, u32 val, ...@@ -156,9 +156,9 @@ static unsigned int show_channel_command(struct output *o, u32 val,
} }
} }
static void show_gather(struct output *o, phys_addr_t phys_addr, static void show_gather(struct output *o, dma_addr_t phys_addr,
unsigned int words, struct host1x_cdma *cdma, unsigned int words, struct host1x_cdma *cdma,
phys_addr_t pin_addr, u32 *map_addr) dma_addr_t pin_addr, u32 *map_addr)
{ {
/* Map dmaget cursor to corresponding mem handle */ /* Map dmaget cursor to corresponding mem handle */
u32 offset = phys_addr - pin_addr; u32 offset = phys_addr - pin_addr;
...@@ -176,11 +176,11 @@ static void show_gather(struct output *o, phys_addr_t phys_addr, ...@@ -176,11 +176,11 @@ static void show_gather(struct output *o, phys_addr_t phys_addr,
} }
for (i = 0; i < words; i++) { for (i = 0; i < words; i++) {
u32 addr = phys_addr + i * 4; dma_addr_t addr = phys_addr + i * 4;
u32 val = *(map_addr + offset / 4 + i); u32 val = *(map_addr + offset / 4 + i);
if (!data_count) { if (!data_count) {
host1x_debug_output(o, "%08x: %08x: ", addr, val); host1x_debug_output(o, "%pad: %08x: ", &addr, val);
data_count = show_channel_command(o, val, &payload); data_count = show_channel_command(o, val, &payload);
} else { } else {
host1x_debug_cont(o, "%08x%s", val, host1x_debug_cont(o, "%08x%s", val,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment