Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [CI i-g-t] tests/perf_pmu: Test RC6 during runtime suspend
@ 2018-02-05 20:06 Tvrtko Ursulin
  2018-02-05 20:41 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2018-02-05 23:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Tvrtko Ursulin @ 2018-02-05 20:06 UTC (permalink / raw)
  To: igt-dev; +Cc: Tvrtko Ursulin

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

...

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/perf_pmu.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 87 insertions(+), 5 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 60cff4eee152..26810bb032f6 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -151,6 +151,7 @@ static unsigned int e2ring(int gem_fd, const struct intel_execution_engine2 *e)
 #define TEST_BUSY (1)
 #define FLAG_SYNC (2)
 #define TEST_TRAILING_IDLE (4)
+#define TEST_RUNTIME_PM (8)
 
 static void end_spin(int fd, igt_spin_t *spin, unsigned int flags)
 {
@@ -1223,7 +1224,84 @@ test_frequency(int gem_fd)
 	assert_within_epsilon(max[0], max_freq, tolerance);
 }
 
-static bool wait_for_rc6(int fd)
+static void __terminate(char *buf, int sz)
+{
+	igt_assert(sz > 0);
+
+	if (buf[sz - 1] == '\n')
+		buf[sz - 1] = 0;
+	else
+		buf[sz] = 0;
+}
+
+static bool wait_autosuspend(int fd)
+{
+	bool res = false;
+	char buf[128], ref[128];
+	uint32_t delay;
+	int sysfs, ret;
+
+	sysfs = igt_sysfs_open(-1, NULL);
+	igt_assert_fd(sysfs);
+
+	ret = igt_sysfs_read(sysfs, "power/runtime_status", buf, sizeof(buf));
+	igt_assert(ret > 0);
+	__terminate(buf, ret);
+	if (!strcasecmp(buf, "unsupported")) {
+		igt_info("power/runtime_status='%s'\n", buf);
+		res = false;
+		goto out;
+	}
+
+	ret = igt_sysfs_read(sysfs, "power/control", buf, sizeof(buf));
+	igt_assert(ret > 0);
+	__terminate(buf, ret);
+	if (strcasecmp(buf, "auto")) {
+		igt_info("power/control='%s'\n", buf);
+		res = false;
+		goto out;
+	}
+
+	delay = igt_sysfs_get_u32(sysfs, "power/autosuspend_delay_ms");
+	if (!delay) {
+		ret = igt_sysfs_read(sysfs, "power/autosuspend_delay_ms",
+				     buf, sizeof(buf));
+		igt_assert(ret > 0);
+		__terminate(buf, ret);
+		igt_info("power/autosuspend_delay_ms='%s'\n", buf);
+		res = false;
+		goto out;
+	}
+
+	ret = igt_sysfs_read(sysfs, "power/runtime_suspended_time",
+			     ref, sizeof(ref));
+	igt_assert(ret > 0);
+	__terminate(ref, ret);
+
+	igt_until_timeout(delay + 2) {
+		ret = igt_sysfs_read(sysfs, "power/runtime_suspended_time",
+				     buf, sizeof(buf));
+		igt_assert(ret > 0);
+		__terminate(buf, ret);
+
+		if (strncmp(ref, buf, sizeof(buf))) {
+			res = true;
+			goto out;
+		}
+
+		sleep(1);
+	}
+
+	igt_info("power/autosuspend_delay_ms='%u'\n", delay);
+	igt_info("power/runtime_suspended_time='%s'/'%s'\n", ref, buf);
+
+out:
+	close(sysfs);
+
+	return res;
+}
+
+static bool wait_for_rc6(int fd, unsigned int flags)
 {
 	struct timespec tv = {};
 	uint64_t start, now;
@@ -1238,14 +1316,15 @@ static bool wait_for_rc6(int fd)
 		usleep(5000);
 		now = pmu_read_single(fd);
 		if (now - start > 1e6)
-			return true;
+			return flags & TEST_RUNTIME_PM ?
+			       wait_autosuspend(fd) : true;
 	} while (!igt_seconds_elapsed(&tv));
 
 	return false;
 }
 
 static void
-test_rc6(int gem_fd)
+test_rc6(int gem_fd, unsigned int flags)
 {
 	int64_t duration_ns = 2e9;
 	uint64_t idle, busy, prev;
@@ -1255,7 +1334,7 @@ test_rc6(int gem_fd)
 	fd = open_pmu(I915_PMU_RC6_RESIDENCY);
 
 	gem_quiescent_gpu(gem_fd);
-	igt_require(wait_for_rc6(fd));
+	igt_require(wait_for_rc6(fd, flags));
 
 	/* Go idle and check full RC6. */
 	prev = pmu_read_single(fd);
@@ -1522,7 +1601,10 @@ igt_main
 	 * Test RC6 residency reporting.
 	 */
 	igt_subtest("rc6")
-		test_rc6(fd);
+		test_rc6(fd, 0);
+
+	igt_subtest("rc6-runtime-pm")
+		test_rc6(fd, TEST_RUNTIME_PM);
 
 	/**
 	 * Check render nodes are counted.
-- 
2.14.1

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

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/perf_pmu: Test RC6 during runtime suspend
  2018-02-05 20:06 [igt-dev] [CI i-g-t] tests/perf_pmu: Test RC6 during runtime suspend Tvrtko Ursulin
@ 2018-02-05 20:41 ` Patchwork
  2018-02-05 23:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2018-02-05 20:41 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: igt-dev

== Series Details ==

Series: tests/perf_pmu: Test RC6 during runtime suspend
URL   : https://patchwork.freedesktop.org/series/37683/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
3fd9b578b3138b04178b4ce8ee4a60e74a16ec91 tests/perf_pmu: Use short batches from hotplug test

with latest DRM-Tip kernel build CI_DRM_3726
89ac14dcb4d0 drm-tip: 2018y-02m-05d-19h-08m-24s UTC integration manifest

Testlist changes:
+igt@perf_pmu@rc6-runtime-pm

Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                pass       -> FAIL       (fi-gdg-551) fdo#102575

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:419s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:424s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:377s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:493s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:286s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:484s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:488s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:471s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:461s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:572s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:582s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:417s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:286s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:512s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:391s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:398s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:413s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:452s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:463s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:495s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:456s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:498s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:594s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:428s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:506s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:531s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:488s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:483s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:415s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:432s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:514s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:399s
Blacklisted hosts:
fi-glk-dsi       total:288  pass:257  dwarn:0   dfail:0   fail:1   skip:30  time:487s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_867/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for tests/perf_pmu: Test RC6 during runtime suspend
  2018-02-05 20:06 [igt-dev] [CI i-g-t] tests/perf_pmu: Test RC6 during runtime suspend Tvrtko Ursulin
  2018-02-05 20:41 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-02-05 23:51 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2018-02-05 23:51 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: igt-dev

== Series Details ==

Series: tests/perf_pmu: Test RC6 during runtime suspend
URL   : https://patchwork.freedesktop.org/series/37683/
State : success

== Summary ==

Test kms_cursor_legacy:
        Subgroup flip-vs-cursor-legacy:
                fail       -> PASS       (shard-apl) fdo#102670
        Subgroup 2x-long-flip-vs-cursor-legacy:
                pass       -> FAIL       (shard-hsw) fdo#104873
Test kms_flip:
        Subgroup busy-flip:
                pass       -> FAIL       (shard-apl) fdo#103257
        Subgroup wf_vblank-ts-check-interruptible:
                fail       -> PASS       (shard-hsw) fdo#100368
Test perf:
        Subgroup buffer-fill:
                pass       -> FAIL       (shard-apl) fdo#103755
Test drv_suspend:
        Subgroup fence-restore-tiled2untiled:
                skip       -> PASS       (shard-snb) fdo#102365
Test gem_eio:
        Subgroup in-flight-external:
                fail       -> PASS       (shard-hsw) fdo#104676 +1
Test gem_exec_schedule:
        Subgroup preempt-self-vebox:
                fail       -> PASS       (shard-apl) fdo#102848

fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#104873 https://bugs.freedesktop.org/show_bug.cgi?id=104873
fdo#103257 https://bugs.freedesktop.org/show_bug.cgi?id=103257
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103755 https://bugs.freedesktop.org/show_bug.cgi?id=103755
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#102848 https://bugs.freedesktop.org/show_bug.cgi?id=102848

shard-apl        total:3321 pass:1718 dwarn:1   dfail:0   fail:22  skip:1577 time:11977s
shard-hsw        total:3443 pass:1757 dwarn:1   dfail:0   fail:12  skip:1672 time:11487s
shard-snb        total:3443 pass:1351 dwarn:1   dfail:0   fail:10  skip:2081 time:6640s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_867/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-02-05 23:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-05 20:06 [igt-dev] [CI i-g-t] tests/perf_pmu: Test RC6 during runtime suspend Tvrtko Ursulin
2018-02-05 20:41 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-02-05 23:51 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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