Skip to contentSkip to conversation

tests/kms_fbcon_fbt: Report fbc_status on error

PATCH Superseded Gabriel Krisman Bertazi 3 participants 6 messages Oct 19, 2017 – Oct 20, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/kms_fbcon_fbt: Report fbc_status on error

knowing the assertion triggered on wait_until_enabled() is not that useful without knowing what exactly caused the failure. It might be an user error, like too little stolen memory by the bios, or an actual issue in the kernel. So, let's make life easier, particularly for the CI, by printing the status before failing out.

Case in point:

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101718

---
 tests/kms_fbcon_fbt.c | 35 ++++++++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 5 deletions(-)
tests/kms_fbcon_fbt.c +30 -5
index d0090912694e..4027258ef1ba 100644
@@ -95,6 +95,14 @@ static bool connector_can_fbc(drmModeConnectorPtr connector)
 	return true;
 }
 
+static char *fbc_get_status(int fd)
+{
+	static char buf[128];
+
+	igt_debugfs_read(fd, "i915_fbc_status", buf);
+	return buf;
+}
+
 static bool fbc_is_enabled(int fd)
 {
 	char buf[128];
@@ -160,6 +168,14 @@ static bool connector_can_psr(drmModeConnectorPtr connector)
 	return (connector->connector_type == DRM_MODE_CONNECTOR_eDP);
 }
 
+static char *psr_get_status(int fd)
+{
+	static char buf[256];
+
+	igt_debugfs_read(fd, "i915_edp_psr_status", buf);
+	return buf;
+}
+
 static bool psr_is_enabled(int fd)
 {
 	char buf[256];
@@ -177,16 +193,19 @@ struct feature {
 	bool (*supported_on_chipset)(int fd);
 	bool (*wait_until_enabled)(int fd);
 	bool (*connector_possible_fn)(drmModeConnectorPtr connector);
+	char *(*get_status)(int fd);
 	const char *param_name;
 } fbc = {
 	.supported_on_chipset = fbc_supported_on_chipset,
 	.wait_until_enabled = fbc_wait_until_enabled,
 	.connector_possible_fn = connector_can_fbc,
+	.get_status = fbc_get_status,
 	.param_name = "enable_fbc",
 }, psr = {
 	.supported_on_chipset = psr_supported_on_chipset,
 	.wait_until_enabled = psr_wait_until_enabled,
 	.connector_possible_fn = connector_can_psr,
+	.get_status = psr_get_status,
 	.param_name = "enable_psr",
 };
 
@@ -196,6 +215,12 @@ static void disable_features(void)
 	igt_set_module_param_int(psr.param_name, 0);
 }
 
+#define feature_enabled_or_die(drm_info, feature) \
+	igt_assert_f(feature->wait_until_enabled(drm_info.fd), "%s\n", feature->get_status(drm_info.fd));
+
+#define feature_disabled_or_die(drm_info, feature) \
+	igt_assert_f(!feature->wait_until_enabled(drm_info.fd), "%s\n", feature->get_status(drm_info.fd));
+
 static void subtest(struct feature *feature, bool suspend)
 {
 	struct drm_info drm;
@@ -210,17 +235,17 @@ static void subtest(struct feature *feature, bool suspend)
 
 	kmstest_unset_all_crtcs(drm.fd, drm.res);
 	wait_user("Modes unset.");
-	igt_assert(!feature->wait_until_enabled(drm.fd));
+	feature_disabled_or_die(drm, feature);
 
 	set_mode_for_one_screen(&drm, &fb, feature->connector_possible_fn);
 	wait_user("Screen set.");
-	igt_assert(feature->wait_until_enabled(drm.fd));
+	feature_enabled_or_die(drm, feature);
 
 	if (suspend) {
 		igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
 					      SUSPEND_TEST_NONE);
 		sleep(5);
-		igt_assert(feature->wait_until_enabled(drm.fd));
+		feature_enabled_or_die(drm, feature);
 	}
 
 	igt_remove_fb(drm.fd, &fb);
@@ -230,13 +255,13 @@ static void subtest(struct feature *feature, bool suspend)
 	sleep(3);
 
 	wait_user("Back to fbcon.");
-	igt_assert(!feature->wait_until_enabled(drm.fd));
+	feature_disabled_or_die(drm, feature);
 
 	if (suspend) {
 		igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
 					      SUSPEND_TEST_NONE);
 		sleep(5);
-		igt_assert(!feature->wait_until_enabled(drm.fd));
+		feature_disabled_or_die(drm, feature);
 	}
 }
 
Signature · 6 lines
2.11.0

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

✗ Fi.CI.BAT: warning for tests/kms_fbcon_fbt: Report fbc_status on error

== Series Details ==

== Series Details ==

Series: tests/kms_fbcon_fbt: Report fbc_status on error
URL : https://patchwork.freedesktop.org/series/32256/
State : warning

== Summary ==

IGT patchset tested on top of latest successful build 9a3f6f59d4c208219f7d3178106bdef628ff68d0 tests/intel-ci: Remove fast-feedback-simulation.testlist

with latest DRM-Tip kernel build CI_DRM_3261
399dd92e2b42 drm-tip: 2017y-10m-18d-21h-54m-46s UTC integration manifest

No testlist changes.

Test chamelium:

        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test kms_cursor_legacy:
        Subgroup basic-flip-before-cursor-varying-size:
                pass       -> SKIP       (fi-hsw-4770r)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                pass       -> FAIL       (fi-skl-6700k) fdo#100367

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

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:441s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:455s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:376s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:541s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:264s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:497s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:506s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:495s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:480s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:418s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:255s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:578s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:453s
fi-hsw-4770r     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:423s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:438s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:480s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:461s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:477s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:571s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:477s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:592s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:547s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:462s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:651s
fi-skl-6700k     total:289  pass:264  dwarn:0   dfail:0   fail:1   skip:24  time:499s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:506s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:457s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:569s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:420s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_380/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Gabriel Krisman Bertazi
Quoted 11 lines · Gabriel Krisman Bertazi

knowing the assertion triggered on wait_until_enabled() is not that useful without knowing what exactly caused the failure. It might be an user error, like too little stolen memory by the bios, or an actual issue in the kernel. So, let's make life easier, particularly for the CI, by printing the status before failing out.

Case in point:

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101718

The more igt-like (and simpler) pattern is to dump such debug info with igt_debug. When an igt_assert fails it'll dump all that stuff for you, and bonus, you can crank up the log level when debugging locally and watch it all.

Care to redo the patch along those lines?

Aside: We currently don't dump the log buffer when we hit an igt_skip, but that might be useful to do (at least in some cases), when we have pass/skip flip-floppers in CI.
-Daniel

Quoted 111 lines
---
 tests/kms_fbcon_fbt.c | 35 ++++++++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 5 deletions(-)
tests/kms_fbcon_fbt.c +30 -5
index d0090912694e..4027258ef1ba 100644
@@ -95,6 +95,14 @@ static bool connector_can_fbc(drmModeConnectorPtr connector)
 	return true;
 }
 
+static char *fbc_get_status(int fd)
+{
+	static char buf[128];
+
+	igt_debugfs_read(fd, "i915_fbc_status", buf);
+	return buf;
+}
+
 static bool fbc_is_enabled(int fd)
 {
 	char buf[128];
@@ -160,6 +168,14 @@ static bool connector_can_psr(drmModeConnectorPtr connector)
 	return (connector->connector_type == DRM_MODE_CONNECTOR_eDP);
 }
 
+static char *psr_get_status(int fd)
+{
+	static char buf[256];
+
+	igt_debugfs_read(fd, "i915_edp_psr_status", buf);
+	return buf;
+}
+
 static bool psr_is_enabled(int fd)
 {
 	char buf[256];
@@ -177,16 +193,19 @@ struct feature {
 	bool (*supported_on_chipset)(int fd);
 	bool (*wait_until_enabled)(int fd);
 	bool (*connector_possible_fn)(drmModeConnectorPtr connector);
+	char *(*get_status)(int fd);
 	const char *param_name;
 } fbc = {
 	.supported_on_chipset = fbc_supported_on_chipset,
 	.wait_until_enabled = fbc_wait_until_enabled,
 	.connector_possible_fn = connector_can_fbc,
+	.get_status = fbc_get_status,
 	.param_name = "enable_fbc",
 }, psr = {
 	.supported_on_chipset = psr_supported_on_chipset,
 	.wait_until_enabled = psr_wait_until_enabled,
 	.connector_possible_fn = connector_can_psr,
+	.get_status = psr_get_status,
 	.param_name = "enable_psr",
 };
 
@@ -196,6 +215,12 @@ static void disable_features(void)
 	igt_set_module_param_int(psr.param_name, 0);
 }
 
+#define feature_enabled_or_die(drm_info, feature) \
+	igt_assert_f(feature->wait_until_enabled(drm_info.fd), "%s\n", feature->get_status(drm_info.fd));
+
+#define feature_disabled_or_die(drm_info, feature) \
+	igt_assert_f(!feature->wait_until_enabled(drm_info.fd), "%s\n", feature->get_status(drm_info.fd));
+
 static void subtest(struct feature *feature, bool suspend)
 {
 	struct drm_info drm;
@@ -210,17 +235,17 @@ static void subtest(struct feature *feature, bool suspend)
 
 	kmstest_unset_all_crtcs(drm.fd, drm.res);
 	wait_user("Modes unset.");
-	igt_assert(!feature->wait_until_enabled(drm.fd));
+	feature_disabled_or_die(drm, feature);
 
 	set_mode_for_one_screen(&drm, &fb, feature->connector_possible_fn);
 	wait_user("Screen set.");
-	igt_assert(feature->wait_until_enabled(drm.fd));
+	feature_enabled_or_die(drm, feature);
 
 	if (suspend) {
 		igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
 					      SUSPEND_TEST_NONE);
 		sleep(5);
-		igt_assert(feature->wait_until_enabled(drm.fd));
+		feature_enabled_or_die(drm, feature);
 	}
 
 	igt_remove_fb(drm.fd, &fb);
@@ -230,13 +255,13 @@ static void subtest(struct feature *feature, bool suspend)
 	sleep(3);
 
 	wait_user("Back to fbcon.");
-	igt_assert(!feature->wait_until_enabled(drm.fd));
+	feature_disabled_or_die(drm, feature);
 
 	if (suspend) {
 		igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
 					      SUSPEND_TEST_NONE);
 		sleep(5);
-		igt_assert(!feature->wait_until_enabled(drm.fd));
+		feature_disabled_or_die(drm, feature);
 	}
 }
 
Signature · 1 line
2.11.0
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH v2 1/1 tests/kms_fbcon_fbt: Report fbc_status on error

knowing the assertion triggered on wait_until_enabled() is not that useful without knowing what exactly caused the failure. It might be an user error, like too little stolen memory by the bios, or an actual issue in the kernel. So, let's make life easier, particularly for the CI, by printing the status before failing out.

Case in point:

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101718

---
 tests/kms_fbcon_fbt.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)
tests/kms_fbcon_fbt.c +22 -2
index d0090912694e..8371be5612f5 100644
@@ -95,6 +95,14 @@ static bool connector_can_fbc(drmModeConnectorPtr connector)
 	return true;
 }
 
+static void fbc_print_status(int fd)
+{
+	static char buf[128];
+
+	igt_debugfs_read(fd, "i915_fbc_status", buf);
+	igt_debug("FBC status: %s\n", buf);
+}
+
 static bool fbc_is_enabled(int fd)
 {
 	char buf[128];
@@ -105,7 +113,9 @@ static bool fbc_is_enabled(int fd)
 
 static bool fbc_wait_until_enabled(int fd)
 {
-	return igt_wait(fbc_is_enabled(fd), 5000, 1);
+	bool r = igt_wait(fbc_is_enabled(fd), 5000, 1);
+	fbc_print_status(fd);
+	return r;
 }
 
 typedef bool (*connector_possible_fn)(drmModeConnectorPtr connector);
@@ -160,6 +170,14 @@ static bool connector_can_psr(drmModeConnectorPtr connector)
 	return (connector->connector_type == DRM_MODE_CONNECTOR_eDP);
 }
 
+static void psr_print_status(int fd)
+{
+	static char buf[256];
+
+	igt_debugfs_read(fd, "i915_edp_psr_status", buf);
+	igt_debug("FBC status: %s\n", buf);
+}
+
 static bool psr_is_enabled(int fd)
 {
 	char buf[256];
@@ -170,7 +188,9 @@ static bool psr_is_enabled(int fd)
 
 static bool psr_wait_until_enabled(int fd)
 {
-	return igt_wait(psr_is_enabled(fd), 5000, 1);
+	bool r = igt_wait(psr_is_enabled(fd), 5000, 1);
+	psr_print_status(fd);
+	return r;
 }
 
 struct feature {
Signature · 6 lines
2.11.0

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

✓ Fi.CI.BAT: success for tests/kms_fbcon_fbt: Report fbc_status on error (rev2)

In reply to Gabriel Krisman Bertazi
== Series Details ==

== Series Details ==

Series: tests/kms_fbcon_fbt: Report fbc_status on error (rev2)
URL : https://patchwork.freedesktop.org/series/32256/
State : success

== Summary ==

IGT patchset tested on top of latest successful build abc08cba366a64a07f7f4deb167ae7d6ae059958 lib: Free all internal buffers before measuring available memory

with latest DRM-Tip kernel build CI_DRM_3268
8ddf486a3f3a drm-tip: 2017y-10m-19d-20h-21m-08s UTC integration manifest

No testlist changes.

Test gem_exec_reloc:

        Subgroup basic-gtt-cpu-active:
                fail       -> PASS       (fi-gdg-551) fdo#102582
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-byt-j1900) fdo#101705

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

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:444s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:462s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:374s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:535s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:266s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:498s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:504s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:498s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:478s
fi-cfl-s         total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  time:554s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:416s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:248s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:581s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:455s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:430s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:431s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:497s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:463s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:490s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:574s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:477s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:586s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:545s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:449s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:646s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:521s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:501s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:463s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:572s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:434s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_392/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

✓ Fi.CI.IGT: success for tests/kms_fbcon_fbt: Report fbc_status on error (rev2)

In reply to Gabriel Krisman Bertazi
== Series Details ==

== Series Details ==

Series: tests/kms_fbcon_fbt: Report fbc_status on error (rev2)
URL : https://patchwork.freedesktop.org/series/32256/
State : success

== Summary ==

Test drv_module_reload:

        Subgroup basic-reload-inject:
                dmesg-warn -> PASS       (shard-hsw) fdo#102707
Test kms_busy:
        Subgroup extended-modeset-hang-newfb-with-reset-render-B:
                dmesg-warn -> PASS       (shard-hsw) fdo#103038

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

shard-hsw total:2540 pass:1431 dwarn:0 dfail:0 fail:8 skip:1101 time:9240s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_392/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx