summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-31 17:02:41 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-11-01 21:10:59 +0100
commit1f0cf2df85ca3f9d900b21db9c8744a99e8f60a0 (patch)
treea82e58d0601e8245a835194636cac0a04b5e8709
parent0369fe19b8b8e19e0815361b5187eba81cb2d71a (diff)
lib: make igt_set_vt_graphics_mode never fail
All tests agree that this is a letal failure, so no point to pass it back to callers. Also add some igt_require calls for the drm_fd where I've noticed that it's missing. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--lib/drmtest.c7
-rw-r--r--lib/drmtest.h2
-rw-r--r--tests/debugfs_pipe_crc.c4
-rw-r--r--tests/kms_cursor_crc.c4
-rw-r--r--tests/kms_flip.c2
-rw-r--r--tests/kms_render.c2
-rw-r--r--tests/kms_setmode.c2
-rw-r--r--tests/pc8.c2
-rw-r--r--tests/testdisplay.c2
9 files changed, 15 insertions, 12 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c
index f76ef0f3..50b5aac0 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -2111,10 +2111,9 @@ static void restore_vt_mode_at_exit(int sig)
* original mode.
*/
-int igt_set_vt_graphics_mode(void)
+void igt_set_vt_graphics_mode(void)
{
- if (igt_install_exit_handler(restore_vt_mode_at_exit))
- return -1;
+ do_or_die(igt_install_exit_handler(restore_vt_mode_at_exit));
igt_disable_exit_handler();
orig_vt_mode = set_vt_mode(KD_GRAPHICS);
@@ -2122,7 +2121,7 @@ int igt_set_vt_graphics_mode(void)
orig_vt_mode = -1UL;
igt_enable_exit_handler();
- return orig_vt_mode < 0 ? -1 : 0;
+ igt_assert(orig_vt_mode >= 0);
}
int kmstest_get_connector_default_mode(int drm_fd, drmModeConnector *connector,
diff --git a/lib/drmtest.h b/lib/drmtest.h
index f5e27081..6e8b16b5 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -394,7 +394,7 @@ void igt_enable_exit_handler(void);
void igt_disable_exit_handler(void);
/* set vt into graphics mode, required to prevent fbcon from interfering */
-int igt_set_vt_graphics_mode(void);
+void igt_set_vt_graphics_mode(void);
/* prefault disabling, needs the corresponding debugfs interface */
void igt_disable_prefault(void);
diff --git a/tests/debugfs_pipe_crc.c b/tests/debugfs_pipe_crc.c
index 01cd8b51..debc172f 100644
--- a/tests/debugfs_pipe_crc.c
+++ b/tests/debugfs_pipe_crc.c
@@ -220,7 +220,9 @@ int main(int argc, char **argv)
const char *cmd = "pipe A none";
data.drm_fd = drm_open_any();
- do_or_die(igt_set_vt_graphics_mode());
+ igt_require(data.drm_fd >= 0);
+
+ igt_set_vt_graphics_mode();
display_init(&data);
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index c82d3e76..359825ca 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -334,7 +334,9 @@ int main(int argc, char **argv)
const char *cmd = "pipe A none";
data.drm_fd = drm_open_any();
- do_or_die(igt_set_vt_graphics_mode());
+ igt_require(data.drm_fd >= 0);
+
+ igt_set_vt_graphics_mode();
igt_debugfs_init(&data.debugfs);
data.ctl = igt_debugfs_fopen(&data.debugfs,
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 58185ef6..e8d3e22c 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1493,7 +1493,7 @@ int main(int argc, char **argv)
igt_fixture {
drm_fd = drm_open_any();
- do_or_die(igt_set_vt_graphics_mode());
+ igt_set_vt_graphics_mode();
do_or_die(igt_install_exit_handler(kms_flip_exit_handler));
get_timestamp_format();
diff --git a/tests/kms_render.c b/tests/kms_render.c
index 6a410554..26ca8dc4 100644
--- a/tests/kms_render.c
+++ b/tests/kms_render.c
@@ -242,7 +242,7 @@ int main(int argc, char **argv)
devid = intel_get_drm_devid(drm_fd);
batch = intel_batchbuffer_alloc(bufmgr, devid);
- do_or_die(igt_set_vt_graphics_mode());
+ igt_set_vt_graphics_mode();
}
for (i = 0; i < ARRAY_SIZE(tests); i++) {
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 7b222255..6bc7db15 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -702,7 +702,7 @@ int main(int argc, char **argv)
igt_fixture {
drm_fd = drm_open_any();
if (!dry_run)
- do_or_die(igt_set_vt_graphics_mode());
+ igt_set_vt_graphics_mode();
drm_resources = drmModeGetResources(drm_fd);
assert(drm_resources);
diff --git a/tests/pc8.c b/tests/pc8.c
index e3d6e33b..0ec011e3 100644
--- a/tests/pc8.c
+++ b/tests/pc8.c
@@ -292,7 +292,7 @@ static void init_mode_set_data(struct mode_set_data *data)
data->bufmgr = drm_intel_bufmgr_gem_init(drm_fd, 4096);
data->devid = intel_get_drm_devid(drm_fd);
- do_or_die(igt_set_vt_graphics_mode());
+ igt_set_vt_graphics_mode();
drm_intel_bufmgr_gem_enable_reuse(data->bufmgr);
}
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index a0f43e98..fd172f3e 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -801,7 +801,7 @@ int main(int argc, char **argv)
goto out_close;
}
- do_or_die(igt_set_vt_graphics_mode());
+ igt_set_vt_graphics_mode();
mainloop = g_main_loop_new(NULL, FALSE);
if (!mainloop) {