[PATCH i-g-t 2/2] tests/kms_force_connector: reset connectors and edid on exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Thomas Wood <thomas.wood@xxxxxxxxx>
---
 tests/kms_force_connector.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c
index a79c974..cf918a7 100644
--- a/tests/kms_force_connector.c
+++ b/tests/kms_force_connector.c
@@ -31,7 +31,7 @@ IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work"
 	igt_assert_eq(m.hdisplay, h); igt_assert_eq(m.vdisplay, w); \
 	igt_assert_eq(m.vrefresh, r);
 
-static void __attribute__((noreturn)) reset_connectors()
+static void reset_connectors()
 {
 	int drm_fd = 0;
 	drmModeRes *res;
@@ -51,8 +51,6 @@ static void __attribute__((noreturn)) reset_connectors()
 
 		drmModeFreeConnector(connector);
 	}
-
-	exit(0);
 }
 
 static int opt_handler(int opt, int opt_index, void *data)
@@ -60,6 +58,7 @@ static int opt_handler(int opt, int opt_index, void *data)
 	switch (opt) {
 	case 'r':
 		reset_connectors();
+		exit(0);
 		break;
 	}
 
@@ -172,6 +171,9 @@ int main(int argc, char **argv)
 
 	igt_fixture {
 		drmModeFreeConnector(vga_connector);
+		close(drm_fd);
+
+		reset_connectors();
 	}
 
 	igt_exit();
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux