All of lore.kernel.org
 help / color / mirror / Atom feed
From: "José Expósito" <jose.exposito89@gmail.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: javierm@redhat.com, mairacanal@riseup.net,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 05/13] drm/format-helper: Type fixes in format-helper tests
Date: Fri, 23 Dec 2022 13:40:01 +0100	[thread overview]
Message-ID: <Y6WhoReJ87Zpc/I8@fedora> (raw)
In-Reply-To: <20221220161145.27568-6-tzimmermann@suse.de>

On Tue, Dec 20, 2022 at 05:11:37PM +0100, Thomas Zimmermann wrote:
> Change the source-buffer type of le32buf_to_cpu() to __le32* to
> reflect endianness. Result buffers are converted to local endianness,
> so instantiate them from regular u8 or u32 types.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

Reviewed-by: José Expósito <jose.exposito89@gmail.com>

> ---
>  drivers/gpu/drm/tests/drm_format_helper_test.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tests/drm_format_helper_test.c b/drivers/gpu/drm/tests/drm_format_helper_test.c
> index 04fe373c9d97..c2411ec808a1 100644
> --- a/drivers/gpu/drm/tests/drm_format_helper_test.c
> +++ b/drivers/gpu/drm/tests/drm_format_helper_test.c
> @@ -279,7 +279,7 @@ static u16 *le16buf_to_cpu(struct kunit *test, const __le16 *buf, size_t buf_siz
>  	return dst;
>  }
>  
> -static u32 *le32buf_to_cpu(struct kunit *test, const u32 *buf, size_t buf_size)
> +static u32 *le32buf_to_cpu(struct kunit *test, const __le32 *buf, size_t buf_size)
>  {
>  	u32 *dst = NULL;
>  	int n;
> @@ -323,7 +323,7 @@ static void drm_test_fb_xrgb8888_to_gray8(struct kunit *test)
>  	const struct convert_xrgb8888_case *params = test->param_value;
>  	const struct convert_to_gray8_result *result = &params->gray8_result;
>  	size_t dst_size;
> -	__u8 *buf = NULL;
> +	u8 *buf = NULL;
>  	__le32 *xrgb8888 = NULL;
>  	struct iosys_map dst, src;
>  
> @@ -353,7 +353,7 @@ static void drm_test_fb_xrgb8888_to_rgb332(struct kunit *test)
>  	const struct convert_xrgb8888_case *params = test->param_value;
>  	const struct convert_to_rgb332_result *result = &params->rgb332_result;
>  	size_t dst_size;
> -	__u8 *buf = NULL;
> +	u8 *buf = NULL;
>  	__le32 *xrgb8888 = NULL;
>  	struct iosys_map dst, src;
>  
> @@ -419,7 +419,7 @@ static void drm_test_fb_xrgb8888_to_rgb888(struct kunit *test)
>  	const struct convert_xrgb8888_case *params = test->param_value;
>  	const struct convert_to_rgb888_result *result = &params->rgb888_result;
>  	size_t dst_size;
> -	__u8 *buf = NULL;
> +	u8 *buf = NULL;
>  	__le32 *xrgb8888 = NULL;
>  	struct iosys_map dst, src;
>  
> @@ -453,7 +453,7 @@ static void drm_test_fb_xrgb8888_to_xrgb2101010(struct kunit *test)
>  	const struct convert_xrgb8888_case *params = test->param_value;
>  	const struct convert_to_xrgb2101010_result *result = &params->xrgb2101010_result;
>  	size_t dst_size;
> -	__u32 *buf = NULL;
> +	u32 *buf = NULL;
>  	__le32 *xrgb8888 = NULL;
>  	struct iosys_map dst, src;
>  
> @@ -475,7 +475,7 @@ static void drm_test_fb_xrgb8888_to_xrgb2101010(struct kunit *test)
>  	iosys_map_set_vaddr(&src, xrgb8888);
>  
>  	drm_fb_xrgb8888_to_xrgb2101010(&dst, &result->dst_pitch, &src, &fb, &params->clip);
> -	buf = le32buf_to_cpu(test, buf, dst_size / sizeof(u32));
> +	buf = le32buf_to_cpu(test, (__force const __le32 *)buf, dst_size / sizeof(u32));
>  	KUNIT_EXPECT_EQ(test, memcmp(buf, result->expected, dst_size), 0);
>  }
>  
> -- 
> 2.39.0
> 

  parent reply	other threads:[~2022-12-23 12:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 16:11 [PATCH v2 00/13] drm: Fix color-format selection in fbdev emulation Thomas Zimmermann
2022-12-20 16:11 ` [PATCH v2 01/13] firmware/sysfb: Fix EFI/VESA format selection Thomas Zimmermann
2022-12-20 16:11 ` [PATCH v2 02/13] drm/format-helper: Comment on RGB888 byte order Thomas Zimmermann
2022-12-21 19:30   ` Maíra Canal
2022-12-23 12:37   ` José Expósito
2022-12-20 16:11 ` [PATCH v2 03/13] drm/format-helper: Fix test-input format conversion Thomas Zimmermann
2022-12-21 19:40   ` Maíra Canal
2022-12-23 12:38   ` José Expósito
2022-12-20 16:11 ` [PATCH v2 04/13] drm/format-helper: Store RGB565 in little-endian order Thomas Zimmermann
2022-12-21 19:55   ` Maíra Canal
2022-12-23 12:39   ` José Expósito
2022-12-20 16:11 ` [PATCH v2 05/13] drm/format-helper: Type fixes in format-helper tests Thomas Zimmermann
2022-12-21 19:58   ` Maíra Canal
2022-12-23 12:40   ` José Expósito [this message]
2022-12-20 16:11 ` [PATCH v2 06/13] drm/format-helper: Flip src/dst-format branches in blit helper Thomas Zimmermann
2022-12-20 16:11 ` [PATCH v2 07/13] drm/format-helper: Add conversion from XRGB8888 to ARGB8888 Thomas Zimmermann
2022-12-21 12:37   ` kernel test robot
2022-12-21 12:37     ` kernel test robot
2022-12-21 20:07   ` Maíra Canal
2023-01-02 10:00     ` Thomas Zimmermann
2022-12-23 12:44   ` José Expósito
2023-01-02 10:01     ` Thomas Zimmermann
2022-12-20 16:11 ` [PATCH v2 08/13] drm/format-helper: Add conversion from XRGB8888 to ARGB2101010 Thomas Zimmermann
2022-12-23 12:45   ` José Expósito
2022-12-20 16:11 ` [PATCH v2 09/13] drm/format-helper: Add conversion from XRGB8888 to 15-bit RGB555 formats Thomas Zimmermann
2022-12-21 13:58   ` kernel test robot
2022-12-21 13:58     ` kernel test robot
2022-12-23 12:48   ` José Expósito
2022-12-20 16:11 ` [PATCH v2 10/13] drm/fh-helper: Split fbdev single-probe helper Thomas Zimmermann
2022-12-20 16:11 ` [PATCH v2 11/13] drm/fb-helper: Fix single-probe color-format selection Thomas Zimmermann
2022-12-20 16:11 ` [PATCH v2 12/13] drm/format-helper: Simplify drm_fb_build_fourcc_list() Thomas Zimmermann
2022-12-20 16:11 ` [PATCH v2 13/13] drm/format-helper: Remove unnecessary conversion helpers 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=Y6WhoReJ87Zpc/I8@fedora \
    --to=jose.exposito89@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=mairacanal@riseup.net \
    --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.