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 ++++++++++++++++++ lib/igt_gt.h | 1 + 2 files changed, 19 insertions(+) (limited to 'lib') 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 */ -- cgit v1.2.3