summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJosé Roberto de Souza <jose.souza@intel.com>2020-05-28 16:33:53 -0700
committerJosé Roberto de Souza <jose.souza@intel.com>2020-06-01 11:08:25 -0700
commitbea881189520a9cccbb1c1cb454ac5b6fdaea40e (patch)
tree004f3037d31ddd222938c16e0cdf447631da74a2 /lib
parent587cbed206689abbad60689d4a32bf9caf0cc124 (diff)
tests/kms_fbcon_fbt: When restoring fbcon always set mode to text mode
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. Reviewed-by: Uma Shankar <uma.shankar@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kms.c11
-rw-r--r--lib/igt_kms.h1
2 files changed, 12 insertions, 0 deletions
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,