summaryrefslogtreecommitdiff
path: root/tests/gem_sync.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-07-22 12:58:54 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-07-22 14:27:43 +0100
commitc6e26e47e139ba38fd746daa36ca982908b46840 (patch)
treeb9480774cb75b1a011bcc5d5c17d959a6ec5923a /tests/gem_sync.c
parent5d233babe7a99467c658e18c9091f4475dfd5b06 (diff)
igt/gem_exec_nop: Display submission mechanism
Useful for confirmation when testing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_sync.c')
-rw-r--r--tests/gem_sync.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/gem_sync.c b/tests/gem_sync.c
index abb31679..44b2378c 100644
--- a/tests/gem_sync.c
+++ b/tests/gem_sync.c
@@ -25,6 +25,7 @@
#include <pthread.h>
#include "igt.h"
+#include "igt_sysfs.h"
#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
@@ -689,6 +690,45 @@ store_all(int fd, int num_children)
igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
}
+static void print_welcome(int fd)
+{
+ bool active;
+ char *str;
+ int dir;
+
+ dir = igt_sysfs_open_parameters(fd);
+ if (dir < 0)
+ return;
+
+ str = igt_sysfs_get(dir, "enable_guc_submission");
+ active = str && atoi(str) > 0;
+ free(str);
+
+ if (active) {
+ igt_info("Using GuC submission\n");
+ goto out;
+ }
+
+ str = igt_sysfs_get(dir, "enable_execlists");
+ active = str && atoi(str) > 0;
+ free(str);
+
+ if (active) {
+ igt_info("Using Execlists submission\n");
+ goto out;
+ }
+
+ str = igt_sysfs_get(dir, "semaphores");
+ active = str && atoi(str) > 0;
+ free(str);
+
+ igt_info("Using Legacy submission %s\n",
+ active ? ", with semaphores" : "");
+
+out:
+ close(dir);
+}
+
igt_main
{
const struct intel_execution_engine *e;
@@ -699,6 +739,7 @@ igt_main
igt_fixture {
fd = drm_open_driver(DRIVER_INTEL);
+ print_welcome(fd);
igt_fork_hang_detector(fd);
}