[igt-dev] [PATCH i-g-t 2/2] tests/kms_plane_alpha_blend: Fix rounding in draw_squares

Vidya Srinivas vidya.srinivas at intel.com
Wed Aug 4 02:56:37 UTC 2021


Patch fixes a rounding issue in draw_squares. Due to this,
coverage-premultiplied-constant subtest gives CRC
mismatch on panels with 1366x768 resolution.

Signed-off-by: Juha-Pekka Heikkilä <juha-pekka.heikkila at intel.com>
---
 tests/kms_plane_alpha_blend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/kms_plane_alpha_blend.c b/tests/kms_plane_alpha_blend.c
index 8616169e7ca2..b4cf039bd914 100644
--- a/tests/kms_plane_alpha_blend.c
+++ b/tests/kms_plane_alpha_blend.c
@@ -88,7 +88,7 @@ static void draw_squares(struct igt_fb *fb, int w, int h, double a)
 	igt_paint_color_alpha(cr, w / 2, 0,     w / 2, h / 2, 0., 1., 0., a);
 	igt_paint_color_alpha(cr, 0, h / 2,     w / 2, h / 2, 0., 0., 1., a);
 	igt_paint_color_alpha(cr, w / 2, h / 2, w / 4, h / 2, 1., 1., 1., a);
-	igt_paint_color_alpha(cr, 3 * w / 4, h / 2, w / 4, h / 2, 0., 0., 0., a);
+	igt_paint_color_alpha(cr, w * 3 / 4, h / 2, w - (w * 3 / 4), h / 2, 0., 0., 0., a);
 
 	igt_put_cairo_ctx(cr);
 }
-- 
2.32.0



More information about the igt-dev mailing list