summaryrefslogtreecommitdiff
path: root/tests/kms_plane.c
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2021-06-15 19:00:21 +0300
committerJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2021-06-22 11:18:17 +0300
commit8598cf551574ceed8d9f032d494c8cefe3f9fda4 (patch)
tree06c50fdeec2aa55a6a080a83ecf1b1f9521c466b /tests/kms_plane.c
parentcbd8c9d9549ebe176c99cd5cd51efb594b3879e0 (diff)
tests/kms_plane: fix rounding error
On some screen sizes with legacy hw there was possible to get rounding error on source clamping test which would incorrectly fail clamping tests. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'tests/kms_plane.c')
-rw-r--r--tests/kms_plane.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index ba419bbd..f22c045d 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -473,12 +473,19 @@ static void draw_entire_color_array(data_t *data, cairo_t *cr, uint32_t format,
const int color_amount = ARRAY_SIZE(colors_extended);
const int x = format == DRM_FORMAT_XRGB8888 ? 0 : data->crop;
+ if (format != DRM_FORMAT_XRGB8888) {
+ cairo_rectangle(cr, data->crop, data->crop,
+ fb->width - data->crop * 2,
+ fb->height - data->crop * 2);
+ }
+
+
for (int n = 0; n < color_amount; n++) {
int y = (fb->height - x * 2) * n / color_amount + x;
igt_paint_color(cr, x, y,
fb->width - x * 2,
- (fb->height - x * 2) / color_amount,
+ (fb->height - x * 2) / color_amount + 1,
colors_extended[n].red,
colors_extended[n].green,
colors_extended[n].blue);