[PATCH i-g-t] igt/kms_cursor_legacy: wrap __builtin_ia32_pause inside cpu_relax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So that we can add an alternative implementation for the other arches.
This is basically what the kernel does.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx>
---
 tests/kms_cursor_legacy.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 5cb26d1c25e5..8c2d726f9d15 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -28,6 +28,12 @@
 #include "igt.h"
 #include "igt_stats.h"
 
+#if defined(__x86_64__) || defined(__i386__)
+#define cpu_relax()	__builtin_ia32_pause()
+#else
+#define cpu_relax()	asm volatile("": : :"memory")
+#endif
+
 IGT_TEST_DESCRIPTION("Stress legacy cursor ioctl");
 
 struct data {
@@ -111,7 +117,7 @@ static void stress(struct data *data,
 			sched_setaffinity(getpid(), sizeof(cpu_set_t), &allowed);
 			igt_until_timeout(timeout) {
 				count++;
-				__builtin_ia32_pause();
+				cpu_relax();
 			}
 			igt_debug("[hog:%d] count=%llu\n", child, count);
 		}
-- 
2.5.5

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux