From e9f4c3170c76bb5153e9d1d7212b2256a44b1725 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Tue, 10 Oct 2017 16:47:04 +0200 Subject: tests/debugfs_test: Try to light all outputs to increase chances of finding fails, v3. Make sure read_all_entries has all outputs possible enabled, but also add a test that runs with all outputs disabled. This will maximize coverage of debugfs reading, and allows the test not to be dependent on fbcon for setup. Changes since v1: - Put framebuffers on all primary planes, to get a crc from i915_sink_src_eDP1. Changes since v2: - Use igt_output_get_plane_type, not igt_output_get_plane. Signed-off-by: Maarten Lankhorst [mlankhorst: Add comment suggested by ickle.] Reviewed-by: Chris Wilson --- tests/debugfs_test.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'tests/debugfs_test.c') diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c index 5e7805e1..ae38ba07 100644 --- a/tests/debugfs_test.c +++ b/tests/debugfs_test.c @@ -78,15 +78,65 @@ static void read_and_discard_sysfs_entries(int path_fd) igt_main { int fd = -1, debugfs; + igt_display_t display; + struct igt_fb fb[IGT_MAX_PIPES]; + enum pipe pipe; + igt_skip_on_simulation(); igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); igt_require_gem(fd); debugfs = igt_debugfs_dir(fd); + + kmstest_set_vt_graphics_mode(); + igt_display_init(&display, fd); } igt_subtest("read_all_entries") { + /* try to light all pipes */ + for_each_pipe(&display, pipe) { + igt_output_t *output; + + for_each_valid_output_on_pipe(&display, pipe, output) { + igt_plane_t *primary; + drmModeModeInfo *mode; + + if (output->pending_pipe != PIPE_NONE) + continue; + + igt_output_set_pipe(output, pipe); + primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY); + mode = igt_output_get_mode(output); + igt_create_pattern_fb(display.drm_fd, + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, &fb[pipe]); + + /* Set a valid fb as some debugfs like to inspect it on a active pipe */ + igt_plane_set_fb(primary, &fb[pipe]); + break; + } + } + + igt_display_commit2(&display, display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY); + + read_and_discard_sysfs_entries(debugfs); + } + + igt_subtest("read_all_entries_display_off") { + igt_output_t *output; + igt_plane_t *plane; + + for_each_connected_output(&display, output) + igt_output_set_pipe(output, PIPE_NONE); + + for_each_pipe(&display, pipe) + for_each_plane_on_pipe(&display, pipe, plane) + igt_plane_set_fb(plane, NULL); + + igt_display_commit2(&display, display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY); + read_and_discard_sysfs_entries(debugfs); } @@ -112,6 +162,7 @@ igt_main } igt_fixture { + igt_display_fini(&display); close(debugfs); close(fd); } -- cgit v1.2.3