diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-10-31 17:02:41 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-11-01 21:10:59 +0100 |
commit | 1f0cf2df85ca3f9d900b21db9c8744a99e8f60a0 (patch) | |
tree | a82e58d0601e8245a835194636cac0a04b5e8709 /lib | |
parent | 0369fe19b8b8e19e0815361b5187eba81cb2d71a (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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/drmtest.c | 7 | ||||
-rw-r--r-- | lib/drmtest.h | 2 |
2 files changed, 4 insertions, 5 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); |