From 8934f722e15fe00de993f6e802ab7f96e749d2bb Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 12 Nov 2017 13:54:40 +0000 Subject: lib/i915: Prepare for the loss of i915.enable_execlists parameter If we can't find the enable_execlists parameter, presume that the switch is forced by the kernel and enabled for all hw supporting execlists. We don't have a GETPARAM or ENGINE_INFO to query the internal details. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala --- lib/i915/gem_submission.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lib/i915') diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c index 882d4f41..8bff4844 100644 --- a/lib/i915/gem_submission.c +++ b/lib/i915/gem_submission.c @@ -28,6 +28,7 @@ #include "igt_core.h" #include "igt_sysfs.h" +#include "intel_chipset.h" #include "i915/gem_submission.h" @@ -64,30 +65,30 @@ static bool has_semaphores(int fd, int dir) */ unsigned gem_submission_method(int fd) { + const int gen = intel_gen(intel_get_drm_devid(fd)); unsigned flags = 0; - bool active; + int result; + int dir; dir = igt_sysfs_open_parameters(fd); if (dir < 0) return 0; - active = igt_sysfs_get_boolean(dir, "enable_guc_submission"); - if (active) { + if (igt_sysfs_get_boolean(dir, "enable_guc_submission")) { flags |= GEM_SUBMISSION_GUC | GEM_SUBMISSION_EXECLISTS; goto out; } - active = igt_sysfs_get_boolean(dir, "enable_execlists"); - if (active) { + if (igt_sysfs_scanf(dir, "enable_execlists", "%d", &result) != 1) + result = gen >= 8; + if (result) { flags |= GEM_SUBMISSION_EXECLISTS; goto out; } - active = has_semaphores(fd, dir); - if (active) { + if (has_semaphores(fd, dir)) flags |= GEM_SUBMISSION_SEMAPHORES; - } out: close(dir); -- cgit v1.2.3