[igt-dev] [PATCH 2/2] tests/kms_atomic_transition: Turn off pipe as well if all planes are off

Michel Dänzer michel at daenzer.net
Fri Aug 21 16:39:28 UTC 2020


From: Michel Dänzer <mdaenzer at redhat.com>

And set the DRM_MODE_ATOMIC_ALLOW_MODESET for TRANSITION_AFTER_FREE as
well.

This makes the test compatible with setups which don't support an
enabled pipe without any enabled planes.

Signed-off-by: Michel Dänzer <mdaenzer at redhat.com>
---
 tests/kms_atomic_transition.c | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index a71bbe10..4834b580 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -457,7 +457,7 @@ run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t *output
 	if (nonblocking)
 		flags |= DRM_MODE_ATOMIC_NONBLOCK;
 
-	if (type >= TRANSITION_MODESET)
+	if (type >= TRANSITION_AFTER_FREE)
 		flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
 
 	mode = igt_output_get_mode(output);
@@ -468,20 +468,11 @@ run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t *output
 	igt_create_fb(display->drm_fd, mode->hdisplay, mode->vdisplay,
 		      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &fb);
 
-	igt_output_set_pipe(output, pipe);
-
+	igt_output_set_pipe(output, PIPE_NONE);
 	wm_setup_plane(display, pipe, 0, NULL, false);
-
-	if (flags & DRM_MODE_ATOMIC_ALLOW_MODESET) {
-		igt_output_set_pipe(output, PIPE_NONE);
-
-		igt_display_commit2(display, COMMIT_ATOMIC);
-
-		igt_output_set_pipe(output, pipe);
-	}
-
 	igt_display_commit2(display, COMMIT_ATOMIC);
 
+	igt_output_set_pipe(output, pipe);
 	setup_parms(display, pipe, mode, &fb, &argb_fb, &sprite_fb, parms, &iter_max);
 
 	/*
@@ -490,6 +481,7 @@ run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t *output
 	 * planes to fix this
 	 */
 	while (1) {
+		igt_output_set_pipe(output, pipe);
 		wm_setup_plane(display, pipe, iter_max - 1, parms, false);
 
 		if (fencing)
@@ -524,6 +516,7 @@ run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t *output
 	if (type == TRANSITION_AFTER_FREE) {
 		int fence_fd = -1;
 
+		igt_output_set_pipe(output, PIPE_NONE);
 		wm_setup_plane(display, pipe, 0, parms, fencing);
 
 		atomic_commit(display, pipe, flags, (void *)(unsigned long)0, fencing);
@@ -577,6 +570,8 @@ run_transition_test(igt_display_t *display, enum pipe pipe, igt_output_t *output
 		} else {
 			uint32_t j;
 
+			igt_output_set_pipe(output, pipe);
+
 			/* i -> i+1 will be done when i increases, can be skipped here */
 			for (j = iter_max - 1; j > i + 1; j--) {
 				n_enable_planes = igt_hweight(j);
-- 
2.28.0



More information about the igt-dev mailing list