summaryrefslogtreecommitdiff
path: root/tests/kms_rotation_crc.c
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2018-12-13 17:42:41 +0200
committerJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2019-01-17 11:00:28 +0200
commitf162956b538cd6457d13b60c12cc0ae427246580 (patch)
tree116a5277341c26c272492ff363decc6b115b2ea8 /tests/kms_rotation_crc.c
parenta76fa4d02cc806e30ed72ba1b8233c694ab1727b (diff)
tests/kms_rotation: align rendered image correctly for rotation
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> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_rotation_crc.c')
-rw-r--r--tests/kms_rotation_crc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index c67f608e..796115ac 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);