diff mbox

[RFC,7/8] drm/i915: Add commands in ringbuf for OA snapshot capture across Batchbuffer boundaries

Message ID 1434966619-3979-8-git-send-email-sourab.gupta@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

sourab.gupta@intel.com June 22, 2015, 9:50 a.m. UTC
From: Sourab Gupta <sourab.gupta@intel.com>

This patch inserts the commands in the ring for capturing OA snapshots across
batchbuffer boundaries. The data generated thus, would be of Batchbuffer
granularity. This data can be useful standalone for per batch buffer profiling
purposes. The issue of counter wraparound for large batch buffers can be
subverted by using this data in conjunction with the periodic OA sample data
which is generated alongside per BB snapshot data.
Such data gives useful information to userspace tool in order to analyse
batchbuffer specific performance and timing information.

Signed-off-by: Sourab Gupta <sourab.gupta@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 3336e1c..f5a2308 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1318,6 +1318,10 @@  i915_gem_ringbuffer_submission(struct drm_device *dev, struct drm_file *file,
 	}
 
 	exec_len = args->batch_len;
+
+	i915_insert_profiling_cmd(ring->buffer,
+			i915_execbuffer2_get_context_id(*args));
+
 	if (cliprects) {
 		for (i = 0; i < args->num_cliprects; i++) {
 			ret = i915_emit_box(ring, &cliprects[i],
@@ -1339,6 +1343,9 @@  i915_gem_ringbuffer_submission(struct drm_device *dev, struct drm_file *file,
 			return ret;
 	}
 
+	i915_insert_profiling_cmd(ring->buffer,
+			i915_execbuffer2_get_context_id(*args));
+
 	trace_i915_gem_ring_dispatch(intel_ring_get_request(ring), dispatch_flags);
 
 	i915_gem_execbuffer_move_to_active(vmas, ring);