All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/fbcon: Skip test if fbcon modeset if not compatible with feature tested
@ 2020-11-03  1:33 José Roberto de Souza
  2020-11-03  2:14 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: José Roberto de Souza @ 2020-11-03  1:33 UTC (permalink / raw)
  To: igt-dev

IGT has no control of what is going to be the modeset of fbcon and as
it could set a mode that is not compatible with the feature being
tested lets check for those incompatibilities and skip the test if
needed.

Fixes: https://gitlab.freedesktop.org/drm/intel/-/issues/2327
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 tests/kms_fbcon_fbt.c | 47 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
index e99a1f2f2..4df4db521 100644
--- a/tests/kms_fbcon_fbt.c
+++ b/tests/kms_fbcon_fbt.c
@@ -255,6 +255,48 @@ static inline void psr_debugfs_enable(int device, int debugfs_fd)
 	psr_enable(device, debugfs_fd, PSR_MODE_1);
 }
 
+static void fbc_skips_on_fbcon(int debugfs_fd)
+{
+	const char *reasons[] = {
+		"incompatible mode",
+		"mode too large for compression",
+		"framebuffer not tiled or fenced",
+		"pixel format is invalid",
+		"rotation unsupported",
+		"tiling unsupported",
+		"framebuffer stride not supported",
+		"per-pixel alpha blending is incompatible with FBC",
+		"pixel rate is too big",
+		"CFB requirements changed",
+		"plane Y offset is misaligned",
+		"plane height + offset is non-modulo of 4"
+	};
+	bool skip = false;
+	char buf[128];
+	int i;
+
+	igt_debugfs_simple_read(debugfs_fd, "i915_fbc_status", buf, sizeof(buf));
+	if (strstr(buf, "FBC enabled\n"))
+		return;
+
+	for (i = 0; skip == false && i < ARRAY_SIZE(reasons); i++)
+		skip = strstr(buf, reasons[i]);
+
+	if (skip)
+		igt_skip("fbcon modeset is not compatible with FBC\n");
+}
+
+static void psr_skips_on_fbcon(int debugfs_fd)
+{
+	/*
+	 * Unless fbcon enables interlaced mode all other PSR restrictions
+	 * will be caught and skipped in supported_on_chipset() hook.
+	 * As PSR don't expose in debugfs why it is not enabling for now
+	 * not checking not even if it was not enabled because of interlaced
+	 * mode, if some day it happens changes will be needed first.
+	 */
+}
+
 struct feature {
 	bool (*supported_on_chipset)(int device, int debugfs_fd);
 	bool (*wait_until_enabled)(int debugfs_fd);
@@ -262,6 +304,8 @@ struct feature {
 	bool (*wait_until_update)(struct drm_info *drm);
 	bool (*connector_possible_fn)(drmModeConnectorPtr connector);
 	void (*enable)(int device, int debugfs_fd);
+	/* skip test if feature can't be enabled due fbcon modeset */
+	void (*skips_on_fbcon)(int debugfs_fd);
 } fbc = {
 	.supported_on_chipset = fbc_supported_on_chipset,
 	.wait_until_enabled = fbc_wait_until_enabled,
@@ -269,6 +313,7 @@ struct feature {
 	.wait_until_update = fbc_wait_until_update,
 	.connector_possible_fn = connector_can_fbc,
 	.enable = fbc_modparam_enable,
+	.skips_on_fbcon = fbc_skips_on_fbcon,
 }, psr = {
 	.supported_on_chipset = psr_supported_on_chipset,
 	.wait_until_enabled = psr_wait_until_enabled,
@@ -276,6 +321,7 @@ struct feature {
 	.wait_until_update = psr_wait_until_update,
 	.connector_possible_fn = connector_can_psr,
 	.enable = psr_debugfs_enable,
+	.skips_on_fbcon = psr_skips_on_fbcon,
 };
 
 static void restore_fbcon(struct drm_info *drm)
@@ -317,6 +363,7 @@ static void subtest(struct drm_info *drm, struct feature *feature, bool suspend)
 	sleep(3);
 
 	wait_user("Back to fbcon.");
+	feature->skips_on_fbcon(drm->debugfs_fd);
 	igt_assert(feature->wait_until_update(drm));
 
 	if (suspend) {
-- 
2.29.2

_______________________________________________
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-11-19 20:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-03  1:33 [igt-dev] [PATCH i-g-t] tests/fbcon: Skip test if fbcon modeset if not compatible with feature tested José Roberto de Souza
2020-11-03  2:14 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2020-11-05 14:09 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/fbcon: Skip test if fbcon modeset if not compatible with feature tested (rev2) Patchwork
2020-11-05 15:17 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/fbcon: Skip test if fbcon modeset if not compatible with feature tested (rev3) Patchwork
2020-11-05 18:25 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-11-05 18:27   ` Souza, Jose
2020-11-19 20:58   ` Souza, Jose
2020-11-19 18:32 ` [igt-dev] [PATCH i-g-t] tests/fbcon: Skip test if fbcon modeset if not compatible with feature tested Sripada, Radhakrishna

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.