From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.bootlin.com (mail.bootlin.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 29A586F37E for ; Fri, 14 Dec 2018 09:00:14 +0000 (UTC) Date: Fri, 14 Dec 2018 10:00:02 +0100 From: Maxime Ripard Message-ID: <20181214090002.c6orqpu47lfjgez6@flea> References: <20181213155533.18048-1-paul.kocialkowski@bootlin.com> <20181213155533.18048-3-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 In-Reply-To: <20181213155533.18048-3-paul.kocialkowski@bootlin.com> Subject: Re: [igt-dev] [PATCH i-g-t v2 02/12] chamelium: Pass the pattern block size as argument to helpers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============2129411554==" Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Paul Kocialkowski Cc: Petri Latvala , Eben Upton , igt-dev@lists.freedesktop.org, Boris Brezillon , Thomas Petazzoni List-ID: --===============2129411554== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2mjdjpv2u5mektnu" Content-Disposition: inline --2mjdjpv2u5mektnu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2018 at 04:55:23PM +0100, Paul Kocialkowski wrote: > This adds a new block size argument to the pattern generation helpers so > that different sizes of blocks can be used. >=20 > In the future, this allows us to use different block sizes when testing > overlay planes, making it visually explicit what is part of the main > plane and what is part of the overlay plane. >=20 > Signed-off-by: Paul Kocialkowski > Reviewed-by: Lyude Paul > --- > tests/kms_chamelium.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) >=20 > diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c > index b8cab9275bec..7d95a8bc52f3 100644 > --- a/tests/kms_chamelium.c > +++ b/tests/kms_chamelium.c > @@ -490,7 +490,7 @@ enable_output(data_t *data, > =20 > static void chamelium_paint_xr24_pattern(uint32_t *data, > size_t width, size_t height, > - size_t stride) > + size_t stride, size_t block_size) > { > uint32_t colors[] =3D { 0xff000000, > 0xffff0000, > @@ -501,11 +501,12 @@ static void chamelium_paint_xr24_pattern(uint32_t *= data, > =20 > for (i =3D 0; i < height; i++) > for (j =3D 0; j < width; j++) > - *(data + i * stride / 4 + j) =3D colors[((j / 64) + (i / 64)) % 5]; > + *(data + i * stride / 4 + j) =3D colors[((j / block_size) + (i / bloc= k_size)) % 5]; That line really doesn't fit on 80 characters anymore. I guess you could split the pointer arithmetic to a new line. Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --2mjdjpv2u5mektnu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXBNxEgAKCRDj7w1vZxhR xXmTAP9ncsp/jdIXOa2+ajtU5BnQ1eaFPr9pV3DChmZGy0lDHAEA63DNoWiZb5AK IJsgEfb1R10b+TihjkR+GY8oajUcfAU= =nzOb -----END PGP SIGNATURE----- --2mjdjpv2u5mektnu-- --===============2129411554== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KaWd0LWRldiBt YWlsaW5nIGxpc3QKaWd0LWRldkBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pZ3QtZGV2Cg== --===============2129411554==--