Skip to contentSkip to conversation

IGT Testcases for i915 DAPC feature

PATCH New Sagar Arun Kamble 2 participants 10 messages Sep 7, 2017 Library code

lore
Share & tools
lore
#0 lore raw

cover IGT Testcases for i915 DAPC feature

This series implements set of testcases for verifying data sampled through i915 perf/DAPC feature. It tests validity of association of OA with correct engine/stream, ctx id, pid, tag, timestamps, mmio samples w.r.t execbuf begin and end. It also adds a testcase to verify concurrent operation of two stream.
Currently MMIO testcase is failing as HW is reading the RC6 register as zero if the stream has OA sampling also ON. Testcase however passes if we sample MMIO along with Timestamps. Need to investigate this more. More subtests to be added to test the proper interleaving of CS and OA reports based on timestamps by varying the periodic timer for OA reports.

Cc Lionel Landwerlin <[email protected]>
Cc "Rogozhkin, Dmitry V" <[email protected]>

Sagar Arun Kamble (8):
tests/perf: Rename perf test to intel_perf tests/perf: Test i915 assisted command stream based perf metrics
capture
tests/perf: Add testcase to verify ctx id
tests/perf: Add testcase to verify pid
tests/perf: Add testcase to verify tag
tests/perf: Add testcase to verify timestamps tests/perf: Add testcase to verify mmio
tests/perf: Add testcase to verify concurrent streams

 lib/ioctl_wrappers.h    |    1 +
 tests/Makefile.sources  |    3 +-
 tests/intel_perf.c      | 3353 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/intel_perf_dapc.c | 1679 ++++++++++++++++++++++++
 tests/perf.c            | 3353 -----------------------------------------------
 5 files changed, 5035 insertions(+), 3354 deletions(-)
 create mode 100644 tests/intel_perf.c
 create mode 100644 tests/intel_perf_dapc.c
 delete mode 100644 tests/perf.c
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/8 tests/perf: Rename perf test to intel_perf

---
 tests/Makefile.sources |    2 +-
 tests/intel_perf.c     | 3353 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/perf.c           | 3353 ------------------------------------------------
 3 files changed, 3354 insertions(+), 3354 deletions(-)
 create mode 100644 tests/intel_perf.c
 delete mode 100644 tests/perf.c
tests/Makefile.sources +1 -1
index 0f4e39a..69c83ae 100644
@@ -169,6 +169,7 @@ TESTS_progs = \
 	gen3_render_tiledy_blits \
 	gen7_forcewake_mt \
 	gvt_basic \
+	intel_perf \
 	kms_3d \
 	kms_addfb_basic \
 	kms_atomic \
@@ -215,7 +216,6 @@ TESTS_progs = \
 	kms_universal_plane \
 	kms_vblank \
 	meta_test \
-	perf \
 	pm_backlight \
 	pm_lpsp \
 	pm_rc6_residency \
tests/intel_perf.c new file +3353 -0

2,986 lines not on this page · raw message

tests/perf.c deleted +0 -3353

3,353 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH 2/8 tests/perf: Test i915 assisted command stream based perf metrics capture

In reply to Sagar Arun Kamble

This tests different performance metrics being streamed by i915 driver. This feature in i915 also referred as Driver Assisted Performance Capture (DAPC) provides userspace an ability to sample the OA reports at execbuf boundaries and associate other metadata like CTX ID, PID, TAG with each sample. Further, ability to capture engine timestamps and MMIO reads is also provided.

---
 tests/Makefile.sources  |   1 +
 tests/intel_perf_dapc.c | 794 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 795 insertions(+)
 create mode 100644 tests/intel_perf_dapc.c
tests/Makefile.sources +1 -0
index 69c83ae..1584352 100644
@@ -170,6 +170,7 @@ TESTS_progs = \
 	gen7_forcewake_mt \
 	gvt_basic \
 	intel_perf \
+	intel_perf_dapc \
 	kms_3d \
 	kms_addfb_basic \
 	kms_atomic \
tests/intel_perf_dapc.c new file +794 -0

794 lines not on this page · raw message

Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 3/8 tests/perf: Add testcase to verify ctx id

In reply to Sagar Arun Kamble

This subtest verifies that the CS perf samples contains proper HW context ID as captured through CONTEXT_PARAM_HW_ID.

---
 lib/ioctl_wrappers.h    |   1 +
 tests/intel_perf_dapc.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 101 insertions(+), 2 deletions(-)
lib/ioctl_wrappers.h +1 -0
index 8915edc..e3cdaff 100644
@@ -130,6 +130,7 @@ struct local_i915_gem_context_param {
 #define LOCAL_CONTEXT_PARAM_GTT_SIZE	0x3
 #define LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE	0x4
 #define LOCAL_CONTEXT_PARAM_BANNABLE	0x5
+#define LOCAL_CONTEXT_PARAM_HW_ID	0x6
 	uint64_t value;
 };
 void gem_context_require_bannable(int fd);
tests/intel_perf_dapc.c +100 -2

135 lines not on this page · raw message

Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

PATCH 4/8 tests/perf: Add testcase to verify pid

In reply to Sagar Arun Kamble
---
 tests/intel_perf_dapc.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)
tests/intel_perf_dapc.c +76 -0
index 82cb8e6..afd49f4 100644
@@ -862,6 +862,79 @@ test_perf_ctxid(void)
 	igt_waitchildren();
 }
 
+struct oa_pid_sample {
+	uint64_t pid;
+	uint8_t oa_report[];
+};
+
+static void
+verify_pid(uint8_t *perf_reports, int num_reports, size_t report_size,
+	   uint64_t pid)
+{
+	struct oa_pid_sample *sample;
+	uint32_t *oa_report;
+
+	for (int i = 0; i < num_reports; i++) {
+		size_t offset = i * report_size;
+
+		sample = (struct oa_pid_sample *) (perf_reports + offset);
+		oa_report = (uint32_t *) sample->oa_report;
+
+		igt_debug("read report: pid= %lu, reason = %x, "
+			  "timestamp = %x\n",
+			  sample->pid, oa_report[0], oa_report[1]);
+
+		if (!oa_report[0])
+			igt_assert(sample->pid == pid);
+	}
+}
+
+static void
+test_perf_pid(void)
+{
+	uint64_t properties[] = {
+		/* Include OA reports in samples */
+		DRM_I915_PERF_PROP_SAMPLE_OA, true,
+
+		/* OA unit configuration */
+		DRM_I915_PERF_PROP_OA_METRICS_SET, test_metric_set_id,
+		DRM_I915_PERF_PROP_OA_FORMAT, test_oa_format,
+		DRM_I915_PERF_PROP_OA_EXPONENT, oa_exp_1_millisec,
+
+		/* CS parameters */
+		DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
+		DRM_I915_PERF_PROP_SAMPLE_PID, true,
+	};
+	struct drm_i915_perf_open_param param = {
+		.flags = I915_PERF_FLAG_FD_CLOEXEC,
+		.num_properties = sizeof(properties) / 16,
+		.properties_ptr = to_user_pointer(properties),
+	};
+
+	/* should be default, but just to be sure... */
+	write_u64_file("/proc/sys/dev/i915/perf_stream_paranoid", 1);
+
+	igt_fork(child, 1) {
+		int prop_size = ARRAY_SIZE(properties);
+		int num_reports = 10;
+		int report_size = get_perf_report_size(properties, prop_size,
+						       test_oa_format);
+		int total_size = num_reports * report_size;
+		uint8_t *perf_reports = malloc(total_size);
+		uint64_t pid = getpid();
+
+		igt_assert(perf_reports);
+
+		perf_stream_capture_workload_samples(&param, perf_reports,
+						     num_reports, report_size,
+						     NULL);
+		verify_pid(perf_reports, num_reports, report_size, pid);
+		free(perf_reports);
+	}
+
+	igt_waitchildren();
+}
+
 igt_main
 {
 	igt_skip_on_simulation();
@@ -886,6 +959,9 @@ igt_main
 	igt_subtest("perf-ctxid")
 		test_perf_ctxid();
 
+	igt_subtest("perf-pid")
+		test_perf_pid();
+
 	igt_fixture {
 		close(drm_fd);
 	}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH 5/8 tests/perf: Add testcase to verify tag

In reply to Sagar Arun Kamble
---
 tests/intel_perf_dapc.c | 134 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 134 insertions(+)
tests/intel_perf_dapc.c +134 -0
index afd49f4..a9903fb 100644
@@ -515,6 +515,16 @@ get_perf_report_size(uint64_t *properties, int prop_size, int format_id)
 	return sample_size;
 }
 
+static size_t
+get_perf_report_size_nonoa(uint64_t *properties, int prop_size)
+{
+	size_t sample_size = 0;
+
+	sample_size += get_oa_report_offset(properties, prop_size);
+
+	return sample_size;
+}
+
 static bool
 read_perf_reports(int stream_fd,
 		  uint8_t *perf_reports,
@@ -935,6 +945,127 @@ test_perf_pid(void)
 	igt_waitchildren();
 }
 
+struct ts_tag_sample {
+	uint64_t tag;
+	uint64_t ts;
+};
+
+static void
+verify_tag(uint8_t *perf_reports, int num_reports, size_t report_size,
+	   uint64_t tag, int match_index)
+{
+	struct ts_tag_sample *sample;
+
+	for (int i = 0; i < num_reports; i++) {
+		size_t offset = i * report_size;
+
+		sample = (struct ts_tag_sample *) (perf_reports + offset);
+
+		igt_debug("read report: tag= %lu, timestamp = %lu\n",
+			  sample->tag, sample->ts);
+
+		if (i < match_index)
+			igt_assert(sample->tag != tag);
+		else
+			igt_assert(sample->tag == tag);
+	}
+}
+
+#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
+#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
+
+static void
+test_perf_tag(void)
+{
+	uint64_t properties[] = {
+		/* CS parameters */
+		DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
+		DRM_I915_PERF_PROP_SAMPLE_TAG, true,
+		DRM_I915_PERF_PROP_SAMPLE_TS, true,
+	};
+	struct drm_i915_perf_open_param param = {
+		.flags = I915_PERF_FLAG_FD_CLOEXEC,
+		.num_properties = sizeof(properties) / 16,
+		.properties_ptr = to_user_pointer(properties),
+	};
+
+	/* should be default, but just to be sure... */
+	write_u64_file("/proc/sys/dev/i915/perf_stream_paranoid", 1);
+
+	igt_fork(child, 1) {
+		const int gen = intel_gen(intel_get_drm_devid(drm_fd));
+		int prop_size = ARRAY_SIZE(properties);
+		int report_size = get_perf_report_size_nonoa(properties,
+							     prop_size);
+		int num_reports = 4;
+		int total_size = num_reports * report_size;
+		int stream_fd;
+		bool valid_data = false;
+		uint64_t test_tag = 0xFEED0001;
+		uint8_t *perf_reports = NULL;
+		const uint32_t bbe = MI_BATCH_BUFFER_END;
+		struct drm_i915_gem_exec_object2 object[1];
+		struct drm_i915_gem_execbuffer2 execbuf;
+		drm_intel_bufmgr *bufmgr;
+		drm_intel_context *context0;
+		uint32_t ctx_id = 0xffffffff; /* invalid id */
+		int ret;
+
+		memset(&execbuf, 0, sizeof(execbuf));
+		execbuf.buffers_ptr = to_user_pointer(object);
+		execbuf.flags = I915_EXEC_RENDER;
+		execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC;
+		execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT;
+		if (gen < 6)
+			execbuf.flags |= I915_EXEC_SECURE;
+
+		memset(object, 0, sizeof(object));
+		object[0].handle = gem_create(drm_fd, 4096);
+		gem_write(drm_fd, object[0].handle, 0, &bbe, sizeof(bbe));
+
+		bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
+		drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+
+		context0 = drm_intel_gem_context_create(bufmgr);
+		igt_assert(context0);
+
+		ret = drm_intel_gem_context_get_id(context0, &ctx_id);
+		igt_assert_eq(ret, 0);
+		igt_assert_neq(ctx_id, 0xffffffff);
+
+		perf_reports = malloc(total_size);
+		igt_assert(perf_reports);
+
+		igt_debug("opening render i915-perf stream\n");
+		stream_fd = __perf_open(drm_fd, &param);
+
+		execbuf.buffer_count = 1;
+		/* Do a submission with default tag */
+		gem_execbuf(drm_fd, &execbuf);
+
+		i915_execbuffer2_set_tag(execbuf, (uint64_t)test_tag);
+		/* Now submit with user tag */
+		gem_execbuf(drm_fd, &execbuf);
+
+		gem_close(drm_fd, object[0].handle);
+
+		drm_intel_gem_context_destroy(context0);
+		drm_intel_bufmgr_destroy(bufmgr);
+
+		valid_data = read_perf_reports(stream_fd, perf_reports,
+					       num_reports, report_size,
+					       false);
+		igt_assert(valid_data);
+		close(stream_fd);
+
+		igt_debug("Verify tag: %lu\n", test_tag);
+		verify_tag(perf_reports, num_reports, report_size,
+			   test_tag, 2);
+		free(perf_reports);
+	}
+	igt_waitchildren();
+}
+
 igt_main
 {
 	igt_skip_on_simulation();
@@ -962,6 +1093,9 @@ igt_main
 	igt_subtest("perf-pid")
 		test_perf_pid();
 
+	igt_subtest("perf-tag")
+		test_perf_tag();
+
 	igt_fixture {
 		close(drm_fd);
 	}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH 6/8 tests/perf: Add testcase to verify timestamps

In reply to Sagar Arun Kamble
---
 tests/intel_perf_dapc.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)
tests/intel_perf_dapc.c +75 -0
index a9903fb..1831a81 100644
@@ -1066,6 +1066,78 @@ test_perf_tag(void)
 	igt_waitchildren();
 }
 
+struct oa_ts_sample {
+	uint64_t ts;
+	uint8_t oa_report[];
+};
+
+static void
+verify_ts(uint8_t *perf_reports, int num_reports, size_t report_size)
+{
+	struct oa_ts_sample *sample;
+	uint32_t *oa_report;
+	uint64_t prev_ts = 0;
+
+	for (int i = 0; i < num_reports; i++) {
+		size_t offset = i * report_size;
+
+		sample = (struct oa_ts_sample *) (perf_reports + offset);
+		oa_report = (uint32_t *) sample->oa_report;
+
+		igt_debug("read report: ts= %lu, reason = %x, "
+			  "timestamp = %x\n",
+			  sample->ts, oa_report[0], oa_report[1]);
+
+		igt_assert(sample->ts > prev_ts);
+		prev_ts = sample->ts;
+	}
+}
+
+static void
+test_perf_ts(void)
+{
+	uint64_t properties[] = {
+		/* Include OA reports in samples */
+		DRM_I915_PERF_PROP_SAMPLE_OA, true,
+
+		/* OA unit configuration */
+		DRM_I915_PERF_PROP_OA_METRICS_SET, test_metric_set_id,
+		DRM_I915_PERF_PROP_OA_FORMAT, test_oa_format,
+		DRM_I915_PERF_PROP_OA_EXPONENT, oa_exp_1_millisec,
+
+		/* CS parameters */
+		DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
+		DRM_I915_PERF_PROP_SAMPLE_TS, true,
+	};
+	struct drm_i915_perf_open_param param = {
+		.flags = I915_PERF_FLAG_FD_CLOEXEC,
+		.num_properties = sizeof(properties) / 16,
+		.properties_ptr = to_user_pointer(properties),
+	};
+
+	/* should be default, but just to be sure... */
+	write_u64_file("/proc/sys/dev/i915/perf_stream_paranoid", 1);
+
+	igt_fork(child, 1) {
+		int prop_size = ARRAY_SIZE(properties);
+		int num_reports = 10;
+		int report_size = get_perf_report_size(properties, prop_size,
+						       test_oa_format);
+		int total_size = num_reports * report_size;
+		uint8_t *perf_reports = malloc(total_size);
+
+		igt_assert(perf_reports);
+
+		perf_stream_capture_workload_samples(&param, perf_reports,
+						     num_reports, report_size,
+						     NULL);
+		verify_ts(perf_reports, num_reports, report_size);
+		free(perf_reports);
+	}
+
+	igt_waitchildren();
+}
+
 igt_main
 {
 	igt_skip_on_simulation();
@@ -1096,6 +1168,9 @@ igt_main
 	igt_subtest("perf-tag")
 		test_perf_tag();
 
+	igt_subtest("perf-ts")
+		test_perf_ts();
+
 	igt_fixture {
 		close(drm_fd);
 	}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH 7/8 tests/perf: Add testcase to verify mmio

In reply to Sagar Arun Kamble
---
 tests/intel_perf_dapc.c | 291 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 291 insertions(+)
tests/intel_perf_dapc.c +291 -0
index 1831a81..ac6f3d1 100644
@@ -1138,6 +1138,291 @@ test_perf_ts(void)
 	igt_waitchildren();
 }
 
+static char *
+read_debugfs_record(int device, const char *file, const char *key)
+{
+	FILE *fp;
+	int fd;
+	char *line = NULL;
+	size_t line_buf_size = 0;
+	int len = 0;
+	int key_len = strlen(key);
+	char *value = NULL;
+
+	fd = igt_debugfs_open(device, file, O_RDONLY);
+	fp = fdopen(fd, "r");
+	igt_require(fp);
+
+	while ((len = getline(&line, &line_buf_size, fp)) > 0) {
+
+		if (line[len - 1] == '\n')
+			line[len - 1] = '\0';
+
+		if (strncmp(key, line, key_len) == 0 &&
+		    line[key_len] == ':' &&
+		    line[key_len + 1] == ' ') {
+			value = strdup(line + key_len + 2);
+			goto done;
+		}
+	}
+
+	igt_assert(!"reached");
+done:
+	free(line);
+	fclose(fp);
+	close(fd);
+	return value;
+}
+
+static uint64_t
+read_debugfs_u64_record(int fd, const char *file, const char *key)
+{
+	char *str_val = read_debugfs_record(fd, file, key);
+	uint64_t val;
+
+	igt_require(str_val);
+
+	val = strtoull(str_val, NULL, 0);
+	free(str_val);
+
+	return val;
+}
+
+/* Logic taken from i915 source. */
+static uint64_t
+intel_rc6_residency_us(uint64_t time_hw)
+{
+	uint64_t units, div;
+
+	if (IS_GEMINILAKE(devid) || IS_BROXTON(devid)) {
+		units = 1000;
+		div = 1200;		/* 833.33ns */
+	} else {
+		units = 128000; /* 1.28us */
+		div = 100000;
+	}
+
+	return ((time_hw * units) / div);
+}
+
+struct oa_mmio_sample {
+	uint32_t mmio[2];
+	uint8_t oa_report[];
+};
+
+static void
+verify_oa_mmio(uint8_t *perf_reports, int num_reports, size_t report_size,
+	       uint64_t *pre_mmio_residency, uint64_t *post_mmio_residency)
+{
+	struct oa_mmio_sample *sample;
+	uint64_t rc6_residency;
+	uint64_t rc6p_residency;
+	uint32_t *oa_report;
+
+	igt_debug("pre rc6 residency = %lu, rc6p residency = %lu, "
+		  "post rc6 residency = %lu, rc6p residency = %lu\n",
+		  pre_mmio_residency[0], pre_mmio_residency[1],
+		  post_mmio_residency[0], post_mmio_residency[1]);
+
+	for (int i = 0; i < num_reports; i++) {
+		size_t offset = i * report_size;
+
+		sample = (struct oa_mmio_sample *) (perf_reports + offset);
+		oa_report = (uint32_t *) sample->oa_report;
+
+		rc6_residency = intel_rc6_residency_us(sample->mmio[0]);
+		rc6p_residency = intel_rc6_residency_us(sample->mmio[1]);
+
+		igt_debug("read mmio: rc6 = %u, rc6 residency = %lu, "
+			  "rc6p = %u, rc6p residency = %lu\n",
+			  sample->mmio[0], rc6_residency,
+			  sample->mmio[1], rc6p_residency);
+
+		igt_debug("read report: reason = %x, timestamp = %x\n",
+			  oa_report[0], oa_report[1]);
+
+		if (!oa_report[0]) {
+			igt_assert(rc6_residency >= pre_mmio_residency[0]);
+			igt_assert(rc6p_residency >= pre_mmio_residency[1]);
+			igt_assert(rc6_residency <= post_mmio_residency[0]);
+			igt_assert(rc6p_residency <= post_mmio_residency[1]);
+		}
+	}
+}
+
+static void
+test_perf_oa_mmio(void)
+{
+	uint64_t properties[] = {
+		/* Include OA reports in samples */
+		DRM_I915_PERF_PROP_SAMPLE_OA, true,
+
+		/* OA unit configuration */
+		DRM_I915_PERF_PROP_OA_METRICS_SET, test_metric_set_id,
+		DRM_I915_PERF_PROP_OA_FORMAT, test_oa_format,
+		DRM_I915_PERF_PROP_OA_EXPONENT, oa_exp_1_millisec,
+
+		/* CS parameters */
+		DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
+		DRM_I915_PERF_PROP_SAMPLE_MMIO, 0,
+	};
+	struct drm_i915_perf_open_param param = {
+		.flags = I915_PERF_FLAG_FD_CLOEXEC,
+		.num_properties = sizeof(properties) / 16,
+		.properties_ptr = to_user_pointer(properties),
+	};
+	struct drm_i915_perf_mmio_list mmio;
+
+	memset(&mmio, 0, sizeof(mmio));
+
+#define GEN6_GT_GFX_RC6				0x138108
+#define GEN6_GT_GFX_RC6p			0x13810C
+	mmio.mmio_list[0] = GEN6_GT_GFX_RC6;
+	mmio.mmio_list[1] = GEN6_GT_GFX_RC6p;
+	mmio.num_mmio = 2;
+
+	properties[ARRAY_SIZE(properties) - 1] = (uint64_t)&mmio;
+
+	/* should be default, but just to be sure... */
+	write_u64_file("/proc/sys/dev/i915/perf_stream_paranoid", 1);
+
+	igt_fork(child, 1) {
+		int prop_size = ARRAY_SIZE(properties);
+		int num_reports = 10;
+		int report_size = get_perf_report_size(properties, prop_size,
+						       test_oa_format);
+		int total_size = num_reports * report_size;
+		uint8_t *perf_reports = malloc(total_size);
+		uint64_t pre_mmio_residency[2], post_mmio_residency[2];
+
+		igt_assert(perf_reports);
+
+		pre_mmio_residency[0] = read_debugfs_u64_record(drm_fd,
+						"i915_drpc_info",
+						"RC6 residency since boot");
+		pre_mmio_residency[1] = read_debugfs_u64_record(drm_fd,
+						"i915_drpc_info",
+						"RC6+ residency since boot");
+		perf_stream_capture_workload_samples(&param, perf_reports,
+						     num_reports, report_size,
+						     NULL);
+		post_mmio_residency[0] = read_debugfs_u64_record(drm_fd,
+						"i915_drpc_info",
+						"RC6 residency since boot");
+		post_mmio_residency[1] = read_debugfs_u64_record(drm_fd,
+						"i915_drpc_info",
+						"RC6+ residency since boot");
+		verify_oa_mmio(perf_reports, num_reports, report_size,
+			       pre_mmio_residency, post_mmio_residency);
+		free(perf_reports);
+	}
+
+	igt_waitchildren();
+}
+
+struct ts_mmio_sample {
+	uint64_t ts;
+	uint32_t mmio[2];
+};
+
+static void
+verify_ts_mmio(uint8_t *perf_reports, int num_reports, size_t report_size,
+	       uint64_t *pre_mmio_residency, uint64_t *post_mmio_residency)
+{
+	struct ts_mmio_sample *sample;
+	uint64_t rc6_residency;
+	uint64_t rc6p_residency;
+
+	igt_debug("pre rc6 residency = %lu, rc6p residency = %lu, "
+		  "post rc6 residency = %lu, rc6p residency = %lu\n",
+		  pre_mmio_residency[0], pre_mmio_residency[1],
+		  post_mmio_residency[0], post_mmio_residency[1]);
+
+	for (int i = 0; i < num_reports; i++) {
+		size_t offset = i * report_size;
+
+		sample = (struct ts_mmio_sample *) (perf_reports + offset);
+
+		rc6_residency = intel_rc6_residency_us(sample->mmio[0]);
+		rc6p_residency = intel_rc6_residency_us(sample->mmio[1]);
+
+		igt_debug("read mmio: rc6 = %u, rc6 residency = %lu, "
+			  "rc6p = %u, rc6p residency = %lu\n",
+			  sample->mmio[0], rc6_residency,
+			  sample->mmio[1], rc6p_residency);
+
+		igt_debug("read report: timestamp = %lu\n", sample->ts);
+
+		igt_assert(rc6_residency >= pre_mmio_residency[0]);
+		igt_assert(rc6p_residency >= pre_mmio_residency[1]);
+		igt_assert(rc6_residency <= post_mmio_residency[0]);
+		igt_assert(rc6p_residency <= post_mmio_residency[1]);
+	}
+}
+
+static void
+test_perf_ts_mmio(void)
+{
+	uint64_t properties[] = {
+		/* CS parameters */
+		DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
+		DRM_I915_PERF_PROP_SAMPLE_TS, true,
+		DRM_I915_PERF_PROP_SAMPLE_MMIO, 0,
+	};
+	struct drm_i915_perf_open_param param = {
+		.flags = I915_PERF_FLAG_FD_CLOEXEC,
+		.num_properties = sizeof(properties) / 16,
+		.properties_ptr = to_user_pointer(properties),
+	};
+	struct drm_i915_perf_mmio_list mmio;
+
+	memset(&mmio, 0, sizeof(mmio));
+
+#define GEN6_GT_GFX_RC6				0x138108
+#define GEN6_GT_GFX_RC6p			0x13810C
+	mmio.mmio_list[0] = GEN6_GT_GFX_RC6;
+	mmio.mmio_list[1] = GEN6_GT_GFX_RC6p;
+	mmio.num_mmio = 2;
+
+	properties[ARRAY_SIZE(properties) - 1] = (uint64_t)&mmio;
+
+	/* should be default, but just to be sure... */
+	write_u64_file("/proc/sys/dev/i915/perf_stream_paranoid", 1);
+
+	igt_fork(child, 1) {
+		int prop_size = ARRAY_SIZE(properties);
+		int num_reports = 2;
+		int report_size = get_perf_report_size_nonoa(properties,
+							     prop_size);
+		int total_size = num_reports * report_size;
+		uint8_t *perf_reports = malloc(total_size);
+		uint64_t pre_mmio_residency[2], post_mmio_residency[2];
+
+		igt_assert(perf_reports);
+
+		pre_mmio_residency[0] = read_debugfs_u64_record(drm_fd,
+						"i915_drpc_info",
+						"RC6 residency since boot");
+		pre_mmio_residency[1] = read_debugfs_u64_record(drm_fd,
+						"i915_drpc_info",
+						"RC6+ residency since boot");
+		perf_stream_capture_workload_samples(&param, perf_reports,
+						     num_reports, report_size,
+						     NULL);
+		post_mmio_residency[0] = read_debugfs_u64_record(drm_fd,
+						"i915_drpc_info",
+						"RC6 residency since boot");
+		post_mmio_residency[1] = read_debugfs_u64_record(drm_fd,
+						"i915_drpc_info",
+						"RC6+ residency since boot");
+		verify_ts_mmio(perf_reports, num_reports, report_size,
+			       pre_mmio_residency, post_mmio_residency);
+		free(perf_reports);
+	}
+
+	igt_waitchildren();
+}
+
 igt_main
 {
 	igt_skip_on_simulation();
@@ -1171,6 +1456,12 @@ igt_main
 	igt_subtest("perf-ts")
 		test_perf_ts();
 
+	igt_subtest("perf-mmio") {
+		igt_require(intel_get_device_info(devid)->gen >= 9);
+		test_perf_ts_mmio();
+		test_perf_oa_mmio();
+	}
+
 	igt_fixture {
 		close(drm_fd);
 	}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH 8/8 tests/perf: Add testcase to verify concurrent streams

In reply to Sagar Arun Kamble
---
 tests/intel_perf_dapc.c | 211 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 211 insertions(+)
tests/intel_perf_dapc.c +211 -0
index ac6f3d1..356ec1f 100644
@@ -1423,6 +1423,214 @@ test_perf_ts_mmio(void)
 	igt_waitchildren();
 }
 
+struct ts_ctxid_sample {
+	uint64_t ctx_id;
+	uint64_t ts;
+};
+
+static void
+verify_ctxid_nonoa(uint8_t *perf_reports, int num_reports, size_t report_size,
+		   uint64_t hw_ctx_id, int match_index)
+{
+	struct ts_ctxid_sample *sample;
+
+	for (int i = 0; i < num_reports; i++) {
+		size_t offset = i * report_size;
+
+		sample = (struct ts_ctxid_sample *) (perf_reports + offset);
+
+		igt_debug("read report: ctx_id= %lu, timestamp = %lu\n",
+			  sample->ctx_id, sample->ts);
+
+		if (i < match_index)
+			igt_assert(sample->ctx_id != hw_ctx_id);
+		else
+			igt_assert(sample->ctx_id == hw_ctx_id);
+	}
+}
+
+#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
+#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
+
+/* Logic taken from store_ring in gem_sync */
+static void
+test_concurrent_streams(void)
+{
+	const int gen = intel_gen(intel_get_drm_devid(drm_fd));
+	unsigned int engines[16];
+	int num_children = 1;
+	int timeout = 5;
+	int num_engines = 0;
+	const struct intel_execution_engine *e;
+	uint64_t render_hw_ctx_id;
+	uint64_t blt_hw_ctx_id;
+	uint64_t render_properties[] = {
+		/* CS parameters */
+		DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
+		DRM_I915_PERF_PROP_SAMPLE_CTX_ID, true,
+		DRM_I915_PERF_PROP_SAMPLE_TS, true,
+	};
+	struct drm_i915_perf_open_param render_param = {
+		.flags = I915_PERF_FLAG_FD_CLOEXEC,
+		.num_properties = sizeof(render_properties) / 16,
+		.properties_ptr = to_user_pointer(render_properties),
+	};
+	uint64_t blt_properties[] = {
+		/* CS parameters */
+		DRM_I915_PERF_PROP_ENGINE, I915_EXEC_BLT,
+		DRM_I915_PERF_PROP_SAMPLE_CTX_ID, true,
+		DRM_I915_PERF_PROP_SAMPLE_TS, true,
+	};
+	struct drm_i915_perf_open_param blt_param = {
+		.flags = I915_PERF_FLAG_FD_CLOEXEC,
+		.num_properties = sizeof(blt_properties) / 16,
+		.properties_ptr = to_user_pointer(blt_properties),
+	};
+	int num_reports = 4;
+	int render_prop_size = ARRAY_SIZE(render_properties);
+	int render_report_size = get_perf_report_size_nonoa(render_properties,
+							    render_prop_size);
+	int render_total_size = num_reports * render_report_size;
+	int render_stream_fd;
+	int blt_prop_size = ARRAY_SIZE(blt_properties);
+	int blt_report_size = get_perf_report_size_nonoa(blt_properties,
+							 blt_prop_size);
+	int blt_total_size = num_reports * blt_report_size;
+	int blt_stream_fd;
+	bool valid_data = false;
+
+	for (e = intel_execution_engines; e->name; e++) {
+		if (e->exec_id == 0)
+			continue;
+
+		if (!gem_has_ring(drm_fd, e->exec_id | e->flags))
+			continue;
+
+		if (e->exec_id == I915_EXEC_BSD) {
+			int is_bsd2 = e->flags != 0;
+
+			if (gem_has_bsd2(drm_fd) != is_bsd2)
+				continue;
+		}
+
+		engines[num_engines++] = e->exec_id | e->flags;
+		if (num_engines == ARRAY_SIZE(engines))
+			break;
+	}
+
+	/* should be default, but just to be sure... */
+	write_u64_file("/proc/sys/dev/i915/perf_stream_paranoid", 1);
+
+	num_children *= num_engines;
+
+	intel_detect_and_clear_missed_interrupts(drm_fd);
+	igt_fork(child, num_children) {
+		uint8_t *render_perf_reports = NULL;
+		uint8_t *blt_perf_reports = NULL;
+		const uint32_t bbe = MI_BATCH_BUFFER_END;
+		struct drm_i915_gem_exec_object2 object[1];
+		struct drm_i915_gem_execbuffer2 execbuf;
+		drm_intel_bufmgr *bufmgr;
+		drm_intel_context *context0;
+		uint32_t ctx_id = 0xffffffff; /* invalid id */
+		int ret;
+
+		memset(&execbuf, 0, sizeof(execbuf));
+		execbuf.buffers_ptr = to_user_pointer(object);
+		execbuf.flags = engines[child % num_engines];
+		execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC;
+		execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT;
+		if (gen < 6)
+			execbuf.flags |= I915_EXEC_SECURE;
+
+		memset(object, 0, sizeof(object));
+		object[0].handle = gem_create(drm_fd, 4096);
+		gem_write(drm_fd, object[0].handle, 0, &bbe, sizeof(bbe));
+
+		bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
+		drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+
+		context0 = drm_intel_gem_context_create(bufmgr);
+		igt_assert(context0);
+
+		ret = drm_intel_gem_context_get_id(context0, &ctx_id);
+		igt_assert_eq(ret, 0);
+		igt_assert_neq(ctx_id, 0xffffffff);
+
+		if ((execbuf.flags & I915_EXEC_RING_MASK) == I915_EXEC_RENDER) {
+			render_hw_ctx_id = context_get_hw_ctx_id(drm_fd,
+								 ctx_id);
+			igt_debug("render user_handle = %u hw_id = %lu\n",
+				  ctx_id, render_hw_ctx_id);
+
+			render_perf_reports = malloc(render_total_size);
+			igt_assert(render_perf_reports);
+
+			igt_debug("opening render i915-perf stream\n");
+			render_stream_fd = __perf_open(drm_fd, &render_param);
+		}
+
+		if ((execbuf.flags & I915_EXEC_RING_MASK) == I915_EXEC_BLT) {
+			blt_hw_ctx_id = context_get_hw_ctx_id(drm_fd, ctx_id);
+			igt_debug("blt user_handle = %u hw_id = %lu\n",
+				  ctx_id, blt_hw_ctx_id);
+
+			blt_perf_reports = malloc(blt_total_size);
+			igt_assert(blt_perf_reports);
+
+			igt_debug("opening blt i915-perf stream\n");
+			blt_stream_fd = __perf_open(drm_fd, &blt_param);
+		}
+
+		execbuf.buffer_count = 1;
+		/* Do a submission with default context */
+		gem_execbuf(drm_fd, &execbuf);
+
+		i915_execbuffer2_set_context_id(execbuf, ctx_id);
+		/* Now submit with user created context */
+		gem_execbuf(drm_fd, &execbuf);
+
+		gem_close(drm_fd, object[0].handle);
+
+		drm_intel_gem_context_destroy(context0);
+		drm_intel_bufmgr_destroy(bufmgr);
+
+		if ((execbuf.flags & I915_EXEC_RING_MASK) == I915_EXEC_RENDER) {
+			valid_data = read_perf_reports(render_stream_fd,
+						       render_perf_reports,
+						       num_reports,
+						       render_report_size,
+						       false);
+			igt_assert(valid_data);
+			close(render_stream_fd);
+
+			igt_debug("Verify render ctx id: %lu\n",
+				  render_hw_ctx_id);
+			verify_ctxid_nonoa(render_perf_reports, num_reports,
+					   render_report_size, render_hw_ctx_id,
+					   2);
+			free(render_perf_reports);
+		}
+
+		if ((execbuf.flags & I915_EXEC_RING_MASK) == I915_EXEC_BLT) {
+			valid_data = read_perf_reports(blt_stream_fd,
+						       blt_perf_reports,
+						       num_reports,
+						       blt_report_size,
+						       false);
+			igt_assert(valid_data);
+			close(blt_stream_fd);
+
+			igt_debug("Verify blt ctx id: %lu\n", blt_hw_ctx_id);
+			verify_ctxid_nonoa(blt_perf_reports, num_reports,
+					   blt_report_size, blt_hw_ctx_id, 2);
+			free(blt_perf_reports);
+		}
+	}
+	igt_waitchildren_timeout(timeout+10, NULL);
+	igt_assert_eq(intel_detect_and_clear_missed_interrupts(drm_fd), 0);
+}
+
 igt_main
 {
 	igt_skip_on_simulation();
@@ -1462,6 +1670,9 @@ igt_main
 		test_perf_oa_mmio();
 	}
 
+	igt_subtest("concurrent-streams")
+		test_concurrent_streams();
+
 	igt_fixture {
 		close(drm_fd);
 	}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

✗ Fi.CI.BAT: failure for IGT Testcases for i915 DAPC feature

In reply to Sagar Arun Kamble
== Series Details ==

== Series Details ==

Series: IGT Testcases for i915 DAPC feature
URL : https://patchwork.freedesktop.org/series/29940/
State : failure

== Summary ==

IGT patchset build failed on latest successful build 4a1c8daff2005e2cbfe980d63bc0a0fb09cb017d igt/gem_ringfill: Prime execbuf before measuring ring size

make all-recursive
Making all in lib
make all-recursive
Making all in .
Making all in tests
make[4]: Nothing to be done for 'all'.
Making all in man
make[2]: Nothing to be done for 'all'.
Making all in tools
Making all in null_state_gen
make[3]: Nothing to be done for 'all'.
Making all in registers
make[3]: Nothing to be done for 'all'.
make[3]: Nothing to be done for 'all-am'.
Making all in scripts
make[2]: Nothing to be done for 'all'.
Making all in benchmarks
make[2]: Nothing to be done for 'all'.
Making all in tests
Making all in intel-ci
make[3]: Nothing to be done for 'all'.

  CCLD     gem_bad_batch
  CCLD     gem_hang
  CCLD     gem_bad_blit
  CCLD     gem_bad_address
  CCLD     gem_non_secure_batch
  CCLD     gem_stress
  CCLD     core_auth
  CCLD     core_get_client_auth
  CCLD     core_getclient
  CCLD     core_getstats
  CCLD     core_getversion
  CCLD     core_prop_blob
  CCLD     core_setmaster_vs_auth
  CCLD     debugfs_test
  CCLD     drm_import_export
  CCLD     drm_mm
  CCLD     drm_read
  CCLD     drm_vma_limiter
  CCLD     drm_vma_limiter_cached
  CCLD     drm_vma_limiter_cpu
  CCLD     drm_vma_limiter_gtt
  CCLD     drv_getparams_basic
  CCLD     drv_hangman
  CCLD     drv_missed_irq
  CCLD     drv_module_reload
  CCLD     drv_selftest
  CCLD     drv_suspend
  CCLD     gem_bad_length
  CCLD     gem_bad_reloc
  CCLD     gem_basic
  CCLD     gem_busy
  CCLD     gem_caching
  CCLD     gem_close
  CCLD     gem_close_race
  CCLD     gem_concurrent_blit
  CCLD     gem_cpu_reloc
  CCLD     gem_create
  CCLD     gem_cs_prefetch
  CCLD     gem_cs_tlb
  CCLD     gem_ctx_bad_destroy
  CCLD     gem_ctx_bad_exec
  CCLD     gem_ctx_basic
  CCLD     gem_ctx_create
  CCLD     gem_ctx_exec
  CCLD     gem_ctx_param
  CCLD     gem_ctx_switch
  CCLD     gem_ctx_thrash
  CCLD     gem_double_irq_loop
  CCLD     gem_eio
  CCLD     gem_evict_alignment
  CCLD     gem_evict_everything
  CCLD     gem_exec_alignment
  CCLD     gem_exec_async
  CCLD     gem_exec_await
  CCLD     gem_exec_bad_domains
  CCLD     gem_exec_basic
  CCLD     gem_exec_big
  CCLD     gem_exec_blt
  CCLD     gem_exec_capture
  CCLD     gem_exec_create
  CCLD     gem_exec_faulting_reloc
  CCLD     gem_exec_fence
  CCLD     gem_exec_flush
  CCLD     gem_exec_gttfill
  CCLD     gem_exec_latency
  CCLD     gem_exec_lut_handle
  CCLD     gem_exec_nop
  CCLD     gem_exec_parallel
  CCLD     gem_exec_params
  CCLD     gem_exec_parse
  CCLD     gem_exec_reloc
  CCLD     gem_exec_reuse
  CCLD     gem_exec_schedule
  CCLD     gem_exec_store
  CCLD     gem_exec_suspend
  CCLD     gem_exec_whisper
  CCLD     gem_fd_exhaustion
  CCLD     gem_fence_thrash
  CCLD     gem_fence_upload
  CCLD     gem_fenced_exec_thrash
  CCLD     gem_flink_basic
  CCLD     gem_flink_race
  CCLD     gem_gpgpu_fill
  CCLD     gem_gtt_cpu_tlb
  CCLD     gem_gtt_hog
  CCLD     gem_gtt_speed
  CCLD     gem_hangcheck_forcewake
  CCLD     gem_largeobject
  CCLD     gem_linear_blits
  CCLD     gem_lut_handle
  CCLD     gem_madvise
  CCLD     gem_media_fill
  CCLD     gem_mmap
  CCLD     gem_mmap_gtt
  CCLD     gem_mmap_offset_exhaustion
  CCLD     gem_mmap_wc
  CCLD     gem_mocs_settings
  CCLD     gem_partial_pwrite_pread
  CCLD     gem_persistent_relocs
  CCLD     gem_pin
  CCLD     gem_pipe_control_store_loop
  CCLD     gem_ppgtt
  CCLD     gem_pread
  CCLD     gem_pread_after_blit
  CCLD     gem_pwrite
  CCLD     gem_pwrite_pread
  CCLD     gem_pwrite_snooped
  CCLD     gem_read_read_speed
  CCLD     gem_readwrite
  CCLD     gem_reg_read
  CCLD     gem_reloc_overflow
  CCLD     gem_reloc_vs_gpu
  CCLD     gem_render_copy
  CCLD     gem_render_copy_redux
  CCLD     gem_render_linear_blits
  CCLD     gem_render_tiled_blits
  CCLD     gem_request_retire
  CCLD     gem_reset_stats
  CCLD     gem_ring_sync_copy
  CCLD     gem_ring_sync_loop
  CCLD     gem_ringfill
  CCLD     gem_seqno_wrap
  CCLD     gem_set_tiling_vs_blt
  CCLD     gem_set_tiling_vs_gtt
  CCLD     gem_set_tiling_vs_pwrite
  CCLD     gem_shrink
  CCLD     gem_softpin
  CCLD     gem_spin_batch
  CCLD     gem_stolen
  CCLD     gem_storedw_batches_loop
  CCLD     gem_storedw_loop
  CCLD     gem_streaming_writes
  CCLD     gem_sync
  CCLD     gem_threaded_access_tiled
  CCLD     gem_tiled_blits
  CCLD     gem_tiled_fence_blits
  CCLD     gem_tiled_partial_pwrite_pread
  CCLD     gem_tiled_pread_basic
  CCLD     gem_tiled_pread_pwrite
  CCLD     gem_tiled_swapping
  CCLD     gem_tiled_wb
  CCLD     gem_tiled_wc
  CCLD     gem_tiling_max_stride
  CCLD     gem_unfence_active_buffers
  CCLD     gem_unref_active_buffers
  CCLD     gem_userptr_blits
  CCLD     gem_wait
  CCLD     gem_workarounds
  CCLD     gem_write_read_ring_switch
  CCLD     gen3_mixed_blits
  CCLD     gen3_render_linear_blits
  CCLD     gen3_render_mixed_blits
  CCLD     gen3_render_tiledx_blits
  CCLD     gen3_render_tiledy_blits
  CCLD     gen7_forcewake_mt
  CCLD     gvt_basic
  CCLD     intel_perf
  CC       intel_perf_dapc.o
intel_perf_dapc.c: In function ‘test_cs_oa_stream_create’:
intel_perf_dapc.c:394:4: error: ‘DRM_I915_PERF_PROP_SAMPLE_CTX_ID’ undeclared (first use in this function)
    DRM_I915_PERF_PROP_SAMPLE_CTX_ID, true,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:394:4: note: each undeclared identifier is reported only once for each function it appears in
intel_perf_dapc.c:395:4: error: ‘DRM_I915_PERF_PROP_ENGINE’ undeclared (first use in this function)
    DRM_I915_PERF_PROP_ENGINE, I915_EXEC_BSD,
    ^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c: In function ‘get_oa_report_offset’:
intel_perf_dapc.c:455:8: error: ‘DRM_I915_PERF_PROP_SAMPLE_OA_SOURCE’ undeclared (first use in this function)
   case DRM_I915_PERF_PROP_SAMPLE_OA_SOURCE:
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:461:8: error: ‘DRM_I915_PERF_PROP_SAMPLE_CTX_ID’ undeclared (first use in this function)
   case DRM_I915_PERF_PROP_SAMPLE_CTX_ID:
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:467:8: error: ‘DRM_I915_PERF_PROP_SAMPLE_PID’ undeclared (first use in this function)
   case DRM_I915_PERF_PROP_SAMPLE_PID:
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:473:8: error: ‘DRM_I915_PERF_PROP_SAMPLE_TAG’ undeclared (first use in this function)
   case DRM_I915_PERF_PROP_SAMPLE_TAG:
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:479:8: error: ‘DRM_I915_PERF_PROP_SAMPLE_TS’ undeclared (first use in this function)
   case DRM_I915_PERF_PROP_SAMPLE_TS:
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:490:8: error: ‘DRM_I915_PERF_PROP_ENGINE’ undeclared (first use in this function)
   case DRM_I915_PERF_PROP_ENGINE:
        ^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:495:24: error: ‘DRM_I915_PERF_PROP_SAMPLE_MMIO’ undeclared (first use in this function)
   if (properties[i] == DRM_I915_PERF_PROP_SAMPLE_MMIO) {
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:495:21: warning: comparison between pointer and integer
   if (properties[i] == DRM_I915_PERF_PROP_SAMPLE_MMIO) {
                     ^~
In file included from ./../lib/intel_batchbuffer.h:8:0,
                 from ./../lib/drmtest.h:39,
                 from ./../lib/igt.h:27,
                 from intel_perf_dapc.c:26:
intel_perf_dapc.c: In function ‘verify_source’:
intel_perf_dapc.c:744:8: error: ‘I915_PERF_SAMPLE_OA_SOURCE_OABUFFER’ undeclared (first use in this function)
        I915_PERF_SAMPLE_OA_SOURCE_OABUFFER) ||
        ^
./../lib/igt_core.h:337:13: note: in definition of macro ‘igt_assert’
  do { if (!(expr)) \
             ^~~~
intel_perf_dapc.c:743:30: warning: comparison between pointer and integer
   igt_assert((sample->source ==
                              ^
./../lib/igt_core.h:337:13: note: in definition of macro ‘igt_assert’
  do { if (!(expr)) \
             ^~~~
intel_perf_dapc.c:746:8: error: ‘I915_PERF_SAMPLE_OA_SOURCE_CS’ undeclared (first use in this function)
        I915_PERF_SAMPLE_OA_SOURCE_CS));
        ^
./../lib/igt_core.h:337:13: note: in definition of macro ‘igt_assert’
  do { if (!(expr)) \
             ^~~~
intel_perf_dapc.c:745:23: warning: comparison between pointer and integer
       (sample->source ==
                       ^
./../lib/igt_core.h:337:13: note: in definition of macro ‘igt_assert’
  do { if (!(expr)) \
             ^~~~
intel_perf_dapc.c:748:22: warning: comparison between pointer and integer
   if (sample->source == I915_PERF_SAMPLE_OA_SOURCE_CS)
                      ^~

intel_perf_dapc.c: In function ‘test_oa_source’:
intel_perf_dapc.c:769:3: error: ‘DRM_I915_PERF_PROP_ENGINE’ undeclared (first use in this function)
DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:769:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:769:3: note: (near initialization for ‘properties[8]’)
intel_perf_dapc.c:770:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_OA_SOURCE’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_OA_SOURCE, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:770:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:770:3: note: (near initialization for ‘properties[10]’)
intel_perf_dapc.c:771:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_CTX_ID’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_CTX_ID, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:771:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:771:3: note: (near initialization for ‘properties[12]’)
intel_perf_dapc.c: In function ‘test_perf_ctxid’:
intel_perf_dapc.c:842:3: error: ‘DRM_I915_PERF_PROP_ENGINE’ undeclared (first use in this function)
DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:842:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:842:3: note: (near initialization for ‘properties[8]’)
intel_perf_dapc.c:843:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_CTX_ID’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_CTX_ID, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:843:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:843:3: note: (near initialization for ‘properties[10]’)
intel_perf_dapc.c: In function ‘test_perf_pid’:
intel_perf_dapc.c:915:3: error: ‘DRM_I915_PERF_PROP_ENGINE’ undeclared (first use in this function)
DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:915:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:915:3: note: (near initialization for ‘properties[8]’)
intel_perf_dapc.c:916:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_PID’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_PID, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:916:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:916:3: note: (near initialization for ‘properties[10]’)
intel_perf_dapc.c: In function ‘test_perf_tag’:
intel_perf_dapc.c:982:3: error: ‘DRM_I915_PERF_PROP_ENGINE’ undeclared (first use in this function)
DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:982:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:982:3: note: (near initialization for ‘properties[0]’)
intel_perf_dapc.c:983:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_TAG’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_TAG, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:983:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:983:3: note: (near initialization for ‘properties[2]’)
intel_perf_dapc.c:984:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_TS’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_TS, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:984:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:984:3: note: (near initialization for ‘properties[4]’)
intel_perf_dapc.c:1046:3: error: implicit declaration of function ‘i915_execbuffer2_set_tag’ [-Werror=implicit-function-declaration]
i915_execbuffer2_set_tag(execbuf, (uint64_t)test_tag);
^~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1046:3: warning: nested extern declaration of ‘i915_execbuffer2_set_tag’ [-Wnested-externs] intel_perf_dapc.c: In function ‘test_perf_ts’:
intel_perf_dapc.c:1109:3: error: ‘DRM_I915_PERF_PROP_ENGINE’ undeclared (first use in this function)
DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1109:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:1109:3: note: (near initialization for ‘properties[8]’)
intel_perf_dapc.c:1110:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_TS’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_TS, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1110:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:1110:3: note: (near initialization for ‘properties[10]’)
intel_perf_dapc.c: In function ‘test_perf_oa_mmio’:
intel_perf_dapc.c:1266:3: error: ‘DRM_I915_PERF_PROP_ENGINE’ undeclared (first use in this function)
DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1266:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:1266:3: note: (near initialization for ‘properties[8]’)
intel_perf_dapc.c:1267:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_MMIO’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_MMIO, 0,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1267:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:1267:3: note: (near initialization for ‘properties[10]’)
intel_perf_dapc.c:1274:33: error: storage size of ‘mmio’ isn’t known

  struct drm_i915_perf_mmio_list mmio;
                                 ^~~~
intel_perf_dapc.c:1276:19: warning: passing argument 3 of ‘memset’ makes integer from pointer without a cast [-Wint-conversion]
  memset(&mmio, 0, sizeof(mmio));
                   ^~~~~~
In file included from /usr/include/features.h:364:0,
                 from /usr/include/fcntl.h:25,
                 from intel_perf_dapc.c:24:

/usr/include/x86_64-linux-gnu/bits/string3.h:78:1: note: expected ‘size_t {aka long unsigned int}’ but argument is of type ‘uint64_t * {aka long unsigned int *}’
__NTH (memset (void *__dest, int __ch, size_t __len))
^
intel_perf_dapc.c:1280:6: error: request for member ‘mmio_list’ in something not a structure or union

  mmio.mmio_list[0] = GEN6_GT_GFX_RC6;
      ^
intel_perf_dapc.c:1281:6: error: request for member ‘mmio_list’ in something not a structure or union
  mmio.mmio_list[1] = GEN6_GT_GFX_RC6p;
      ^
intel_perf_dapc.c:1282:6: error: request for member ‘num_mmio’ in something not a structure or union
  mmio.num_mmio = 2;
      ^

intel_perf_dapc.c:1282:2: warning: statement with no effect [-Wunused-value]
mmio.num_mmio = 2;
^~~~
intel_perf_dapc.c:1274:33: warning: unused variable ‘mmio’ [-Wunused-variable]

  struct drm_i915_perf_mmio_list mmio;
                                 ^~~~

intel_perf_dapc.c: In function ‘test_perf_ts_mmio’:
intel_perf_dapc.c:1368:3: error: ‘DRM_I915_PERF_PROP_ENGINE’ undeclared (first use in this function)
DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1368:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:1368:3: note: (near initialization for ‘properties[0]’) intel_perf_dapc.c:1369:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_TS’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_TS, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1369:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:1369:3: note: (near initialization for ‘properties[2]’) intel_perf_dapc.c:1370:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_MMIO’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_MMIO, 0,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1370:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:1370:3: note: (near initialization for ‘properties[4]’) intel_perf_dapc.c:1377:33: error: storage size of ‘mmio’ isn’t known

  struct drm_i915_perf_mmio_list mmio;
                                 ^~~~
intel_perf_dapc.c:1379:19: warning: passing argument 3 of ‘memset’ makes integer from pointer without a cast [-Wint-conversion]
  memset(&mmio, 0, sizeof(mmio));
                   ^~~~~~
In file included from /usr/include/features.h:364:0,
                 from /usr/include/fcntl.h:25,
                 from intel_perf_dapc.c:24:

/usr/include/x86_64-linux-gnu/bits/string3.h:78:1: note: expected ‘size_t {aka long unsigned int}’ but argument is of type ‘uint64_t * {aka long unsigned int *}’
__NTH (memset (void *__dest, int __ch, size_t __len))
^
intel_perf_dapc.c:1383:6: error: request for member ‘mmio_list’ in something not a structure or union

  mmio.mmio_list[0] = GEN6_GT_GFX_RC6;
      ^
intel_perf_dapc.c:1384:6: error: request for member ‘mmio_list’ in something not a structure or union
  mmio.mmio_list[1] = GEN6_GT_GFX_RC6p;
      ^
intel_perf_dapc.c:1385:6: error: request for member ‘num_mmio’ in something not a structure or union
  mmio.num_mmio = 2;
      ^

intel_perf_dapc.c:1385:2: warning: statement with no effect [-Wunused-value]
mmio.num_mmio = 2;
^~~~
intel_perf_dapc.c:1377:33: warning: unused variable ‘mmio’ [-Wunused-variable]

  struct drm_i915_perf_mmio_list mmio;
                                 ^~~~

intel_perf_dapc.c: In function ‘test_concurrent_streams’:
intel_perf_dapc.c:1469:3: error: ‘DRM_I915_PERF_PROP_ENGINE’ undeclared (first use in this function)
DRM_I915_PERF_PROP_ENGINE, I915_EXEC_RENDER,
^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1469:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:1469:3: note: (near initialization for ‘render_properties[0]’) intel_perf_dapc.c:1470:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_CTX_ID’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_CTX_ID, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1470:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:1470:3: note: (near initialization for ‘render_properties[2]’) intel_perf_dapc.c:1471:3: error: ‘DRM_I915_PERF_PROP_SAMPLE_TS’ undeclared (first use in this function)
DRM_I915_PERF_PROP_SAMPLE_TS, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1471:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion] intel_perf_dapc.c:1471:3: note: (near initialization for ‘render_properties[4]’) intel_perf_dapc.c:1480:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
DRM_I915_PERF_PROP_ENGINE, I915_EXEC_BLT,
^~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1480:3: note: (near initialization for ‘blt_properties[0]’) intel_perf_dapc.c:1481:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
DRM_I915_PERF_PROP_SAMPLE_CTX_ID, true,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intel_perf_dapc.c:1481:3: note: (near initialization for ‘blt_properties[2]’) intel_perf_dapc.c:1482:3: warning: initialization makes intege

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx