2024-02-19 23:46:18

by Erhard Furtner

[permalink] [raw]
Subject: drm_format_helper_test fails Subtest: drm_test_fb_xrgb8888_to_xrgb2101010 on Big Endian machines (kernel 6.7.5, ppc64)

Greetings!

I ran some kernel drm/ttm unit tests to check for quirks in the drm/ttm subsystem. One thing I found out that the drm_format_helper_test fails Subtest: drm_test_fb_xrgb8888_to_xrgb2101010 on my Talos II (ppc64) which I run in BigEndian mode:

[...]
KTAP version 1
# Subtest: drm_test_fb_xrgb8888_to_xrgb2101010
# drm_test_fb_xrgb8888_to_xrgb2101010: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_format_helper_test.c:995
Expected buf == result->expected, but
buf ==
<00><00><f0><3f>
result->expected ==
<3f><f0><00><00>
not ok 1 single_pixel_source_buffer
# drm_test_fb_xrgb8888_to_xrgb2101010: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_format_helper_test.c:995
Expected buf == result->expected, but
buf ==
<00><00><f0><3f>
result->expected ==
<3f><f0><00><00>
not ok 2 single_pixel_clip_rectangle
# drm_test_fb_xrgb8888_to_xrgb2101010: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_format_helper_test.c:995
Expected buf == result->expected, but
buf ==
<ff> ff ff <3f> 00 00 00 00 <00><00><f0><3f> 00 <fc><0f> 00
<ff><03><00><00><ff><03><f0><3f><00><fc><ff><3f><ff><ff><0f><00>
result->expected ==
<3f> ff ff <ff> 00 00 00 00 <3f><f0><00><00> 00 <0f><fc> 00
<00><00><03><ff><3f><f0><03><ff><3f><ff><fc><00><00><0f><ff><ff>
not ok 3 well_known_colors
# drm_test_fb_xrgb8888_to_xrgb2101010: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_format_helper_test.c:995
Expected buf == result->expected, but
buf ==
<72><46><84><03><14><d4><44><04><0c><3c><2f><2a> 00 00 00 00
00 00 00 00 <cd><0d><1f><1b><72><46><84><03><14><d4><44><04>
00 00 00 00 00 00 00 00 <0c><30><20><2a><cd><0d><1f><1b>
<72><46><84><03> 00 00 00 00 00 00 00 00
result->expected ==
<03><84><46><72><04><44><d4><14><2a><2f><3c><0c> 00 00 00 00
00 00 00 00 <1b><1f><0d><cd><03><84><46><72><04><44><d4><14>
00 00 00 00 00 00 00 00 <2a><20><30><0c><1b><1f><0d><cd>
<03><84><46><72> 00 00 00 00 00 00 00 00
not ok 4 destination_pitch
# drm_test_fb_xrgb8888_to_xrgb2101010: pass:0 fail:4 skip:0 total:4
not ok 9 drm_test_fb_xrgb8888_to_xrgb2101010
[...]

Looking at these results I suspect this to be an endian issue, probably affecting other BE arches too.

Full dmesg + kernel .config attached.

Regards,
Erhard F.


Attachments:
(No filename) (2.57 kB)
dmesg_675_p9.txt (27.86 kB)
config_675_p9 (125.68 kB)
Download all attachments

2024-02-23 06:13:29

by Christophe Leroy

[permalink] [raw]
Subject: Re: drm_format_helper_test fails Subtest: drm_test_fb_xrgb8888_to_xrgb2101010 on Big Endian machines (kernel 6.7.5, ppc64)

Hi,

Le 20/02/2024 à 00:45, Erhard Furtner a écrit :
> Greetings!
>
> I ran some kernel drm/ttm unit tests to check for quirks in the drm/ttm subsystem. One thing I found out that the drm_format_helper_test fails Subtest: drm_test_fb_xrgb8888_to_xrgb2101010 on my Talos II (ppc64) which I run in BigEndian mode:
>
> [...]
> KTAP version 1
> # Subtest: drm_test_fb_xrgb8888_to_xrgb2101010
> # drm_test_fb_xrgb8888_to_xrgb2101010: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_format_helper_test.c:995
> Expected buf == result->expected, but
> buf ==
> <00><00><f0><3f>
> result->expected ==
> <3f><f0><00><00>
> not ok 1 single_pixel_source_buffer
> # drm_test_fb_xrgb8888_to_xrgb2101010: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_format_helper_test.c:995
> Expected buf == result->expected, but
> buf ==
> <00><00><f0><3f>
> result->expected ==
> <3f><f0><00><00>
> not ok 2 single_pixel_clip_rectangle
> # drm_test_fb_xrgb8888_to_xrgb2101010: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_format_helper_test.c:995
> Expected buf == result->expected, but
> buf ==
> <ff> ff ff <3f> 00 00 00 00 <00><00><f0><3f> 00 <fc><0f> 00
> <ff><03><00><00><ff><03><f0><3f><00><fc><ff><3f><ff><ff><0f><00>
> result->expected ==
> <3f> ff ff <ff> 00 00 00 00 <3f><f0><00><00> 00 <0f><fc> 00
> <00><00><03><ff><3f><f0><03><ff><3f><ff><fc><00><00><0f><ff><ff>
> not ok 3 well_known_colors
> # drm_test_fb_xrgb8888_to_xrgb2101010: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_format_helper_test.c:995
> Expected buf == result->expected, but
> buf ==
> <72><46><84><03><14><d4><44><04><0c><3c><2f><2a> 00 00 00 00
> 00 00 00 00 <cd><0d><1f><1b><72><46><84><03><14><d4><44><04>
> 00 00 00 00 00 00 00 00 <0c><30><20><2a><cd><0d><1f><1b>
> <72><46><84><03> 00 00 00 00 00 00 00 00
> result->expected ==
> <03><84><46><72><04><44><d4><14><2a><2f><3c><0c> 00 00 00 00
> 00 00 00 00 <1b><1f><0d><cd><03><84><46><72><04><44><d4><14>
> 00 00 00 00 00 00 00 00 <2a><20><30><0c><1b><1f><0d><cd>
> <03><84><46><72> 00 00 00 00 00 00 00 00
> not ok 4 destination_pitch
> # drm_test_fb_xrgb8888_to_xrgb2101010: pass:0 fail:4 skip:0 total:4
> not ok 9 drm_test_fb_xrgb8888_to_xrgb2101010
> [...]
>
> Looking at these results I suspect this to be an endian issue, probably affecting other BE arches too.
>
> Full dmesg + kernel .config attached.

Doing a build with C=2 I get the following warning. Fix this warning and
it should work on all endiannesses:

CC drivers/gpu/drm/tests/drm_format_helper_test.o
CHECK drivers/gpu/drm/tests/drm_format_helper_test.c
drivers/gpu/drm/tests/drm_format_helper_test.c:994:36: warning:
incorrect type in argument 2 (different base types)
drivers/gpu/drm/tests/drm_format_helper_test.c:994:36: expected
restricted __le32 const [usertype] *buf
drivers/gpu/drm/tests/drm_format_helper_test.c:994:36: got unsigned
int [usertype] *[assigned] buf


Christophe