From: Thomas Zimmermann <tzimmermann@suse.de>
To: "José Expósito" <jose.exposito89@gmail.com>, javierm@redhat.com
Cc: magalilemes00@gmail.com, airlied@linux.ie, maira.canal@usp.br,
dlatypov@google.com, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, davidgow@google.com,
tales.aparecida@gmail.com, isabbasso@riseup.net,
kunit-dev@googlegroups.com
Subject: Re: [PATCH 4/4] drm/format-helper: Add KUnit tests for drm_fb_xrgb8888_to_rgb565()
Date: Wed, 29 Jun 2022 09:34:26 +0200 [thread overview]
Message-ID: <26ad3117-8cf4-012e-9c72-e08f03803aa4@suse.de> (raw)
In-Reply-To: <20220627161132.33256-5-jose.exposito89@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 4930 bytes --]
Hi
Am 27.06.22 um 18:11 schrieb José Expósito:
> Extend the existing test cases to test the conversion from XRGB8888 to
> RGB565.
>
> The documentation and the color picker available on [1] are useful
> resources to understand this patch and validate the values returned by
> the conversion function.
>
> [1] http://www.barth-dev.de/online/rgb565-color-picker/
URLs in commit messages are usually given as Link tag like this:
Link: http://www.barth-dev.de/online/rgb565-color-picker/ # [1]
Put this somewhere below your signed-off-by tag.
Best regards
Thomas
>
> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
> ---
> .../gpu/drm/tests/drm_format_helper_test.c | 100 +++++++++++++++++-
> 1 file changed, 99 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/tests/drm_format_helper_test.c b/drivers/gpu/drm/tests/drm_format_helper_test.c
> index 52dc41cc7c60..3fbe8026bccc 100644
> --- a/drivers/gpu/drm/tests/drm_format_helper_test.c
> +++ b/drivers/gpu/drm/tests/drm_format_helper_test.c
> @@ -48,7 +48,7 @@ struct convert_xrgb8888_case {
> unsigned int pitch;
> struct drm_rect clip;
> const u32 xrgb8888[TEST_BUF_SIZE];
> - struct convert_xrgb8888_result results[1];
> + struct convert_xrgb8888_result results[3];
> };
>
> static struct convert_xrgb8888_case convert_xrgb8888_cases[] = {
> @@ -64,6 +64,26 @@ static struct convert_xrgb8888_case convert_xrgb8888_cases[] = {
> .dst_pitch = 0,
> .expected = { 0xE0 },
> },
> + {
> + .dst_format = DRM_FORMAT_RGB565,
> + .has_swab = true,
> + .conv_swab = {
> + .func = drm_fb_xrgb8888_to_rgb565,
> + .swab = false,
> + },
> + .dst_pitch = 0,
> + .expected = { 0x00, 0xF8 },
> + },
> + {
> + .dst_format = DRM_FORMAT_RGB565,
> + .has_swab = true,
> + .conv_swab = {
> + .func = drm_fb_xrgb8888_to_rgb565,
> + .swab = true,
> + },
> + .dst_pitch = 0,
> + .expected = { 0xF8, 0x00 },
> + },
> },
> },
> {
> @@ -81,6 +101,26 @@ static struct convert_xrgb8888_case convert_xrgb8888_cases[] = {
> .dst_pitch = 0,
> .expected = { 0xE0 },
> },
> + {
> + .dst_format = DRM_FORMAT_RGB565,
> + .has_swab = true,
> + .conv_swab = {
> + .func = drm_fb_xrgb8888_to_rgb565,
> + .swab = false,
> + },
> + .dst_pitch = 0,
> + .expected = { 0x00, 0xF8 },
> + },
> + {
> + .dst_format = DRM_FORMAT_RGB565,
> + .has_swab = true,
> + .conv_swab = {
> + .func = drm_fb_xrgb8888_to_rgb565,
> + .swab = true,
> + },
> + .dst_pitch = 0,
> + .expected = { 0xF8, 0x00 },
> + },
> },
> },
> {
> @@ -110,6 +150,36 @@ static struct convert_xrgb8888_case convert_xrgb8888_cases[] = {
> 0xFC, 0x1F,
> },
> },
> + {
> + .dst_format = DRM_FORMAT_RGB565,
> + .has_swab = true,
> + .conv_swab = {
> + .func = drm_fb_xrgb8888_to_rgb565,
> + .swab = false,
> + },
> + .dst_pitch = 0,
> + .expected = {
> + 0xFF, 0xFF, 0x00, 0x00,
> + 0x00, 0xF8, 0xE0, 0x07,
> + 0x1F, 0x00, 0x1F, 0xF8,
> + 0xE0, 0xFF, 0xFF, 0x07,
> + },
> + },
> + {
> + .dst_format = DRM_FORMAT_RGB565,
> + .has_swab = true,
> + .conv_swab = {
> + .func = drm_fb_xrgb8888_to_rgb565,
> + .swab = true,
> + },
> + .dst_pitch = 0,
> + .expected = {
> + 0xFF, 0xFF, 0x00, 0x00,
> + 0xF8, 0x00, 0x07, 0xE0,
> + 0x00, 0x1F, 0xF8, 0x1F,
> + 0xFF, 0xE0, 0x07, 0xFF,
> + },
> + },
> },
> },
> {
> @@ -133,6 +203,34 @@ static struct convert_xrgb8888_case convert_xrgb8888_cases[] = {
> 0xA0, 0x6D, 0x0A, 0x00, 0x00,
> },
> },
> + {
> + .dst_format = DRM_FORMAT_RGB565,
> + .has_swab = true,
> + .conv_swab = {
> + .func = drm_fb_xrgb8888_to_rgb565,
> + .swab = false,
> + },
> + .dst_pitch = 10,
> + .expected = {
> + 0x33, 0x0A, 0x60, 0x12, 0x00, 0xA8, 0x00, 0x00, 0x00, 0x00,
> + 0x8E, 0x6B, 0x33, 0x0A, 0x60, 0x12, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0xA8, 0x8E, 0x6B, 0x33, 0x0A, 0x00, 0x00, 0x00, 0x00,
> + },
> + },
> + {
> + .dst_format = DRM_FORMAT_RGB565,
> + .has_swab = true,
> + .conv_swab = {
> + .func = drm_fb_xrgb8888_to_rgb565,
> + .swab = true,
> + },
> + .dst_pitch = 10,
> + .expected = {
> + 0x0A, 0x33, 0x12, 0x60, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x6B, 0x8E, 0x0A, 0x33, 0x12, 0x60, 0x00, 0x00, 0x00, 0x00,
> + 0xA8, 0x00, 0x6B, 0x8E, 0x0A, 0x33, 0x00, 0x00, 0x00, 0x00,
> + },
> + },
> },
> },
> };
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2022-06-29 7:34 UTC|newest]
Thread overview: 10+ 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 ` [PATCH 1/4] drm/format-helper: Rename test cases to make them more generic 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 ` [PATCH 3/4] drm/format-helper: Add support for conversion functions with swab 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-29 7:34 ` Thomas Zimmermann [this message]
2022-06-28 18:47 ` [PATCH 0/4] KUnit tests for RGB565 conversion Tales
2022-06-29 7:27 ` David Gow
2022-07-03 15:19 ` José Expósito
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=26ad3117-8cf4-012e-9c72-e08f03803aa4@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@linux.ie \
--cc=davidgow@google.com \
--cc=dlatypov@google.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=isabbasso@riseup.net \
--cc=javierm@redhat.com \
--cc=jose.exposito89@gmail.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=magalilemes00@gmail.com \
--cc=maira.canal@usp.br \
--cc=tales.aparecida@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).