From e2ee529bb96320da0968ae52d318883106f3fa55 Mon Sep 17 00:00:00 2001 From: Michał Winiarski Date: Wed, 18 Oct 2017 10:02:12 +0200 Subject: lib/i915: Move submission related helpers to lib/i915/gem_submission MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since I accidentally broke the build for some, by putting the pretty printer for submission inside ifdef HAVE_PROCPS, it's time to move the whole thing into lib/i915 while fixing this mistake. Let's also rename the pretty printer and add a doc to it as well as the section. Fixes: f6dfe556659f ("lib: Extract helpers for determining submission method") Signed-off-by: Michał Winiarski Cc: Arkadiusz Hiler Cc: Chris Wilson Reviewed-by: Chris Wilson --- lib/igt_gt.c | 63 ------------------------------------------------------------ 1 file changed, 63 deletions(-) (limited to 'lib/igt_gt.c') diff --git a/lib/igt_gt.c b/lib/igt_gt.c index 601b03f6..f6cc20b0 100644 --- a/lib/igt_gt.c +++ b/lib/igt_gt.c @@ -607,66 +607,3 @@ bool gem_can_store_dword(int fd, unsigned int engine) return true; } - -/** - * gem_submission_method: - * @fd: open i915 drm file descriptor - * - * Returns: Submission method bitmap. - */ -unsigned gem_submission_method(int fd) -{ - unsigned flags = 0; - bool active; - int dir; - - dir = igt_sysfs_open_parameters(fd); - if (dir < 0) - return 0; - - active = igt_sysfs_get_boolean(dir, "enable_guc_submission"); - if (active) { - flags |= GEM_SUBMISSION_GUC | GEM_SUBMISSION_EXECLISTS; - goto out; - } - - active = igt_sysfs_get_boolean(dir, "enable_execlists"); - if (active) { - flags |= GEM_SUBMISSION_EXECLISTS; - goto out; - } - - active = igt_sysfs_get_boolean(dir, "semaphores"); - if (active) { - flags |= GEM_SUBMISSION_SEMAPHORES; - } - -out: - close(dir); - return flags; -} - - -/** - * gem_has_semaphores: - * @fd: open i915 drm file descriptor - * - * Feature test macro to query whether the driver is using semaphores for - * synchronization between engines. - */ -bool gem_has_semaphores(int fd) -{ - return gem_submission_method(fd) & GEM_SUBMISSION_SEMAPHORES; -} - -/** - * gem_has_execlists: - * @fd: open i915 drm file descriptor - * - * Feature test macro to query whether the driver is using execlists as a - * hardware submission method. - */ -bool gem_has_execlists(int fd) -{ - return gem_submission_method(fd) & GEM_SUBMISSION_EXECLISTS; -} -- cgit v1.2.3