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 | |
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')
-rw-r--r-- | tests/gem_exec_nop.c | 42 | ||||
-rw-r--r-- | tests/gem_exec_whisper.c | 41 | ||||
-rw-r--r-- | tests/gem_sync.c | 41 |
3 files changed, 124 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)); diff --git a/tests/gem_exec_whisper.c b/tests/gem_exec_whisper.c index ec179304..eeaa21f1 100644 --- a/tests/gem_exec_whisper.c +++ b/tests/gem_exec_whisper.c @@ -29,6 +29,7 @@ #include "igt.h" #include "igt_gt.h" +#include "igt_sysfs.h" #define LOCAL_I915_EXEC_NO_RELOC (1<<11) #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) @@ -391,6 +392,45 @@ static void whisper(int fd, unsigned engine, unsigned flags) gem_close(fd, batches[n].handle); } +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 mode { @@ -412,6 +452,7 @@ igt_main igt_fixture { fd = drm_open_driver_master(DRIVER_INTEL); + print_welcome(fd); igt_fork_hang_detector(fd); } 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); } |