summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/igt_kms.c14
-rw-r--r--lib/igt_kms.h9
-rw-r--r--tests/kms_cursor_crc.c2
-rw-r--r--tests/kms_fbc_crc.c2
-rw-r--r--tests/kms_fence_pin_leak.c2
-rw-r--r--tests/kms_flip.c2
-rw-r--r--tests/kms_flip_event_leak.c2
-rw-r--r--tests/kms_flip_tiling.c2
-rw-r--r--tests/kms_force_connector.c2
-rw-r--r--tests/kms_mmio_vs_cs_flip.c2
-rw-r--r--tests/kms_pipe_crc_basic.c2
-rw-r--r--tests/kms_plane.c2
-rw-r--r--tests/kms_psr_sink_crc.c2
-rw-r--r--tests/kms_render.c2
-rw-r--r--tests/kms_rotation_crc.c2
-rw-r--r--tests/kms_setmode.c2
-rw-r--r--tests/kms_sink_crc_basic.c2
-rw-r--r--tests/kms_universal_plane.c2
-rw-r--r--tests/pm_lpsp.c2
-rw-r--r--tests/pm_rpm.c2
-rw-r--r--tests/testdisplay.c2
21 files changed, 34 insertions, 27 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index fec859c0..e28d7a82 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -287,12 +287,16 @@ static void restore_vt_mode_at_exit(int sig)
set_vt_mode(orig_vt_mode);
}
-/*
- * Set the VT to graphics mode and install an exit handler to restore the
- * original mode.
+/**
+ * kmstest_set_vt_graphics_mode:
+ *
+ * Sets the controlling VT (if available) into graphics/raw mode and installs an
+ * igt exit handler to set the VT back to text mode on exit.
+ *
+ * All kms tests must call this function to make sure that the fbcon doesn't
+ * interfere by e.g. blanking the screen.
*/
-
-void igt_set_vt_graphics_mode(void)
+void kmstest_set_vt_graphics_mode(void)
{
long ret;
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 342208a5..09f15455 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -36,6 +36,8 @@
#include "igt_fb.h"
+/* Low-level helpers with kmstest_ prefix */
+
enum pipe {
PIPE_A = 0,
PIPE_B,
@@ -163,6 +165,10 @@ void kmstest_unset_all_crtcs(int drm_fd, drmModeResPtr resources);
* A small modeset API
*/
+/* set vt into graphics mode, required to prevent fbcon from interfering */
+void kmstest_set_vt_graphics_mode(void);
+
+/* High-level kms api with igt_ prefix */
enum igt_commit_style {
COMMIT_LEGACY = 0,
COMMIT_UNIVERSAL,
@@ -239,9 +245,6 @@ struct igt_display {
bool has_universal_planes;
};
-/* set vt into graphics mode, required to prevent fbcon from interfering */
-void igt_set_vt_graphics_mode(void);
-
void igt_display_init(igt_display_t *display, int drm_fd);
void igt_display_fini(igt_display_t *display);
int igt_display_commit2(igt_display_t *display, enum igt_commit_style s);
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index e7240732..6af30fda 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -440,7 +440,7 @@ igt_main
/* We assume width and height are same so max is assigned width */
igt_assert_cmpint(cursor_width, ==, cursor_height);
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
igt_require_pipe_crc();
diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c
index 4302d1b4..9aeffd09 100644
--- a/tests/kms_fbc_crc.c
+++ b/tests/kms_fbc_crc.c
@@ -499,7 +499,7 @@ igt_main
FILE *status;
data.drm_fd = drm_open_any();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
data.devid = intel_get_drm_devid(data.drm_fd);
diff --git a/tests/kms_fence_pin_leak.c b/tests/kms_fence_pin_leak.c
index 6a05d977..51bc72f1 100644
--- a/tests/kms_fence_pin_leak.c
+++ b/tests/kms_fence_pin_leak.c
@@ -216,7 +216,7 @@ igt_simple_main
data.devid = intel_get_drm_devid(data.drm_fd);
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
igt_assert(data.bufmgr);
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 92f4eb52..45f1ba2f 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1596,7 +1596,7 @@ int main(int argc, char **argv)
igt_enable_connectors();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
igt_install_exit_handler(kms_flip_exit_handler);
get_timestamp_format();
diff --git a/tests/kms_flip_event_leak.c b/tests/kms_flip_event_leak.c
index 99243335..8cbec00e 100644
--- a/tests/kms_flip_event_leak.c
+++ b/tests/kms_flip_event_leak.c
@@ -115,7 +115,7 @@ igt_simple_main
igt_skip_on_simulation();
data.drm_fd = drm_open_any();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
igt_display_init(&data.display, data.drm_fd);
diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
index ca20ad96..6f8ee941 100644
--- a/tests/kms_flip_tiling.c
+++ b/tests/kms_flip_tiling.c
@@ -128,7 +128,7 @@ igt_main
igt_fixture {
data.drm_fd = drm_open_any();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
igt_require_pipe_crc();
igt_display_init(&data.display, data.drm_fd);
diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c
index 47e2b484..7dba68ac 100644
--- a/tests/kms_force_connector.c
+++ b/tests/kms_force_connector.c
@@ -64,7 +64,7 @@ main (int argc, char **argv)
drmModeFreeConnector(temp);
/* attempt to use the display */
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
igt_display_init(&display, drm_fd);
igt_display_commit(&display);
diff --git a/tests/kms_mmio_vs_cs_flip.c b/tests/kms_mmio_vs_cs_flip.c
index 314a31d8..243e4244 100644
--- a/tests/kms_mmio_vs_cs_flip.c
+++ b/tests/kms_mmio_vs_cs_flip.c
@@ -546,7 +546,7 @@ igt_main
igt_fixture {
data.drm_fd = drm_open_any();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
data.devid = intel_get_drm_devid(data.drm_fd);
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index a93c20fa..15aba2f2 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -233,7 +233,7 @@ igt_main
igt_enable_connectors();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
igt_require_pipe_crc();
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 2e552fdc..42af2fb8 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -381,7 +381,7 @@ igt_main
igt_fixture {
data.drm_fd = drm_open_any();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
igt_require_pipe_crc();
igt_display_init(&data.display, data.drm_fd);
diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 9cae9a6a..324f9b40 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -592,7 +592,7 @@ igt_main
igt_fixture {
data.drm_fd = drm_open_any();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
data.devid = intel_get_drm_devid(data.drm_fd);
diff --git a/tests/kms_render.c b/tests/kms_render.c
index 84cda80a..d8d157c4 100644
--- a/tests/kms_render.c
+++ b/tests/kms_render.c
@@ -236,7 +236,7 @@ igt_main
devid = intel_get_drm_devid(drm_fd);
batch = intel_batchbuffer_alloc(bufmgr, devid);
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
}
for (i = 0; i < ARRAY_SIZE(tests); i++) {
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 5041f906..9146b4fc 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -195,7 +195,7 @@ igt_main
igt_fixture {
data.gfx_fd = drm_open_any();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
igt_require_pipe_crc();
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 46edf54b..f4197854 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -714,7 +714,7 @@ int main(int argc, char **argv)
igt_fixture {
drm_fd = drm_open_any();
if (!dry_run)
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
drm_resources = drmModeGetResources(drm_fd);
igt_assert(drm_resources);
diff --git a/tests/kms_sink_crc_basic.c b/tests/kms_sink_crc_basic.c
index 087b79db..079ec896 100644
--- a/tests/kms_sink_crc_basic.c
+++ b/tests/kms_sink_crc_basic.c
@@ -180,7 +180,7 @@ igt_simple_main
data.drm_fd = drm_open_any();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
data.resources = drmModeGetResources(data.drm_fd);
igt_assert(data.resources);
diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index 805cc596..2e67e242 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -561,7 +561,7 @@ igt_main
igt_fixture {
data.drm_fd = drm_open_any();
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
igt_require_pipe_crc();
igt_display_init(&data.display, data.drm_fd);
diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c
index af274776..250b1406 100644
--- a/tests/pm_lpsp.c
+++ b/tests/pm_lpsp.c
@@ -245,7 +245,7 @@ igt_main
intel_register_access_init(intel_get_pci_device(), 0);
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
}
igt_subtest("screens-disabled")
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index 59a182a9..841566ba 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -404,7 +404,7 @@ static void init_mode_set_data(struct mode_set_data *data)
data->devid = intel_get_drm_devid(drm_fd);
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
init_modeset_cached_params(&ms_data);
}
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index f26d9425..cfc629a1 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -849,7 +849,7 @@ int main(int argc, char **argv)
goto out_close;
}
- igt_set_vt_graphics_mode();
+ kmstest_set_vt_graphics_mode();
mainloop = g_main_loop_new(NULL, FALSE);
if (!mainloop) {