[Intel-gfx] [PATCH i-g-t 3/4] tests: use base edid

Thomas Wood thomas.wood at intel.com
Fri Nov 28 17:22:23 CET 2014


Use the base edid for testing, which includes several different display
modes.

Signed-off-by: Thomas Wood <thomas.wood at intel.com>
---
 tests/kms_3d.c              |  4 ++--
 tests/kms_force_connector.c | 31 ++++++++++++-------------------
 2 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/tests/kms_3d.c b/tests/kms_3d.c
index b1712b2..6b1c1b3 100644
--- a/tests/kms_3d.c
+++ b/tests/kms_3d.c
@@ -58,7 +58,7 @@ igt_simple_main
 	}
 	igt_require(connector);
 
-	kmstest_edid_add_3d(generic_edid[EDID_FHD], EDID_LENGTH, &edid,
+	kmstest_edid_add_3d(igt_kms_get_base_edid(), EDID_LENGTH, &edid,
 			    &length);
 
 	kmstest_force_edid(drm_fd, connector, edid, length);
@@ -75,7 +75,7 @@ igt_simple_main
 			mode_count++;
 	}
 
-	igt_assert(mode_count == 13);
+	igt_assert(mode_count == 15);
 
 	/* set 3D modes */
 	igt_info("Testing:\n");
diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c
index d446eaa..4a50791 100644
--- a/tests/kms_force_connector.c
+++ b/tests/kms_force_connector.c
@@ -27,6 +27,9 @@
 #include "drmtest.h"
 #include "igt_edid.h"
 
+#define CHECK_MODE(m, h, w, r) igt_assert(m.hdisplay == h && m.vdisplay == w \
+					  && m.vrefresh == r)
+
 igt_main
 {
 	/* force the VGA output and test that it worked */
@@ -93,25 +96,15 @@ igt_main
 
 		/* test edid forcing */
 		kmstest_force_edid(drm_fd, vga_connector,
-				   generic_edid[EDID_FHD], EDID_LENGTH);
-		temp = drmModeGetConnector(drm_fd, vga_connector->connector_id);
-
-		igt_assert(temp->count_modes == 1);
-		igt_assert(temp->modes[0].vrefresh == 60
-			   && temp->modes[0].hdisplay == 1920
-			   && temp->modes[0].vdisplay == 1080);
-
-		drmModeFreeConnector(temp);
-
-		/* custom edid */
-		kmstest_force_edid(drm_fd, vga_connector,
-				   generic_edid[EDID_WSXGA], EDID_LENGTH);
-		temp = drmModeGetConnector(drm_fd, vga_connector->connector_id);
-
-		igt_assert(temp->count_modes == 1);
-		igt_assert(temp->modes[0].vrefresh == 60
-			   && temp->modes[0].hdisplay == 1680
-			   && temp->modes[0].vdisplay == 1050);
+				   igt_kms_get_base_edid(), EDID_LENGTH);
+		temp = drmModeGetConnector(drm_fd,
+					   vga_connector->connector_id);
+
+		CHECK_MODE(temp->modes[0], 1920, 1080, 60);
+		CHECK_MODE(temp->modes[1], 1280, 720, 60);
+		CHECK_MODE(temp->modes[2], 1024, 768, 60);
+		CHECK_MODE(temp->modes[3], 800, 600, 60);
+		CHECK_MODE(temp->modes[4], 640, 480, 60);
 
 		drmModeFreeConnector(temp);
 
-- 
2.1.0




More information about the Intel-gfx mailing list