[igt-dev] [PATCH i-g-t 2/2] tests/kms_invalid_mode: Test Cleanup

Nidhi Gupta nidhi1.gupta at intel.com
Thu Jun 23 23:57:28 UTC 2022


Sanitize the system state before starting the subtest.

Signed-off-by: Nidhi Gupta <nidhi1.gupta at intel.com>
---
 tests/kms_invalid_mode.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
index 7e1f683b..423d360f 100644
--- a/tests/kms_invalid_mode.c
+++ b/tests/kms_invalid_mode.c
@@ -184,9 +184,9 @@ test_output(data_t *data)
 	igt_output_t *output = data->output;
 	drmModeModeInfo mode;
 	struct igt_fb fb;
-	int ret;
-	uint32_t crtc_id;
 
+	igt_display_reset(&data->display);
+	igt_output_set_pipe(output, data->pipe);
 	/*
 	 * FIXME test every mode we have to be more
 	 * sure everything is really getting rejected?
@@ -203,12 +203,7 @@ test_output(data_t *data)
 
 	kmstest_unset_all_crtcs(data->drm_fd, data->res);
 
-	crtc_id = data->display.pipes[data->pipe].crtc_id;
-
-	ret = drmModeSetCrtc(data->drm_fd, crtc_id,
-			     fb.fb_id, 0, 0,
-			     &output->id, 1, &mode);
-	igt_assert_lt(ret, 0);
+	igt_display_commit(&data->display);
 
 	igt_remove_fb(data->drm_fd, &fb);
 }
-- 
2.26.2



More information about the igt-dev mailing list