From f6dfe556659f5473e4bf13cc8d4770ac39c7d678 Mon Sep 17 00:00:00 2001 From: Michał Winiarski Date: Mon, 16 Oct 2017 11:05:14 +0200 Subject: lib: Extract helpers for determining submission method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Couple of tests are using either determining submission method, or pretty printing. Let's move those to helpers in lib. v2: s/igt_show/gem_show Signed-off-by: Michał Winiarski Cc: Arkadiusz Hiler Cc: Chris Wilson Cc: Katarzyna Dec Cc: Petri Latvala Reviewed-by: Chris Wilson Reviewed-by: Katarzyna Dec Acked-by: Arkadiusz Hiler --- lib/igt_aux.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/igt_aux.c') diff --git a/lib/igt_aux.c b/lib/igt_aux.c index ee53559c..c1082143 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -1493,6 +1493,24 @@ igt_show_stat(proc_t *info, int *state, const char *fn) ++*state; } +void gem_show_submission_method(int fd) +{ + const unsigned flags = gem_submission_method(fd); + + if (flags & GEM_SUBMISSION_GUC) { + igt_info("Using GuC submission\n"); + return; + } + + if (flags & GEM_SUBMISSION_EXECLISTS) { + igt_info("Using Execlists submission\n"); + return; + } + + igt_info("Using Legacy submission%s\n", + flags & GEM_SUBMISSION_SEMAPHORES ? ", with semaphores" : ""); +} + static void __igt_lsof_fds(proc_t *proc_info, int *state, char *proc_path, const char *dir) { -- cgit v1.2.3