diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-07-22 12:58:54 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-07-22 14:27:43 +0100 |
commit | c6e26e47e139ba38fd746daa36ca982908b46840 (patch) | |
tree | b9480774cb75b1a011bcc5d5c17d959a6ec5923a /tests/gem_exec_nop.c | |
parent | 5d233babe7a99467c658e18c9091f4475dfd5b06 (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_exec_nop.c')
-rw-r--r-- | tests/gem_exec_nop.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c index 9e5aab50..dc7f5143 100644 --- a/tests/gem_exec_nop.c +++ b/tests/gem_exec_nop.c @@ -26,6 +26,7 @@ */ #include "igt.h" +#include "igt_sysfs.h" #include <unistd.h> #include <stdlib.h> #include <stdint.h> @@ -196,6 +197,45 @@ static void all(int fd, uint32_t handle, int timeout) 1e6*time, 1e6*min, 1e6*max, 1e6*(max + 10*min/9)); } +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; @@ -206,6 +246,8 @@ igt_main const uint32_t bbe = MI_BATCH_BUFFER_END; device = drm_open_driver(DRIVER_INTEL); + print_welcome(device); + handle = gem_create(device, 4096); gem_write(device, handle, 0, &bbe, sizeof(bbe)); |