diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-05-18 12:11:59 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-05-18 13:06:17 +0100 |
commit | bc7877660c7d7a733ec484e91e2096b8daf2cf0d (patch) | |
tree | 4ade2c9751497fac6a87081920863cce63d14704 /lib | |
parent | 49e083a29a0942309c877ea8e9275fa985a5bf25 (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')
-rw-r--r-- | lib/igt_gt.c | 18 | ||||
-rw-r--r-- | lib/igt_gt.h | 1 |
2 files changed, 19 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; +} diff --git a/lib/igt_gt.h b/lib/igt_gt.h index 1ed833d2..2579cbd3 100644 --- a/lib/igt_gt.h +++ b/lib/igt_gt.h @@ -78,5 +78,6 @@ extern const struct intel_execution_engine { e__++) \ for_if (gem_has_ring(fd__, flags__ = e__->exec_id | e__->flags)) +bool gem_can_store_dword(int fd, unsigned int engine); #endif /* IGT_GT_H */ |