diff mbox

[RFC,06/12] drm/i915: Store GuC ukernel logs in the relay buffer

Message ID 1464378183-9433-7-git-send-email-akash.goel@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

akash.goel@intel.com May 27, 2016, 7:42 p.m. UTC
From: Akash Goel <akash.goel@intel.com>

Using the buffer managed by relay to store the snapshots of GuC log
buffer. The snapshot will be taken when GuC ukernel sends a log buffer
flush interrupt.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Akash Goel <akash.goel@intel.com>
---
 drivers/gpu/drm/i915/i915_guc_submission.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
index 379e2843..d6d6ead 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -773,14 +773,30 @@  err:
 
 static void guc_move_to_next_buf(struct intel_guc *guc)
 {
+#ifdef CONFIG_DEBUG_FS
+	/* nothing to do here, all managed by relay */
 	return;
+#endif
 }
 
 static void* guc_get_write_buffer(struct intel_guc *guc)
 {
 	void *base_addr = NULL;
 
+#ifdef CONFIG_DEBUG_FS
+	if (!guc->log_relay_chan)
+		return NULL;
+
+	/* Get the pointer to relay sub buffer and copy data into it ourselves.
+	 * Could have used the relay_write() but we anyways need the pointer
+	 * to update the state data in first page so to be consistent directly
+	 * write to all pages of sub buffer.
+	 */
+	base_addr =
+		relay_reserve(guc->log_relay_chan, guc->log_obj->base.size);
+
 	return base_addr;
+#endif
 }
 
 static void guc_read_update_log_buffer(struct drm_device *dev)