panthor: Enable compilation on big-endian arch
PATCH v2 1/1 panthor: Enable compilation on big-endian arch
Compilation of Panthor was broken on big-endian due to a guard in pathor lib against such arch. Fix this and create and use function for skipping all panthor tests on such machines.
Also while at it, init fd so it could be safely used at last fixture.
v2: simplify test for big-endian, fix typo (Boris)
--- lib/igt_panthor.c | 11 +++++++++++ lib/igt_panthor.h | 6 ++---- tests/panthor/panthor_gem.c | 3 ++- tests/panthor/panthor_group.c | 3 ++- tests/panthor/panthor_query.c | 3 ++- tests/panthor/panthor_vm.c | 3 ++- 6 files changed, 21 insertions(+), 8 deletions(-)
lib/igt_panthor.c +11 -0
@@ -6,6 +6,17 @@#include "ioctl_wrappers.h" #include "panthor_drm.h" +/** +* igt_panthor_skip_on_big_endian: +* +* Skip Panthor test on big-endian machines. +*/ +void igt_panthor_skip_on_big_endian (void ) +{ +igt_skip_on_f (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__, +"Panthor is unsupported on big-endian arch\n" ); +} +/** * igt_panthor_group_create: * @fd: device file descriptor
lib/igt_panthor.h +2 -4
@@ -61,11 +61,9 @@ enum cs_flush_mode { };/* There's no plan to support big endian in the UMD, so keep -* things simple and don't bother supporting it here either. +* things simple and don't bother supporting it. */ -#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#error "big endian not supported" -#endif +void igt_panthor_skip_on_big_endian (void ); struct cs_instr { union {
tests/panthor/panthor_gem.c +2 -1
@@ -8,9 +8,10 @@#include "igt_panthor.h" int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }
tests/panthor/panthor_group.c +2 -1
@@ -41,9 +41,10 @@ issue_store_multiple(uint8_t *cs, uint64_t kernel_va, uint32_t constant) }int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }
tests/panthor/panthor_query.c +2 -1
@@ -8,9 +8,10 @@#include <stdint.h> int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }
tests/panthor/panthor_vm.c +2 -1
@@ -7,9 +7,10 @@#include "panthor_drm.h" int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }
Signature · 1 line
2.53.0
Quoted 7 lines · On Thu, 19 Feb 2026 16:05:24 +0100 Kamil Konieczny…
Compilation of Panthor was broken on big-endian due to a guard in pathor lib against such arch. Fix this and create and use function for skipping all panthor tests on such machines.
Also while at it, init fd so it could be safely used at last fixture.
Quoted 6 lines
v2: simplify test for big-endian, fix typo (Boris)
Cc Daniel Almeida <[email protected]>Cc Boris Brezillon <[email protected]>Signed-off-by Kamil Konieczny <[email protected]>
Thanks!
Boris
Quoted 113 lines
--- lib/igt_panthor.c | 11 +++++++++++ lib/igt_panthor.h | 6 ++---- tests/panthor/panthor_gem.c | 3 ++- tests/panthor/panthor_group.c | 3 ++- tests/panthor/panthor_query.c | 3 ++- tests/panthor/panthor_vm.c | 3 ++- 6 files changed, 21 insertions(+), 8 deletions(-)lib/igt_panthor.c +11
-0@@ -6,6 +6,17 @@#include "ioctl_wrappers.h" #include "panthor_drm.h" +/** +* igt_panthor_skip_on_big_endian: +* +* Skip Panthor test on big-endian machines. +*/ +void igt_panthor_skip_on_big_endian (void ) +{ +igt_skip_on_f (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__, +"Panthor is unsupported on big-endian arch\n" ); +} +/** * igt_panthor_group_create: * @fd: device file descriptor lib/igt_panthor.h +2
-4@@ -61,11 +61,9 @@ enum cs_flush_mode { };/* There's no plan to support big endian in the UMD, so keep -* things simple and don't bother supporting it here either. +* things simple and don't bother supporting it. */ -#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#error "big endian not supported" -#endif +void igt_panthor_skip_on_big_endian (void ); struct cs_instr { union {tests/panthor/panthor_gem.c +2
-1@@ -8,9 +8,10 @@#include "igt_panthor.h" int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }tests/panthor/panthor_group.c +2
-1@@ -41,9 +41,10 @@ issue_store_multiple(uint8_t *cs, uint64_t kernel_va, uint32_t constant) }int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }tests/panthor/panthor_query.c +2
-1@@ -8,9 +8,10 @@#include <stdint.h> int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }tests/panthor/panthor_vm.c +2
-1@@ -7,9 +7,10 @@#include "panthor_drm.h" int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }
Quoted 133 lines · Kamil Konieczny
Compilation of Panthor was broken on big-endian due to a guard in pathor lib against such arch. Fix this and create and use function for skipping all panthor tests on such machines.
Also while at it, init fd so it could be safely used at last fixture.
v2: simplify test for big-endian, fix typo (Boris)
Cc Daniel Almeida <[email protected]>Cc Boris Brezillon <[email protected]>Signed-off-by Kamil Konieczny <[email protected]>---
lib/igt_panthor.c | 11 +++++++++++ lib/igt_panthor.h | 6 ++---- tests/panthor/panthor_gem.c | 3 ++- tests/panthor/panthor_group.c | 3 ++- tests/panthor/panthor_query.c | 3 ++- tests/panthor/panthor_vm.c | 3 ++- 6 files changed, 21 insertions(+), 8 deletions(-)lib/igt_panthor.c +11
-0@@ -6,6 +6,17 @@#include "ioctl_wrappers.h" #include "panthor_drm.h" +/** +* igt_panthor_skip_on_big_endian: +* +* Skip Panthor test on big-endian machines. +*/ +void igt_panthor_skip_on_big_endian (void ) +{ +igt_skip_on_f (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__, +"Panthor is unsupported on big-endian arch\n" ); +} +/** * igt_panthor_group_create: * @fd: device file descriptor lib/igt_panthor.h +2
-4@@ -61,11 +61,9 @@ enum cs_flush_mode { };/* There's no plan to support big endian in the UMD, so keep -* things simple and don't bother supporting it here either. +* things simple and don't bother supporting it. */ -#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#error "big endian not supported" -#endif +void igt_panthor_skip_on_big_endian (void ); struct cs_instr { union {tests/panthor/panthor_gem.c +2
-1@@ -8,9 +8,10 @@#include "igt_panthor.h" int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }tests/panthor/panthor_group.c +2
-1@@ -41,9 +41,10 @@ issue_store_multiple(uint8_t *cs, uint64_t kernel_va, uint32_t constant) }int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }tests/panthor/panthor_query.c +2
-1@@ -8,9 +8,10 @@#include <stdint.h> int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }tests/panthor/panthor_vm.c +2
-1@@ -7,9 +7,10 @@#include "panthor_drm.h" int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }Signature · 1 line
2.53.0
Patchwork
CI✗ Fi.CI.BAT: failure for panthor: Enable compilation on big-endian arch (rev2)
In reply to Kamil Konieczny== Series Details ==
== Series Details ==
Series: panthor: Enable compilation on big-endian arch (rev2)
URL : https://patchwork.freedesktop.org/series/161768/
State : failure
== Summary ==
Series 161768 revision 2 was fully merged or fully failed: no git log
Quoted 6 lines · Kamil Konieczny
Compilation of Panthor was broken on big-endian due to a guard in pathor lib against such arch. Fix this and create and use function for skipping all panthor tests on such machines.
Also while at it, init fd so it could be safely used at last fixture.
What about DRIVER_ANY tests?
Seems like the cleaner option would be to amend drm_open_driver() with something like:
if (chipset & DRIVER_PANTHOR)
skip on big endian
instead of sprinkling the skips everywhere.
Quoted 24 lines
v2: simplify test for big-endian, fix typo (Boris)
Cc Daniel Almeida <[email protected]>Cc Boris Brezillon <[email protected]>Signed-off-by Kamil Konieczny <[email protected]>--- lib/igt_panthor.c | 11 +++++++++++ lib/igt_panthor.h | 6 ++---- tests/panthor/panthor_gem.c | 3 ++- tests/panthor/panthor_group.c | 3 ++- tests/panthor/panthor_query.c | 3 ++- tests/panthor/panthor_vm.c | 3 ++- 6 files changed, 21 insertions(+), 8 deletions(-)lib/igt_panthor.c +0
-0@@ -6,6 +6,17 @@#include "ioctl_wrappers.h" #include "panthor_drm.h"
lib/igt_panthor.c line 18
Quoted 10 lines
lib/igt_panthor.c +10
-0+/** +* igt_panthor_skip_on_big_endian: +* +* Skip Panthor test on big-endian machines. +*/ +void igt_panthor_skip_on_big_endian (void ) +{ +igt_skip_on_f (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__, +"Panthor is unsupported on big-endian arch\n" ); +}
Why does this have to encode Panthor in the name, when it in fact does not check anything about Panthor? What the function *does* is skip on big endian, regardless of GPU, so the function name is misleading.
Quoted 85 lines
lib/igt_panthor.c +1
-0+/** * igt_panthor_group_create: * @fd: device file descriptor lib/igt_panthor.h +2
-4@@ -61,11 +61,9 @@ enum cs_flush_mode { };/* There's no plan to support big endian in the UMD, so keep -* things simple and don't bother supporting it here either. +* things simple and don't bother supporting it. */ -#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#error "big endian not supported" -#endif +void igt_panthor_skip_on_big_endian (void ); struct cs_instr { union {tests/panthor/panthor_gem.c +2
-1@@ -8,9 +8,10 @@#include "igt_panthor.h" int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }tests/panthor/panthor_group.c +2
-1@@ -41,9 +41,10 @@ issue_store_multiple(uint8_t *cs, uint64_t kernel_va, uint32_t constant) }int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }tests/panthor/panthor_query.c +2
-1@@ -8,9 +8,10 @@#include <stdint.h> int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }tests/panthor/panthor_vm.c +2
-1@@ -7,9 +7,10 @@#include "panthor_drm.h" int igt_main () { -int fd; +int fd =-1 ; igt_fixture() { +igt_panthor_skip_on_big_endian (); fd =drm_open_driver (DRIVER_PANTHOR ); }
Signature · 1 line
Jani Nikula, Intel
Quoted 10 lines · On Mon, 23 Feb 2026 12:49:38 +0200 Jani Nikula <[email protected]> wrote:
Quoted 6 lines · Kamil Konieczny
Compilation of Panthor was broken on big-endian due to a guard in pathor lib against such arch. Fix this and create and use function for skipping all panthor tests on such machines.
Also while at it, init fd so it could be safely used at last fixture.
What about
DRIVER_ANYtests?
Quoted 7 lines
Seems like the cleaner option would be to amend
drm_open_driver()with something like:if (chipset &
DRIVER_PANTHOR)
skip on big endianinstead of sprinkling the skips everywhere.
FWIW, I'm fine with this approach too.