summaryrefslogtreecommitdiff
path: root/lib/igt_gt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-05-18 12:11:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-05-18 13:06:17 +0100
commitbc7877660c7d7a733ec484e91e2096b8daf2cf0d (patch)
tree4ade2c9751497fac6a87081920863cce63d14704 /lib/igt_gt.c
parent49e083a29a0942309c877ea8e9275fa985a5bf25 (diff)
lib: Refactor testing for ability to use MI_STORE_DATA_IMM
Rather than have the code in multiple locations, put a copy in lib/ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_gt.c')
-rw-r--r--lib/igt_gt.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 25db02e9..11643edd 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -557,3 +557,21 @@ const struct intel_execution_engine intel_execution_engines[] = {
{ "vebox", "vecs0", I915_EXEC_VEBOX, 0 },
{ NULL, 0, 0 }
};
+
+bool gem_can_store_dword(int fd, unsigned int engine)
+{
+ uint16_t devid = intel_get_drm_devid(fd);
+ const struct intel_device_info *info = intel_get_device_info(devid);
+ const int gen = ffs(info->gen);
+
+ if (gen <= 2) /* requires physical addresses */
+ return false;
+
+ if (gen == 6 && (engine & ~(3<<13)) == I915_EXEC_BSD)
+ return false; /* kills the machine! */
+
+ if (info->is_broadwater)
+ return false; /* Not sure yet... */
+
+ return true;
+}