DNI: Trace register commits

Use ftrace ring buffers to efficiently log all dl list commits
diff --git a/drivers/media/platform/vsp1/vsp1_dl.c b/drivers/media/platform/vsp1/vsp1_dl.c
index 0af3e8f..662e54a 100644
--- a/drivers/media/platform/vsp1/vsp1_dl.c
+++ b/drivers/media/platform/vsp1/vsp1_dl.c
@@ -19,6 +19,7 @@
 
 #include "vsp1.h"
 #include "vsp1_dl.h"
+#include "vsp1_debugfs.h"
 
 #define VSP1_DL_NUM_ENTRIES		256
 
@@ -431,6 +432,17 @@
 	return 0;
 }
 
+static void trace_list_entries(struct vsp1_dl_list *dl)
+{
+	int i;
+
+	for (i = 0; i < dl->body0.num_entries; i++) {
+		struct vsp1_dl_entry *e = &dl->body0.entries[i];
+		trace_printk("0x%08x -> %s\n", e->data,
+				vsp1_reg_to_name(e->addr));
+	}
+}
+
 static void vsp1_dl_list_fill_header(struct vsp1_dl_list *dl, bool is_last)
 {
 	struct vsp1_dl_header_list *hdr = dl->header->lists;
@@ -477,6 +489,8 @@
 	unsigned long flags;
 	bool update;
 
+	trace_list_entries(dl);
+
 	spin_lock_irqsave(&dlm->lock, flags);
 
 	if (dl->dlm->mode == VSP1_DL_MODE_HEADER) {
diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
index cd6f1d3..81aadca 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/vsp1/vsp1_drm.c
@@ -41,6 +41,8 @@
 {
 	unsigned long flags;
 
+	trace_printk("Handling Frame End");
+
 	/*
 	 * Write-back support for the VSP DU pipeline requires the WPF must be
 	 * reconfigured on each frame where a new buffer has been provided.
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
index 18bc896..936940d 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -329,6 +329,11 @@
 	for (i = 0; i < done->buf.vb2_buf.num_planes; ++i)
 		vb2_set_plane_payload(&done->buf.vb2_buf, i,
 				      vb2_plane_size(&done->buf.vb2_buf, i));
+
+	trace_printk("Completing buffer %d (0x%08llx)",
+			done->buf.vb2_buf.index,
+			done->mem.addr[0]);
+
 	vb2_buffer_done(&done->buf.vb2_buf, VB2_BUF_STATE_DONE);
 
 	return next;
@@ -344,6 +349,10 @@
 	if (buf == NULL)
 		return;
 
+	trace_printk("Configuring video for buffer %d (0x%08llx)",
+			buf->buf.vb2_buf.index,
+			buf->mem.addr[0]);
+
 	video->rwpf->mem = buf->mem;
 	pipe->buffers_ready |= 1 << video->pipe_index;
 }
@@ -874,12 +883,18 @@
 					queue);
 
 	if (buf) {
+		trace_printk("Configuring video for buffer %d (0x%08llx)",
+				buf->buf.vb2_buf.index,
+				buf->mem.addr[0]);
+
 		video->rwpf->mem = buf->mem;
 
 		/* Move this buffer to the IRQ queue */
 		list_del(&buf->queue);
 		list_add_tail(&buf->queue, &video->irqqueue);
 	} else {
+		trace_printk("Setting writeback disabled (no buffer)");
+
 		/* Disable writeback with no buffer */
 		video->rwpf->mem = (struct vsp1_rwpf_memory) { 0 };
 	}
@@ -912,6 +927,9 @@
 
 	spin_lock_irqsave(&video->irqlock, flags);
 	list_add_tail(&buf->queue, &video->wbqueue);
+	trace_printk("Queueing buffer buffer %d (0x%08llx)",
+			buf->buf.vb2_buf.index,
+			buf->mem.addr[0]);
 	spin_unlock_irqrestore(&video->irqlock, flags);
 
 	return;
diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c
index 3c92de5..81da6fe 100644
--- a/drivers/media/platform/vsp1/vsp1_wpf.c
+++ b/drivers/media/platform/vsp1/vsp1_wpf.c
@@ -250,6 +250,8 @@
 
 	bool writeback = pipe->lif && wpf->mem.addr[0];
 
+	trace_printk("Writeback %s", writeback ? "enabled" : "disabled");
+
 	if (params == VSP1_ENTITY_PARAMS_RUNTIME) {
 		const unsigned int mask = BIT(WPF_CTRL_VFLIP)
 					| BIT(WPF_CTRL_HFLIP);