public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation: align rendered image correctly for rotation
@ 2018-12-21 14:05 Juha-Pekka Heikkila
  2018-12-21 14:05 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_rotation_crc: add NV12 support for multiplane* tests Juha-Pekka Heikkila
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Juha-Pekka Heikkila @ 2018-12-21 14:05 UTC (permalink / raw)
  To: igt-dev

rendered test image had off-by-one error in size calculation
which was failing some tests on certain resolutions and plane
sizes.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index c67f608..796115a 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -126,6 +126,9 @@ paint_squares(data_t *data, igt_rotation_t rotation,
 	unsigned int h = fb->height;
 	rgb_color_t tl, tr, bl, br;
 
+	igt_assert_f(!(w&1), "rotation image must be even width, now attempted %d\n", w);
+	igt_assert_f(!(h&1), "rotation image must be even height, now attempted %d\n", h);
+
 	cr = igt_get_cairo_ctx(data->gfx_fd, fb);
 
 	set_color(&tl, o, 0.0f, 0.0f);
@@ -439,8 +442,12 @@ static void get_multiplane_crc(data_t *data, igt_output_t *output,
 		planes[c].plane = igt_output_get_plane_type(output,
 							    planeinfo[c].planetype);
 
-		w = planeinfo[c].width;
-		h = planeinfo[c].height;
+		/*
+		 * make plane and fb width and height always even due to
+		 * test image rendering
+		 */
+		w = planeinfo[c].width & ~1;
+		h = planeinfo[c].height & ~1;
 
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
-- 
2.7.4

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation: align rendered image correctly for rotation
@ 2018-12-28  9:29 Juha-Pekka Heikkila
  2018-12-28 10:00 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] " Patchwork
  0 siblings, 1 reply; 7+ messages in thread
From: Juha-Pekka Heikkila @ 2018-12-28  9:29 UTC (permalink / raw)
  To: igt-dev

rendered test image had off-by-one error in size calculation
which was failing some tests on certain resolutions and plane
sizes.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index c67f608..796115a 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -126,6 +126,9 @@ paint_squares(data_t *data, igt_rotation_t rotation,
 	unsigned int h = fb->height;
 	rgb_color_t tl, tr, bl, br;
 
+	igt_assert_f(!(w&1), "rotation image must be even width, now attempted %d\n", w);
+	igt_assert_f(!(h&1), "rotation image must be even height, now attempted %d\n", h);
+
 	cr = igt_get_cairo_ctx(data->gfx_fd, fb);
 
 	set_color(&tl, o, 0.0f, 0.0f);
@@ -439,8 +442,12 @@ static void get_multiplane_crc(data_t *data, igt_output_t *output,
 		planes[c].plane = igt_output_get_plane_type(output,
 							    planeinfo[c].planetype);
 
-		w = planeinfo[c].width;
-		h = planeinfo[c].height;
+		/*
+		 * make plane and fb width and height always even due to
+		 * test image rendering
+		 */
+		w = planeinfo[c].width & ~1;
+		h = planeinfo[c].height & ~1;
 
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
-- 
2.7.4

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-12-28 10:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-21 14:05 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation: align rendered image correctly for rotation Juha-Pekka Heikkila
2018-12-21 14:05 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_rotation_crc: add NV12 support for multiplane* tests Juha-Pekka Heikkila
2018-12-21 14:52 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_rotation: align rendered image correctly for rotation Patchwork
2018-12-21 22:01 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-12-27  8:00 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_rotation: align rendered image correctly for rotation (rev2) Patchwork
2018-12-27  8:51 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2018-12-28  9:29 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation: align rendered image correctly for rotation Juha-Pekka Heikkila
2018-12-28 10:00 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox