From bc7877660c7d7a733ec484e91e2096b8daf2cf0d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 18 May 2017 12:11:59 +0100 Subject: 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 --- lib/igt_gt.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/igt_gt.c') 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; +} -- cgit v1.2.3