diff mbox

[i-g-t] lib: always reset connectors after the state is forced

Message ID 1417626602-1153-1-git-send-email-thomas.wood@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Wood Dec. 3, 2014, 5:10 p.m. UTC
Install the exit handler to reset connector states whenever
kmstest_force_connector is called, so that the connector states are
always reset even if a test fails.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 lib/igt_kms.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index eb8e085..ae7819f 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -256,6 +256,12 @@  void kmstest_set_vt_graphics_mode(void)
 	igt_debug("VT: graphics mode set\n");
 }
 
+
+static void reset_connectors_at_exit(int sig)
+{
+	igt_reset_connectors();
+}
+
 /**
  * kmstest_force_connector:
  * @fd: drm file descriptor
@@ -337,6 +343,7 @@  bool kmstest_force_connector(int drm_fd, drmModeConnector *connector,
 		tmp++;
 	}
 
+	igt_install_exit_handler(reset_connectors_at_exit);
 
 	igt_assert(ret != -1);
 	return (ret == -1) ? false : true;
@@ -1659,11 +1666,6 @@  void igt_wait_for_vblank(int drm_fd, enum pipe pipe)
 	igt_assert(drmWaitVBlank(drm_fd, &wait_vbl) == 0);
 }
 
-static void reset_connectors_at_exit(int sig)
-{
-	igt_reset_connectors();
-}
-
 /**
  * igt_enable_connectors:
  *
@@ -1703,8 +1705,6 @@  void igt_enable_connectors(void)
 		drmModeFreeConnector(c);
 	}
 	close(drm_fd);
-
-	igt_install_exit_handler(reset_connectors_at_exit);
 }
 
 /**