Skip to contentSkip to conversation

igt: Add a dpms property test

RFC PATCH In review Marta Lofstedt 2 participants 2 messages Dec 7, 2016

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 igt: Add a dpms property test

This testcase will set the dpms drm property to DRM_MODE_DPMS_ON and DPMS_MODE_OFF and check that the property values was updated and that the new state corresponds to the crtc active property.

---
 tests/Makefile.sources |   1 +
 tests/drm_dpms.c       | 168 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 169 insertions(+)
 create mode 100644 tests/drm_dpms.c
tests/Makefile.sources +1 -0
index 04dd2d5..6d6e3db 100644
@@ -14,6 +14,7 @@ VC4_TESTS_M = \
 TESTS_progs_M = \
 	core_get_client_auth \
 	drm_mm \
+	drm_dpms \
 	drv_getparams_basic \
 	drv_selftest \
 	drv_suspend \
tests/drm_dpms.c new file +168 -0

168 lines not on this page · raw message

Signature · 6 lines
2.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 17 lines · Marta Lofstedt

This testcase will set the dpms drm property to DRM_MODE_DPMS_ON and DPMS_MODE_OFF and check that the property values was updated and that the new state corresponds to the crtc active property.

---
 tests/Makefile.sources |   1 +
 tests/drm_dpms.c       | 168 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 169 insertions(+)
 create mode 100644 tests/drm_dpms.c
tests/Makefile.sources +0 -0
index 04dd2d5..6d6e3db 100644

tests/Makefile.sources VC4_TESTS_M = \ · line 17

Quoted 4 lines
tests/Makefile.sources +1 -0
@@ -14,6 +14,7 @@ VC4_TESTS_M = \
 TESTS_progs_M = \
 	core_get_client_auth \
 	drm_mm \
+	drm_dpms \

This should be a kms_ test

Quoted 3 lines
tests/Makefile.sources +0 -0
 	drv_getparams_basic \
 	drv_selftest \
 	drv_suspend \

<snip>

Quoted 9 lines
tests/Makefile.sources +9 -0
+static void dpms_property(igt_display_t *display)
+{
+	enum pipe pipe;
+	igt_output_t *output;
+
+	for_each_connected_output(display, output) {
+		bool found = false;
+
+		for_each_pipe(display, pipe) {

tests/Makefile.sources

Quoted 10 lines
tests/Makefile.sources +10 -0
+			if (!igt_pipe_connector_valid(pipe, output))
+				continue;
+
+			found = true;
+			run_dpms_test(display, pipe, output);
+			break;
+		}
+
+		igt_assert_f(found,
+			     "Connected output should have at least 1 valid crtc\n");

That's a requirement for the test to run (igt_require_f) not an assertion. If the hardware doesn't meet the test criteria igt_require_f will SKIP, but igt_assert_f will FAIL.

Quoted 9 lines
tests/Makefile.sources +9 -0
+	}
+}
+
+igt_main
+{
+	igt_display_t display;
+
+	igt_skip_on_simulation();
+

tests/Makefile.sources

Quoted 10 lines
tests/Makefile.sources +10 -0
+	igt_fixture {
+		display.drm_fd = drm_open_driver_master(DRIVER_ANY);
+
+		kmstest_set_vt_graphics_mode();
+
+		igt_display_init(&display, display.drm_fd);
+	}
+
+	igt_subtest("dpms_property")
+		dpms_property(&display);

Doesn't this want to a subtest for each connector? -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx