summaryrefslogtreecommitdiff
path: root/tests/kms_cursor_legacy.c
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2016-06-07 10:18:34 +0200
committerTomeu Vizoso <tomeu.vizoso@collabora.com>2016-06-07 16:01:17 +0200
commit047c999482335c48eda6a10144a9fb0861e93a1e (patch)
tree87bed8190f0431c41ccb20c635218effafeaed93 /tests/kms_cursor_legacy.c
parent56b220b32fa56efe6ba5a13b7e08a490ad566934 (diff)
igt/kms_cursor_legacy: wrap __builtin_ia32_pause inside cpu_relax
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@collabora.com>
Diffstat (limited to 'tests/kms_cursor_legacy.c')
-rw-r--r--tests/kms_cursor_legacy.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 5cb26d1c..8c2d726f 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);
}