[PATCH RFC 022/111] staging: etnaviv: add an offset for buffer dumping

Lucas Stach l.stach at pengutronix.de
Thu Apr 2 08:29:24 PDT 2015


From: Russell King <rmk+kernel at arm.linux.org.uk>

We don't always want to dump the start of the buffer.  Pass a byte
offset from the beginning of the buffer to be dumped.

Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
---
 drivers/staging/etnaviv/etnaviv_buffer.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/etnaviv/etnaviv_buffer.c b/drivers/staging/etnaviv/etnaviv_buffer.c
index 30ef93aed22a..38b103543cce 100644
--- a/drivers/staging/etnaviv/etnaviv_buffer.c
+++ b/drivers/staging/etnaviv/etnaviv_buffer.c
@@ -116,13 +116,13 @@ static void etnaviv_cmd_select_pipe(struct etnaviv_gem_object *buffer, u8 pipe)
 }
 
 static void etnaviv_buffer_dump(struct etnaviv_gpu *gpu,
-	struct etnaviv_gem_object *obj, u32 len)
+	struct etnaviv_gem_object *obj, u32 off, u32 len)
 {
 	u32 size = obj->base.size;
-	u32 *ptr = obj->vaddr;
+	u32 *ptr = obj->vaddr + off;
 
 	dev_info(gpu->dev->dev, "virt %p phys 0x%08x free 0x%08x\n",
-			obj->vaddr, obj->paddr, size - len * 4);
+			ptr, obj->paddr + off, size - len * 4 - off);
 
 	print_hex_dump(KERN_INFO, "cmd ", DUMP_PREFIX_OFFSET, 16, 4,
 			ptr, len * 4, 0);
@@ -151,7 +151,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, struct et
 	u32 back;
 	u32 i;
 
-	etnaviv_buffer_dump(gpu, buffer, 0x50);
+	etnaviv_buffer_dump(gpu, buffer, 0, 0x50);
 
 	/* save offset back into main buffer */
 	back = buffer->offset;
@@ -187,7 +187,8 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, struct et
 
 		/* TODO: remove later */
 		if (unlikely(drm_debug & DRM_UT_CORE))
-			etnaviv_buffer_dump(gpu, obj, submit->cmd[i].size);
+			etnaviv_buffer_dump(gpu, obj, submit->cmd[i].offset * 4,
+					    submit->cmd[i].size);
 	}
 
 	/* change ll to NOP */
@@ -204,5 +205,5 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, struct et
 	*(lw)= i;
 	mb();
 
-	etnaviv_buffer_dump(gpu, buffer, 0x50);
+	etnaviv_buffer_dump(gpu, buffer, 0, 0x50);
 }
-- 
2.1.4



More information about the dri-devel mailing list