All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 10/29] igt/perf: wrap emission of MI_REPORT_PERF_COUNT
Date: Tue, 25 Apr 2017 15:32:42 -0700	[thread overview]
Message-ID: <20170425223301.23733-11-lionel.g.landwerlin@intel.com> (raw)
In-Reply-To: <20170425223301.23733-1-lionel.g.landwerlin@intel.com>

From: Robert Bragg <robert@sixbynine.org>

Signed-off-by: Robert Bragg <robert@sixbynine.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 tests/perf.c | 44 ++++++++++++++++++++++++++++++++------------
 1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/tests/perf.c b/tests/perf.c
index 600fa7d9..864c465c 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -43,6 +43,7 @@
 IGT_TEST_DESCRIPTION("Test the i915 perf metrics streaming interface");
 
 #define GEN6_MI_REPORT_PERF_COUNT ((0x28 << 23) | (3 - 2))
+#define GEN8_MI_REPORT_PERF_COUNT ((0x28 << 23) | (4 - 2))
 
 #define GFX_OP_PIPE_CONTROL     ((3 << 29) | (3 << 27) | (2 << 24))
 #define PIPE_CONTROL_CS_STALL	   (1 << 20)
@@ -1949,6 +1950,32 @@ test_disabled_read_error(void)
 }
 
 static void
+emit_report_perf_count(struct intel_batchbuffer *batch,
+		       drm_intel_bo *dst_bo,
+		       int dst_offset,
+		       uint32_t report_id)
+{
+	if (IS_HASWELL(devid)) {
+		BEGIN_BATCH(3, 1);
+		OUT_BATCH(GEN6_MI_REPORT_PERF_COUNT);
+		OUT_RELOC(dst_bo, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
+			  dst_offset);
+		OUT_BATCH(report_id);
+		ADVANCE_BATCH();
+	} else {
+		/* XXX: NB: n dwords arg is actually magic since it internally
+		 * automatically accounts for larger addresses on gen >= 8...
+		 */
+		BEGIN_BATCH(3, 1);
+		OUT_BATCH(GEN8_MI_REPORT_PERF_COUNT);
+		OUT_RELOC(dst_bo, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
+			  dst_offset);
+		OUT_BATCH(report_id);
+		ADVANCE_BATCH();
+	}
+}
+
+static void
 test_mi_rpc(void)
 {
 	uint64_t properties[] = {
@@ -1991,12 +2018,10 @@ test_mi_rpc(void)
 	memset(bo->virtual, 0x80, 4096);
 	drm_intel_bo_unmap(bo);
 
-	BEGIN_BATCH(3, 1);
-	OUT_BATCH(GEN6_MI_REPORT_PERF_COUNT);
-	OUT_RELOC(bo, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
-		  0); /* offset in bytes */
-	OUT_BATCH(0xdeadbeef); /* report ID */
-	ADVANCE_BATCH();
+	emit_report_perf_count(batch,
+			       bo, /* dst */
+			       0, /* dst offset in bytes */
+			       0xdeadbeef); /* report ID */
 
 	intel_batchbuffer_flush_with_context(batch, context);
 
@@ -2063,12 +2088,7 @@ emit_stall_timestamp_and_rpc(struct intel_batchbuffer *batch,
 	OUT_BATCH(0); /* imm upper */
 	ADVANCE_BATCH();
 
-	BEGIN_BATCH(3, 1);
-	OUT_BATCH(GEN6_MI_REPORT_PERF_COUNT);
-	OUT_RELOC(dst, I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
-		  report_dst_offset);
-	OUT_BATCH(report_id);
-	ADVANCE_BATCH();
+	emit_report_perf_count(batch, dst, report_dst_offset, report_id);
 }
 
 /* Tests the INTEL_performance_query use case where an unprivileged process
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-04-25 22:33 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25 22:32 [PATCH i-g-t 00/29] Update i915 perf tests for Gen8+ Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 01/29] igt/perf: generalize lookup for test metric set Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 02/29] igt/perf: improve robustness of polling/blocking tests Lionel Landwerlin
2017-06-16 13:48   ` Matthew Auld
2017-04-25 22:32 ` [PATCH i-g-t 03/29] igt/perf: init timestamp freq and oa format per devid Lionel Landwerlin
2017-06-16 14:37   ` Matthew Auld
2017-04-25 22:32 ` [PATCH i-g-t 04/29] igt/perf: update init_sys_info for skl with per-gt configs Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 05/29] igt/perf: add gen8 formats Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 06/29] igt/perf: fix a counter indexing Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 07/29] igt/perf: generalize checks for undefined A counters Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 08/29] igt/perf: generalize reading gpu ticks from reports Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 09/29] igt/perf: move timebase + oa exponent utilities up Lionel Landwerlin
2017-04-25 22:32 ` Lionel Landwerlin [this message]
2017-04-25 22:32 ` [PATCH i-g-t 11/29] igt/perf: handling printing gen8 formats Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 12/29] igt/perf: avoid assumptions about oa exponent <-> freq mappings Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 13/29] igt/perf: allow 10% margin matching oa/sysfs freq in test_oa_exponents Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 14/29] igt/perf: s/test_perf_ctx_mi_rpc/hsw_test_single_ctx_counters/ Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 15/29] igt/perf: don't assume constant of 40 EUs Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 16/29] igt/perf: consider ctx-switch reports while polling/blocking Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 17/29] igt/perf: factor out oa report sanity checking Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 18/29] igt/perf: print [un]slice freq and report reasons in debug Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 19/29] igt/perf: update print_reports to print context ID Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 20/29] igt/perf: add utility function for checking periodic reports Lionel Landwerlin
2017-06-16 14:41   ` Matthew Auld
2017-04-25 22:32 ` [PATCH i-g-t 21/29] igt/perf: make stream_fd a global variable Lionel Landwerlin
2017-06-16 14:43   ` Matthew Auld
2017-06-16 14:46     ` Lionel Landwerlin
2017-06-21 13:47   ` Matthew Auld
2017-04-25 22:32 ` [PATCH i-g-t 22/29] igt/perf: add per context filtering test for gen8+ Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 23/29] igt/perf: update max buffer size for reading reports Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 24/29] igt/perf: fix rc6 test Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 25/29] igt/perf: rework oa-exponent test Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 26/29] igt/perf: make enable-disable more reliable Lionel Landwerlin
2017-04-25 22:32 ` [PATCH i-g-t 27/29] igt/perf: make buffer-fill " Lionel Landwerlin
2017-04-25 22:33 ` [PATCH i-g-t 28/29] igt/perf: load gt_boost_freq_mhz as max gt frequency Lionel Landwerlin
2017-04-25 22:33 ` [PATCH i-g-t 29/29] igt/perf: remove unused frequency functions Lionel Landwerlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170425223301.23733-11-lionel.g.landwerlin@intel.com \
    --to=lionel.g.landwerlin@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.