All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 3/4] tests/kms_plane: fix rounding error
Date: Tue, 15 Jun 2021 19:00:21 +0300	[thread overview]
Message-ID: <20210615160022.31610-3-juhapekka.heikkila@gmail.com> (raw)
In-Reply-To: <20210615160022.31610-1-juhapekka.heikkila@gmail.com>

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>
---
 tests/kms_plane.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index ba419bbde..f22c045d8 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);
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2021-06-15 16:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 16:00 [igt-dev] [PATCH i-g-t 1/4] tests/kms_cursor_crc: use flipping instead of frontbuffer Juha-Pekka Heikkila
2021-06-15 16:00 ` [igt-dev] [PATCH i-g-t 2/4] tests/kms_ccs: separate ccs modifiers to separate subtests Juha-Pekka Heikkila
2021-06-18 13:20   ` Imre Deak
2021-06-15 16:00 ` Juha-Pekka Heikkila [this message]
2021-06-18  8:19   ` [igt-dev] [PATCH i-g-t 3/4] tests/kms_plane: fix rounding error Kahola, Mika
2021-06-15 16:00 ` [igt-dev] [PATCH i-g-t 4/4] tests/kms_flip_scaled_crc: parameterize test sizes and fix test to try other connectors Juha-Pekka Heikkila
2021-06-18  8:55   ` Kahola, Mika
2021-06-15 16:46 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/kms_cursor_crc: use flipping instead of frontbuffer Patchwork
2021-06-16  0:54 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-06-21  9:40 ` [igt-dev] [PATCH i-g-t 1/4] " Kahola, Mika

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210615160022.31610-3-juhapekka.heikkila@gmail.com \
    --to=juhapekka.heikkila@gmail.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.