The MIPS architecture doesn't provide the hardware atomics that are
required for the "create-clear" sub-test such as
__sync_add_and_fetch().  As a simple and pragmatic solution, disable
this sub-test when building for MIPS.  A better approach would be to
add a fallback implementation for these operations.

Fixes: 6727e17c00b2 ("i915/gem_create: Verify that all new objects are clear")
Signed-off-by: Guillaume Tucker <guillaume.tuc...@collabora.com>
---
 tests/i915/gem_create.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index 2a861ca8a7ec..8a48496e6c19 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -142,6 +142,7 @@ static void invalid_nonaligned_size(int fd)
        gem_close(fd, handle);
 }
 
+#if !defined(__mips__) /* MIPS doesn't provide the required hardware atomics */
 static uint64_t get_npages(uint64_t *global, uint64_t npages)
 {
        uint64_t try, old, max;
@@ -208,6 +209,7 @@ static void always_clear(int i915, int timeout)
        for (int i = 0; i < ncpus; i++)
                pthread_join(thread[i], NULL);
 }
+#endif /* !defined(__mips__) */
 
 igt_main
 {
@@ -231,6 +233,8 @@ igt_main
        igt_subtest("create-invalid-nonaligned")
                invalid_nonaligned_size(fd);
 
+#if !defined(__mips__)
        igt_subtest("create-clear")
                always_clear(fd, 30);
+#endif
 }
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to