public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "José Roberto de Souza" <jose.souza@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tests/kms_fbcon_fbt: When restoring fbcon always set mode to text mode
Date: Thu, 28 May 2020 17:52:18 -0700	[thread overview]
Message-ID: <20200529005218.76681-1-jose.souza@intel.com> (raw)

If by some reason or tests, this tests is executed and VT mode is
already in KD_GRAPHICS the call to kmstest_set_vt_graphics_mode() will
set orig_vt_mode as KD_GRAPHICS and when it was calling
kmstest_restore_vt_mode() it would set KD_GRAPHICS again not returning
to fbcon and causing the test to fail.

As it can be seen here:
(kms_fbcon_fbt:11004) igt_kms-DEBUG: VT: graphics mode set (mode was 0x1)"
https://intel-gfx-ci.01.org/tree/drm-tip/drmtip_499/fi-ehl-1/igt@kms_fbcon_fbt@fbc.html

So here adding a new function to alaways set mode the KD_TEXT when we
want to restore to fbcon.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 lib/igt_kms.c         | 11 +++++++++++
 lib/igt_kms.h         |  1 +
 tests/kms_fbcon_fbt.c |  2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d4cbc1c53..afef59396 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -968,6 +968,17 @@ void kmstest_set_vt_graphics_mode(void)
 	igt_debug("VT: graphics mode set (mode was 0x%lx)\n", ret);
 }
 
+/**
+ * kmstest_set_vt_text_mode:
+ *
+ * Sets the controlling VT (if available) into text mode.
+ * Unlikely kmstest_set_vt_graphics_mode() it do not install an igt exit
+ * handler to set the VT back to the previous mode.
+ */
+void kmstest_set_vt_text_mode(void)
+{
+	igt_assert(set_vt_mode(KD_TEXT) >= 0);
+}
 
 static void reset_connectors_at_exit(int sig)
 {
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index adca59ac6..32a0e4cc6 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -93,6 +93,7 @@ void kmstest_dump_mode(drmModeModeInfo *mode);
 int kmstest_get_pipe_from_crtc_id(int fd, int crtc_id);
 void kmstest_set_vt_graphics_mode(void);
 void kmstest_restore_vt_mode(void);
+void kmstest_set_vt_text_mode(void);
 
 enum igt_atomic_crtc_properties {
        IGT_CRTC_BACKGROUND = 0,
diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
index e6dd4353b..e99a1f2f2 100644
--- a/tests/kms_fbcon_fbt.c
+++ b/tests/kms_fbcon_fbt.c
@@ -283,7 +283,7 @@ static void restore_fbcon(struct drm_info *drm)
 	kmstest_unset_all_crtcs(drm->fd, drm->res);
 	igt_remove_fb(drm->fd, &drm->fb);
 	igt_device_drop_master(drm->fd);
-	kmstest_restore_vt_mode();
+	kmstest_set_vt_text_mode();
 }
 
 static void subtest(struct drm_info *drm, struct feature *feature, bool suspend)
-- 
2.26.2

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

             reply	other threads:[~2020-05-29  0:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  0:52 José Roberto de Souza [this message]
2020-05-29  1:25 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_fbcon_fbt: When restoring fbcon always set mode to text mode Patchwork
2020-05-29  6:41 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-06-01 18:09   ` Souza, Jose
2020-05-29 15:49 ` [igt-dev] [PATCH i-g-t] " Shankar, Uma
2020-05-29 16:51   ` Souza, Jose
2020-06-01 11:44     ` Shankar, Uma
2020-06-01 16:42       ` Souza, Jose
2020-06-01 18:03         ` Shankar, Uma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200529005218.76681-1-jose.souza@intel.com \
    --to=jose.souza@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox