All of lore.kernel.org
 help / color / mirror / Atom feed
From: "José Expósito" <jose.exposito89@gmail.com>
To: David Gow <davidgow@google.com>
Cc: "Javier Martinez Canillas" <javierm@redhat.com>,
	"Daniel Latypov" <dlatypov@google.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"David Airlie" <airlied@linux.ie>,
	maarten.lankhorst@linux.intel.com,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Maíra Canal" <maira.canal@usp.br>,
	"Isabella Basso" <isabbasso@riseup.net>,
	magalilemes00@gmail.com, tales.aparecida@gmail.com,
	dri-devel@lists.freedesktop.org,
	"KUnit Development" <kunit-dev@googlegroups.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/4] KUnit tests for RGB565 conversion
Date: Sun, 3 Jul 2022 17:19:26 +0200	[thread overview]
Message-ID: <20220703151926.GA130430@elementary> (raw)
In-Reply-To: <CABVgOSmC6WJxMo58VH0WSD7wdLn7_TmTktm=6txrn0ECXCNJZQ@mail.gmail.com>

Hi David,

Sorry for not getting back to you sooner, I've been swamped with work
this week.

On Wed, Jun 29, 2022 at 03:27:44PM +0800, David Gow wrote:
> These look pretty good overall to me, but there is one big issue
> (which is actually with the previous series -- oops!), and a few small
> stylistic thoughts.
> 
> For the big issue: these tests don't work on big-endian systems. The
> 'swab' bit in this series reminded me to check, and sure enough, all
> of the tests fail (including the rgb332 ones).
> 
> I tested it on PowerPC with:
>  ./tools/testing/kunit/kunit.py run
> --kunitconfig=drivers/gpu/drm/tests --arch=powerpc
> --cross_compile=powerpc64-linux-gnu-
> 
> So that's something which needs to be fixed.

Oops, yes, definitely something that I need to fix!
I'll include an extra patch at the beginning of v2 fixing this bug.

> The smaller stylistic thoughts basically all revolve around the
> complexity of convert_xrgb8888_cases: there are arrays of structs with
> arrays of unions of structs (with function pointers in them). This
> isn't a problem: it's actually a lot more readable than that
> description implies, but there are other ways it could be tackled
> (which have their own tradeoffs, of course).
> 
> One possibility would be to split up the test into a separate test per
> destination format. They could reuse the convert_xrgb8888_cases array,
> and just each access a different result. You could make things even
> clearer (IMO) by replacing the results[] array with a separate, named,
> member (since you don't need to iterate over them any more), and
> remove the need to have the function pointer and swab union/members by
> just hardcoding those in the separate test functions. It'd also make
> the results a bit clearer, as each destination format would get its
> own separate set of results.
> 
> Of course, that's just an idea: I don't actually have a problem with
> the existing design either (other than the endianness issue, of
> course).

I like from your approach that the output of the tests would be easier
to understand. At the moment, if a test fails, there is not enough
context to know which target format failed. I'll explore this approach
and see how it looks like.

Thanks,
Jose

> Cheers,
> -- David



WARNING: multiple messages have this Message-ID (diff)
From: "José Expósito" <jose.exposito89@gmail.com>
To: David Gow <davidgow@google.com>
Cc: dri-devel@lists.freedesktop.org,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	magalilemes00@gmail.com, "David Airlie" <airlied@linux.ie>,
	"Maíra Canal" <maira.canal@usp.br>,
	"Daniel Latypov" <dlatypov@google.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	tales.aparecida@gmail.com,
	"Isabella Basso" <isabbasso@riseup.net>,
	"KUnit Development" <kunit-dev@googlegroups.com>
Subject: Re: [PATCH 0/4] KUnit tests for RGB565 conversion
Date: Sun, 3 Jul 2022 17:19:26 +0200	[thread overview]
Message-ID: <20220703151926.GA130430@elementary> (raw)
In-Reply-To: <CABVgOSmC6WJxMo58VH0WSD7wdLn7_TmTktm=6txrn0ECXCNJZQ@mail.gmail.com>

Hi David,

Sorry for not getting back to you sooner, I've been swamped with work
this week.

On Wed, Jun 29, 2022 at 03:27:44PM +0800, David Gow wrote:
> These look pretty good overall to me, but there is one big issue
> (which is actually with the previous series -- oops!), and a few small
> stylistic thoughts.
> 
> For the big issue: these tests don't work on big-endian systems. The
> 'swab' bit in this series reminded me to check, and sure enough, all
> of the tests fail (including the rgb332 ones).
> 
> I tested it on PowerPC with:
>  ./tools/testing/kunit/kunit.py run
> --kunitconfig=drivers/gpu/drm/tests --arch=powerpc
> --cross_compile=powerpc64-linux-gnu-
> 
> So that's something which needs to be fixed.

Oops, yes, definitely something that I need to fix!
I'll include an extra patch at the beginning of v2 fixing this bug.

> The smaller stylistic thoughts basically all revolve around the
> complexity of convert_xrgb8888_cases: there are arrays of structs with
> arrays of unions of structs (with function pointers in them). This
> isn't a problem: it's actually a lot more readable than that
> description implies, but there are other ways it could be tackled
> (which have their own tradeoffs, of course).
> 
> One possibility would be to split up the test into a separate test per
> destination format. They could reuse the convert_xrgb8888_cases array,
> and just each access a different result. You could make things even
> clearer (IMO) by replacing the results[] array with a separate, named,
> member (since you don't need to iterate over them any more), and
> remove the need to have the function pointer and swab union/members by
> just hardcoding those in the separate test functions. It'd also make
> the results a bit clearer, as each destination format would get its
> own separate set of results.
> 
> Of course, that's just an idea: I don't actually have a problem with
> the existing design either (other than the endianness issue, of
> course).

I like from your approach that the output of the tests would be easier
to understand. At the moment, if a test fails, there is not enough
context to know which target format failed. I'll explore this approach
and see how it looks like.

Thanks,
Jose

> Cheers,
> -- David



  reply	other threads:[~2022-07-03 15:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 16:11 [PATCH 0/4] KUnit tests for RGB565 conversion José Expósito
2022-06-27 16:11 ` José Expósito
2022-06-27 16:11 ` [PATCH 1/4] drm/format-helper: Rename test cases to make them more generic José Expósito
2022-06-27 16:11   ` José Expósito
2022-06-27 16:11 ` [PATCH 2/4] drm/format-helper: Transform tests to be agnostic of target format José Expósito
2022-06-27 16:11   ` José Expósito
2022-06-27 16:11 ` [PATCH 3/4] drm/format-helper: Add support for conversion functions with swab José Expósito
2022-06-27 16:11   ` José Expósito
2022-06-27 16:11 ` [PATCH 4/4] drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb565() José Expósito
2022-06-27 16:11   ` José Expósito
2022-06-29  7:34   ` Thomas Zimmermann
2022-06-29  7:34     ` Thomas Zimmermann
2022-06-28 18:47 ` [PATCH 0/4] KUnit tests for RGB565 conversion Tales
2022-06-28 18:47   ` Tales
2022-06-29  7:27 ` David Gow
2022-06-29  7:27   ` David Gow
2022-07-03 15:19   ` José Expósito [this message]
2022-07-03 15:19     ` José Expósito
2022-06-29  7:37 ` Thomas Zimmermann
2022-06-29  7:37   ` Thomas Zimmermann

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=20220703151926.GA130430@elementary \
    --to=jose.exposito89@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=isabbasso@riseup.net \
    --cc=jani.nikula@linux.intel.com \
    --cc=javierm@redhat.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=magalilemes00@gmail.com \
    --cc=maira.canal@usp.br \
    --cc=mripard@kernel.org \
    --cc=tales.aparecida@gmail.com \
    --cc=tzimmermann@suse.de \
    /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.