All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/tests: fix drm_test_fb_xrgb8888_to_xrgb2101010 on big endian
@ 2024-05-22  5:44 Dave Airlie
  2024-05-23  7:44 ` Javier Martinez Canillas
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Airlie @ 2024-05-22  5:44 UTC (permalink / raw)
  To: dri-devel

From: Dave Airlie <airlied@redhat.com>

This test is failing for me on s390x and there is a report on the list from ppc64.

This aligns it with the argb test that doesn't fail.

Fixes: 15bda1f8de5d ("drm/tests: Add calls to drm_fb_blit() on supported format conversion tests")
Reported-by: Erhard Furtner <erhard_f@mailbox.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/tests/drm_format_helper_test.c | 4 +++-
 1 file changed, 3 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 08992636ec05..d4ce2d7ced4e 100644
--- a/drivers/gpu/drm/tests/drm_format_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_format_helper_test.c
@@ -991,7 +991,7 @@ static void drm_test_fb_xrgb8888_to_xrgb2101010(struct kunit *test)
 		NULL : &result->dst_pitch;
 
 	drm_fb_xrgb8888_to_xrgb2101010(&dst, dst_pitch, &src, &fb, &params->clip, &fmtcnv_state);
-	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_MEMEQ(test, buf, result->expected, dst_size);
 
 	buf = dst.vaddr; /* restore original value of buf */
@@ -1002,6 +1002,8 @@ static void drm_test_fb_xrgb8888_to_xrgb2101010(struct kunit *test)
 	blit_result = drm_fb_blit(&dst, dst_pitch, DRM_FORMAT_XRGB2101010, &src, &fb,
 				  &params->clip, &fmtcnv_state);
 
+	buf = le32buf_to_cpu(test, (__force const __le32 *)buf, dst_size / sizeof(u32));
+
 	KUNIT_EXPECT_FALSE(test, blit_result);
 	KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
 }
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/tests: fix drm_test_fb_xrgb8888_to_xrgb2101010 on big endian
  2024-05-22  5:44 [PATCH] drm/tests: fix drm_test_fb_xrgb8888_to_xrgb2101010 on big endian Dave Airlie
@ 2024-05-23  7:44 ` Javier Martinez Canillas
  0 siblings, 0 replies; 2+ messages in thread
From: Javier Martinez Canillas @ 2024-05-23  7:44 UTC (permalink / raw)
  To: Dave Airlie, dri-devel

Dave Airlie <airlied@gmail.com> writes:

Hello Dave,

> From: Dave Airlie <airlied@redhat.com>
>
> This test is failing for me on s390x and there is a report on the list from ppc64.
>
> This aligns it with the argb test that doesn't fail.
>
> Fixes: 15bda1f8de5d ("drm/tests: Add calls to drm_fb_blit() on supported format conversion tests")
> Reported-by: Erhard Furtner <erhard_f@mailbox.org>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>  drivers/gpu/drm/tests/drm_format_helper_test.c | 4 +++-
>  1 file changed, 3 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 08992636ec05..d4ce2d7ced4e 100644
> --- a/drivers/gpu/drm/tests/drm_format_helper_test.c
> +++ b/drivers/gpu/drm/tests/drm_format_helper_test.c
> @@ -991,7 +991,7 @@ static void drm_test_fb_xrgb8888_to_xrgb2101010(struct kunit *test)
>  		NULL : &result->dst_pitch;
>  
>  	drm_fb_xrgb8888_to_xrgb2101010(&dst, dst_pitch, &src, &fb, &params->clip, &fmtcnv_state);
> -	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_MEMEQ(test, buf, result->expected, dst_size);
>  
>  	buf = dst.vaddr; /* restore original value of buf */
> @@ -1002,6 +1002,8 @@ static void drm_test_fb_xrgb8888_to_xrgb2101010(struct kunit *test)
>  	blit_result = drm_fb_blit(&dst, dst_pitch, DRM_FORMAT_XRGB2101010, &src, &fb,
>  				  &params->clip, &fmtcnv_state);
>  
> +	buf = le32buf_to_cpu(test, (__force const __le32 *)buf, dst_size / sizeof(u32));
> +
>  	KUNIT_EXPECT_FALSE(test, blit_result);
>  	KUNIT_EXPECT_MEMEQ(test, buf, result->expected, dst_size);
>  }

Looks good to me, and as you said it makes the test consistent with the
drm_fb_xrgb8888_to_argb2101010() test that didn't fail for you on s390x.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-23  7:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-22  5:44 [PATCH] drm/tests: fix drm_test_fb_xrgb8888_to_xrgb2101010 on big endian Dave Airlie
2024-05-23  7:44 ` Javier Martinez Canillas

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.