summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo (Sunpeng) Li <sunpeng.li@amd.com>2018-04-12 17:37:24 -0400
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2018-04-14 01:05:24 +0300
commitcf409424af808d258ccc8a4df7404208aafb54b3 (patch)
treefa5aa1a5acd9afbc64f88a533c0431da3bd4c221
parent80e4910581c7310258375a003a5de9a57ed24546 (diff)
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 <sunpeng.li@amd.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
-rw-r--r--tests/kms_color.c16
1 files changed, 16 insertions, 0 deletions
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);
}