summaryrefslogtreecommitdiff
path: root/lib/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-11-12 13:54:40 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-11-17 14:15:26 +0000
commit8934f722e15fe00de993f6e802ab7f96e749d2bb (patch)
tree4b4bcd000d36666ea1e9ee450fdb53bbd9aa2fa8 /lib/i915
parent936b97165308e179880fc0f218192881953f2544 (diff)
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 <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'lib/i915')
-rw-r--r--lib/i915/gem_submission.c17
1 files changed, 9 insertions, 8 deletions
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);