Skip to contentSkip to conversation

tests/kms_plane_multiple: Fix CI issues

PATCH Superseded Mika Kahola 2 participants 6 messages Jan 16, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover tests/kms_plane_multiple: Fix CI issues

Fixes for issues seen on CI tests. The patches provide relaxed timing requirement for atomic commit as well as general cleanup to favor library functions.

Mika Kahola (2):
tests/kms_plane_multiple: Relax atomic commit time requirement tests/kms_plane_multiple: Cleanup in favor of library functions

 tests/kms_plane_multiple.c | 34 +++++++---------------------------
 1 file changed, 7 insertions(+), 27 deletions(-)
Signature · 6 lines
2.7.4

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

PATCH 1/2 tests/kms_plane_multiple: Relax atomic commit time requirement

Relax required time to atomic commits from 1 vblank to 2 vblanks.

Reference: Issues seen on BYT CI tests

Cc Maarten Lankhorst <[email protected]>
---
 tests/kms_plane_multiple.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
tests/kms_plane_multiple.c +5 -4
index 792f530..6257a8b 100644
@@ -235,7 +235,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
 	test_position_t test = { .data = data };
 	color_t blue  = { 0.0f, 0.0f, 1.0f };
 	igt_crc_t *crc = NULL;
-	unsigned int vblank_start;
+	unsigned int vblank_start, vblank_stop;
 	int i, n, ret;
 	int iterations = opt.iterations < 1 ? 1 : opt.iterations;
 	bool loop_forever;
@@ -274,13 +274,14 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
 		ret = read(data->display.drm_fd, buf, sizeof(buf));
 		igt_assert(ret >= 0);
 
-		igt_assert_eq(get_vblank(data->display.drm_fd, pipe, 0), vblank_start + 1);
+		vblank_stop = get_vblank(data->display.drm_fd, pipe, 0);
 		igt_assert_eq(e->type, DRM_EVENT_FLIP_COMPLETE);
 		igt_reset_timeout();
 
-		n = igt_pipe_crc_get_crcs(data->pipe_crc, MAX_CRCS, &crc);
+		n = igt_pipe_crc_get_crcs(data->pipe_crc, vblank_stop - vblank_start, &crc);
 
-		igt_assert_eq(n, MAX_CRCS);
+		igt_assert(vblank_stop - vblank_start <= MAX_CRCS);
+		igt_assert_eq(n, vblank_stop - vblank_start);
 
 		igt_assert_crc_equal(&test.reference_crc, crc);
 
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Re: [PATCH i-g-t 1/2] tests/kms_plane_multiple: Relax atomic commit time requirement

Op 16-01-17 om 14:09 schreef Mika Kahola:

Quoted 30 lines

Relax required time to atomic commits from 1 vblank to 2 vblanks.

Reference: Issues seen on BYT CI tests

Cc Maarten Lankhorst <[email protected]>
---
 tests/kms_plane_multiple.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
tests/kms_plane_multiple.c +2 -2
index 792f530..6257a8b 100644
@@ -235,7 +235,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
 	test_position_t test = { .data = data };
 	color_t blue  = { 0.0f, 0.0f, 1.0f };
 	igt_crc_t *crc = NULL;
-	unsigned int vblank_start;
+	unsigned int vblank_start, vblank_stop;
 	int i, n, ret;
 	int iterations = opt.iterations < 1 ? 1 : opt.iterations;
 	bool loop_forever;
@@ -274,13 +274,14 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
 		ret = read(data->display.drm_fd, buf, sizeof(buf));
 		igt_assert(ret >= 0);
 
-		igt_assert_eq(get_vblank(data->display.drm_fd, pipe, 0), vblank_start + 1);
+		vblank_stop = get_vblank(data->display.drm_fd, pipe, 0);

tests/kms_plane_multiple.c test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, · line 285

Quoted 10 lines
tests/kms_plane_multiple.c +3 -2
 		igt_assert_eq(e->type, DRM_EVENT_FLIP_COMPLETE);
 		igt_reset_timeout();
 
-		n = igt_pipe_crc_get_crcs(data->pipe_crc, MAX_CRCS, &crc);
+		n = igt_pipe_crc_get_crcs(data->pipe_crc, vblank_stop - vblank_start, &crc);
 
-		igt_assert_eq(n, MAX_CRCS);
+		igt_assert(vblank_stop - vblank_start <= MAX_CRCS);
+		igt_assert_eq(n, vblank_stop - vblank_start);
 

Isn't MAX_CRCS 1? I don't see how this would relax anything then.

~Maarten
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Re: [PATCH i-g-t 1/2] tests/kms_plane_multiple: Relax atomic commit time requirement

Quoted 44 lines · Maarten Lankhorst

Op 16-01-17 om 14:09 schreef Mika Kahola:

Quoted 43 lines

Relax required time to atomic commits from 1 vblank to 2 vblanks.

Reference: Issues seen on BYT CI tests

Cc Maarten Lankhorst <[email protected]>

---
 tests/kms_plane_multiple.c | 9 +++++----

 1 file changed, 5 insertions(+), 4 deletions(-)
tests/kms_plane_multiple.c +1 -1
index 792f530..6257a8b 100644
@@ -235,7 +235,7 @@ test_atomic_plane_position_with_output(data_t
 *data, enum pipe pipe,
  	test_position_t test = { .data = data };
  	color_t blue  = { 0.0f, 0.0f, 1.0f };
  	igt_crc_t *crc = NULL;
-	unsigned int vblank_start;
+	unsigned int vblank_start, vblank_stop;
  	int i, n, ret;
  	int iterations = opt.iterations < 1 ? 1 : opt.iterations;

  bool loop_forever;

tests/kms_plane_multiple.c +0 -0
@@ -274,13 +274,14 @@ test_atomic_plane_position_with_output(data_t
 *data, enum pipe pipe,
  		ret = read(data->display.drm_fd, buf,
 sizeof(buf));
  		igt_assert(ret >= 0);

tests/kms_plane_multiple.c +0 -1
-		igt_assert_eq(get_vblank(data->display.drm_fd,

pipe, 0), vblank_start + 1);

tests/kms_plane_multiple.c +1 -0
+		vblank_stop = get_vblank(data->display.drm_fd,

pipe, 0);
  igt_assert_eq(e->type, DRM_EVENT_FLIP_COMPLETE); igt_reset_timeout();

tests/kms_plane_multiple.c +0 -1
-		n = igt_pipe_crc_get_crcs(data->pipe_crc,

MAX_CRCS, &crc);

tests/kms_plane_multiple.c +1 -0
+		n = igt_pipe_crc_get_crcs(data->pipe_crc,
Quoted 8 lines
Quoted 7 lines

vblank_stop - vblank_start, &crc);

tests/kms_plane_multiple.c +1 -1
-		igt_assert_eq(n, MAX_CRCS);
+		igt_assert(vblank_stop - vblank_start <=

MAX_CRCS);

tests/kms_plane_multiple.c +1 -0
+		igt_assert_eq(n, vblank_stop - vblank_start);

Isn't MAX_CRCS 1? I don't see how this would relax anything then.

True. I missed to increase MAX_CRCS. Update follows..

Quoted 2 lines

~Maarten

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

PATCH 2/2 tests/kms_plane_multiple: Cleanup in favor of library functions

In reply to Mika Kahola

Cleaunup by replacing get_vblank() function with library function kmstest_get_vblank().

Cc Maarten Lankhorst <[email protected]>
---
 tests/kms_plane_multiple.c | 27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)
tests/kms_plane_multiple.c +3 -24
index 6257a8b..f66f41a 100644
@@ -67,28 +67,6 @@ struct {
 	.seed = 1,
 };
 
-static inline uint32_t pipe_select(int pipe)
-{
-	if (pipe > 1)
-		return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT;
-	else if (pipe > 0)
-		return DRM_VBLANK_SECONDARY;
-	else
-		return 0;
-}
-
-static unsigned int get_vblank(int fd, int pipe, unsigned int flags)
-{
-	union drm_wait_vblank vbl;
-
-	memset(&vbl, 0, sizeof(vbl));
-	vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe) | flags;
-	if (drmIoctl(fd, DRM_IOCTL_WAIT_VBLANK, &vbl))
-		return 0;
-
-	return vbl.reply.sequence;
-}
-
 /*
  * Common code across all tests, acting on data_t
  */
@@ -263,7 +241,8 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
 	while (i < iterations || loop_forever) {
 		prepare_planes(data, pipe, &blue, tiling, max_planes, output);
 
-		vblank_start = get_vblank(data->display.drm_fd, pipe, DRM_VBLANK_NEXTONMISS);
+		vblank_start = kmstest_get_vblank(data->display.drm_fd, pipe,
+						  DRM_VBLANK_NEXTONMISS);
 
 		igt_display_commit_atomic(&data->display,
 					  DRM_MODE_PAGE_FLIP_EVENT,
@@ -274,7 +253,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
 		ret = read(data->display.drm_fd, buf, sizeof(buf));
 		igt_assert(ret >= 0);
 
-		vblank_stop = get_vblank(data->display.drm_fd, pipe, 0);
+		vblank_stop = kmstest_get_vblank(data->display.drm_fd, pipe, 0);
 		igt_assert_eq(e->type, DRM_EVENT_FLIP_COMPLETE);
 		igt_reset_timeout();
 
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/2
#5 lore raw

Re: [PATCH i-g-t 2/2] tests/kms_plane_multiple: Cleanup in favor of library functions

Op 16-01-17 om 14:09 schreef Mika Kahola:

Quoted 54 lines

Cleaunup by replacing get_vblank() function with library function kmstest_get_vblank().

Cc Maarten Lankhorst <[email protected]>
---
 tests/kms_plane_multiple.c | 27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)
tests/kms_plane_multiple.c +2 -23
index 6257a8b..f66f41a 100644
@@ -67,28 +67,6 @@ struct {
 	.seed = 1,
 };
 
-static inline uint32_t pipe_select(int pipe)
-{
-	if (pipe > 1)
-		return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT;
-	else if (pipe > 0)
-		return DRM_VBLANK_SECONDARY;
-	else
-		return 0;
-}
-
-static unsigned int get_vblank(int fd, int pipe, unsigned int flags)
-{
-	union drm_wait_vblank vbl;
-
-	memset(&vbl, 0, sizeof(vbl));
-	vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe) | flags;
-	if (drmIoctl(fd, DRM_IOCTL_WAIT_VBLANK, &vbl))
-		return 0;
-
-	return vbl.reply.sequence;
-}
-
 /*
  * Common code across all tests, acting on data_t
  */
@@ -263,7 +241,8 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
 	while (i < iterations || loop_forever) {
 		prepare_planes(data, pipe, &blue, tiling, max_planes, output);
 
-		vblank_start = get_vblank(data->display.drm_fd, pipe, DRM_VBLANK_NEXTONMISS);
+		vblank_start = kmstest_get_vblank(data->display.drm_fd, pipe,
+						  DRM_VBLANK_NEXTONMISS);
 
 		igt_display_commit_atomic(&data->display,
 					  DRM_MODE_PAGE_FLIP_EVENT,

tests/kms_plane_multiple.c test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, · line 259

Quoted 8 lines
tests/kms_plane_multiple.c +1 -1
@@ -274,7 +253,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe,
 		ret = read(data->display.drm_fd, buf, sizeof(buf));
 		igt_assert(ret >= 0);
 
-		vblank_stop = get_vblank(data->display.drm_fd, pipe, 0);
+		vblank_stop = kmstest_get_vblank(data->display.drm_fd, pipe, 0);
 		igt_assert_eq(e->type, DRM_EVENT_FLIP_COMPLETE);
 		igt_reset_timeout();
 

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx