All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@bootlin.com>
To: igt-dev@lists.freedesktop.org
Cc: Maxime Ripard <maxime.ripard@bootlin.com>,
	eben@raspberrypi.org,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [igt-dev] [PATCH v4 10/13] chamelium: Change our pattern for a custom one
Date: Thu, 26 Jul 2018 12:42:09 +0200	[thread overview]
Message-ID: <2758e622f4a05d69f984bb3439af49823f43d4fc.1532596850.git-series.maxime.ripard@bootlin.com> (raw)
In-Reply-To: <cover.85e5bbe6ef5f0fd420e1fc21fc248471b98481e5.1532596850.git-series.maxime.ripard@bootlin.com>
In-Reply-To: <cover.85e5bbe6ef5f0fd420e1fc21fc248471b98481e5.1532596850.git-series.maxime.ripard@bootlin.com>

The current pattern being used is the one generated through the
igt_create_color_pattern_fb.

However, in order to deal with multiple formats and the upsampling /
downsampling issues that might arise from converting back and forth between
formats, we will need to have a pattern with quite precise color values,
and without any shades or gradient of colors.

The easiest way to do that will be to only use values that would have the
same part on the common most significant bits (5, to deal with the most
formats) and have the same bit repeated on the least significant bits that
are going to be dropped and / or padded when converting between formats.

Pixman will fill the lowest bits with 1, and our hardware is able to
support that, so the easiest is to just use all 1's for our components in
order to still be able to compute the CRCs.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 tests/kms_chamelium.c | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index f14e3ebb4b87..4f4984b51b41 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -486,15 +486,40 @@ enable_output(data_t *data,
 	drmModeFreeConnector(connector);
 }
 
+static void chamelium_paint_xr24_pattern(uint32_t *data,
+					 size_t width, size_t height)
+{
+	uint32_t colors[] = { 0xff000000,
+			      0xffff0000,
+			      0xff00ff00,
+			      0xff0000ff,
+			      0xffffffff };
+	unsigned i, j;
+
+	for (i = 0; i < height; i++)
+		for (j = 0; j < width; j++)
+			*(data + i * width + j) = colors[((j / 64) + (i / 64)) % 5];
+}
+
 static int chamelium_get_pattern_fb(data_t *data, drmModeModeInfo *mode,
 				    uint32_t fourcc, struct igt_fb *fb)
 {
+	int fb_id;
+	void *ptr;
+
 	igt_assert(fourcc == DRM_FORMAT_XRGB8888);
 
-	return igt_create_color_pattern_fb(data->drm_fd, mode->hdisplay,
-					   mode->vdisplay, fourcc,
-					   LOCAL_DRM_FORMAT_MOD_NONE,
-					   0, 0, 0, fb);
+	fb_id = igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+			      fourcc, LOCAL_DRM_FORMAT_MOD_NONE, fb);
+	igt_assert(fb_id > 0);
+
+	ptr = igt_fb_map_buffer(fb->fd, fb);
+	igt_assert(ptr);
+
+	chamelium_paint_xr24_pattern(ptr, mode->vdisplay, mode->hdisplay);
+	igt_fb_unmap_buffer(fb, ptr);
+
+	return fb_id;
 }
 
 static void do_test_display_crc(data_t *data, struct chamelium_port *port,
-- 
git-series 0.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2018-07-26 10:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 10:41 [igt-dev] [PATCH v4 00/13] chamelium: Test the plane formats Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 01/13] fb: Add buffer map/unmap functions Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 02/13] fb: convert: Remove swizzle from the arguments Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 03/13] fb: Create common function to convert frame formats Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 04/13] fb: Add format conversion routine Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 05/13] fb: Add support for conversions through pixman Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 06/13] fb: Add more formats Maxime Ripard
2018-08-09 21:25   ` Eric Anholt
2018-07-26 10:42 ` [igt-dev] [PATCH v4 07/13] chamelium: Split CRC test function in two Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 08/13] chamelium: Use preferred mode when testing a single mode Maxime Ripard
2018-08-09 21:28   ` Eric Anholt
2018-08-23 11:46     ` Maxime Ripard
2018-08-23 15:17   ` Ville Syrjälä
2018-08-24  7:49     ` Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 09/13] chamelium: Add function to generate our test pattern Maxime Ripard
2018-07-26 10:42 ` Maxime Ripard [this message]
2018-08-09 21:31   ` [igt-dev] [PATCH v4 10/13] chamelium: Change our pattern for a custom one Eric Anholt
2018-08-24  7:59     ` Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 11/13] chamelium: Add format support Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 12/13] chamelium: Add format subtests Maxime Ripard
2018-07-26 10:42 ` [igt-dev] [PATCH v4 13/13] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
2018-07-27  8:49 ` [igt-dev] ✗ Fi.CI.BAT: failure for chamelium: Test the plane formats (rev3) Patchwork
2018-07-27 11:32 ` Patchwork
2018-07-28 12:42 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2018-07-28 16:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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=2758e622f4a05d69f984bb3439af49823f43d4fc.1532596850.git-series.maxime.ripard@bootlin.com \
    --to=maxime.ripard@bootlin.com \
    --cc=eben@raspberrypi.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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.