From cf409424af808d258ccc8a4df7404208aafb54b3 Mon Sep 17 00:00:00 2001 From: "Leo (Sunpeng) Li" Date: Thu, 12 Apr 2018 17:37:24 -0400 Subject: tests/kms_color: Fill entire frame when painting rectangles Fill entire frame to avoid garbage data from being included in CRC calculations. Signed-off-by: Leo (Sunpeng) Li Acked-by: Arkadiusz Hiler --- tests/kms_color.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/kms_color.c b/tests/kms_color.c index dc4fcce2..c3126977 100644 --- a/tests/kms_color.c +++ b/tests/kms_color.c @@ -71,6 +71,7 @@ static void paint_gradient_rectangles(data_t *data, { cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, fb); int i, l = mode->hdisplay / 3; + int rows_remaining = mode->hdisplay % 3; /* Paint 3 gradient rectangles with red/green/blue between 1.0 and * 0.5. We want to avoid 0 so each max LUTs only affect their own @@ -86,6 +87,16 @@ static void paint_gradient_rectangles(data_t *data, colors[i].b); } + if (rows_remaining > 0) + igt_paint_color_gradient_range(cr, i * l, 0, rows_remaining, + mode->vdisplay, + colors[i-1].r != 0 ? 0.2 : 0, + colors[i-1].g != 0 ? 0.2 : 0, + colors[i-1].b != 0 ? 0.2 : 0, + colors[i-1].r, + colors[i-1].g, + colors[i-1].b); + igt_put_cairo_ctx(data->drm_fd, fb, cr); } @@ -96,6 +107,7 @@ static void paint_rectangles(data_t *data, { cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, fb); int i, l = mode->hdisplay / 3; + int rows_remaining = mode->hdisplay % 3; /* Paint 3 solid rectangles. */ for (i = 0 ; i < 3; i++) { @@ -103,6 +115,10 @@ static void paint_rectangles(data_t *data, colors[i].r, colors[i].g, colors[i].b); } + if (rows_remaining > 0) + igt_paint_color(cr, i * l, 0, rows_remaining, mode->vdisplay, + colors[i-1].r, colors[i-1].g, colors[i-1].b); + igt_put_cairo_ctx(data->drm_fd, fb, cr); } -- cgit v1.2.3