lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <26ad3117-8cf4-012e-9c72-e08f03803aa4@suse.de>
Date:   Wed, 29 Jun 2022 09:34:26 +0200
From:   Thomas Zimmermann <tzimmermann@...e.de>
To:     José Expósito <jose.exposito89@...il.com>,
        javierm@...hat.com
Cc:     dri-devel@...ts.freedesktop.org, magalilemes00@...il.com,
        airlied@...ux.ie, maira.canal@....br, dlatypov@...gle.com,
        linux-kernel@...r.kernel.org, tales.aparecida@...il.com,
        davidgow@...gle.com, isabbasso@...eup.net,
        kunit-dev@...glegroups.com
Subject: Re: [PATCH 4/4] drm/format-helper: Add KUnit tests for
 drm_fb_xrgb8888_to_rgb565()

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@...il.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

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ