public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] lib/i915/perf: fix loading configurations
@ 2020-02-24  9:24 Lionel Landwerlin
  2020-02-24  9:24 ` [igt-dev] [PATCH i-g-t 2/2] tests/perf: debug trace when configuration loading fails Lionel Landwerlin
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Lionel Landwerlin @ 2020-02-24  9:24 UTC (permalink / raw)
  To: igt-dev

The configuration ID created is returned not passed by argument.

This would lead the verify first test in the perf tests to fail.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3fd64d9fb8 ("lib/i915-perf: Add support for loading perf configurations")
---
 lib/i915/perf.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/i915/perf.c b/lib/i915/perf.c
index 35b9aff9..1adf1393 100644
--- a/lib/i915/perf.c
+++ b/lib/i915/perf.c
@@ -427,7 +427,7 @@ static void
 load_metric_set_config(struct intel_perf_metric_set *metric_set, int drm_fd)
 {
 	struct drm_i915_perf_oa_config config;
-	uint64_t config_id = 0;
+	int ret;
 
 	memset(&config, 0, sizeof(config));
 
@@ -442,10 +442,11 @@ load_metric_set_config(struct intel_perf_metric_set *metric_set, int drm_fd)
 	config.n_flex_regs = metric_set->n_flex_regs;
 	config.flex_regs_ptr = (uintptr_t) metric_set->flex_regs;
 
-	while (ioctl(drm_fd, DRM_IOCTL_I915_PERF_ADD_CONFIG, &config) < 0 &&
+	while ((ret = ioctl(drm_fd, DRM_IOCTL_I915_PERF_ADD_CONFIG, &config)) < 0 &&
 	       (errno == EAGAIN || errno == EINTR));
 
-	metric_set->perf_oa_metrics_set = config_id;
+	if (ret >= 0)
+		metric_set->perf_oa_metrics_set = ret;
 }
 
 void
-- 
2.25.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-25 12:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-24  9:24 [igt-dev] [PATCH i-g-t 1/2] lib/i915/perf: fix loading configurations Lionel Landwerlin
2020-02-24  9:24 ` [igt-dev] [PATCH i-g-t 2/2] tests/perf: debug trace when configuration loading fails Lionel Landwerlin
2020-02-24 12:16   ` Chris Wilson
2020-02-24 10:11 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/i915/perf: fix loading configurations Patchwork
2020-02-24 12:15 ` [igt-dev] [PATCH i-g-t 1/2] " Chris Wilson
2020-02-24 14:03   ` Lionel Landwerlin
2020-02-24 14:04     ` Chris Wilson
2020-02-25 12:19 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox