Re: [PATCH i-g-t v2] tests: Validate TEST_ONLY correctness against full atomic commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Op 30-01-17 om 12:37 schreef Mika Kahola:
> Validate atomic commit correctness before actual commit.
>
> For: VIZ-6956
>
> v2: Add flag to toggle TEST_ONLY for atomic commit.
>     Remove DRM_MODE_PAGE_FLIP_EVENT flag, if enabled, before trying atomic
>     commit with TEST_ONLY flag (Maarten)
>
> Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
>
> Signed-off-by: Mika Kahola <mika.kahola@xxxxxxxxx>
> <snip>

Hey,

Way too complicated, I thought of something like this instead too run a whole test with TEST_ONLY.

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 77de678e121b..c935203f5b5c 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2332,7 +2332,23 @@ static int igt_atomic_commit(igt_display_t *display, uint32_t flags, void *user_
 		igt_atomic_prepare_connector_commit(output, req);
 	}
 
-	ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
+	if (display->force_test_atomic &&
+	    !(flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
+		unsigned int test_flags = flags & ~DRM_MODE_PAGE_FLIP_EVENT;
+		int test_ret;
+
+		test_flags |= DRM_MODE_ATOMIC_TEST_ONLY;
+
+		test_ret = drmModeAtomicCommit(display->drm_fd, req, test_flags, user_data);
+		ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
+
+		if (test_ret)
+			igt_assert_eq(test_ret, ret);
+		else
+			igt_assert(ret != -EINVAL);
+	} else
+		ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
+
 	drmModeAtomicFree(req);
 	return ret;
 
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 81be77f5a16f..8ac7eb074fe7 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -335,7 +335,7 @@ struct igt_display {
 	igt_output_t *outputs;
 	igt_pipe_t *pipes;
 	bool has_cursor_plane;
-	bool is_atomic;
+	bool is_atomic, force_test_atomic;
 };
 
 void igt_display_init(igt_display_t *display, int drm_fd);

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux