[igt-dev] [PATCH v18 4/6] lib: igt_gt: make gem_engine_can_store_dword() check engine class
Andi Shyti
andi at etezian.org
Sun Apr 7 22:37:52 UTC 2019
From: Andi Shyti <andi.shyti at intel.com>
Engines referred by class and instance are getting more populare,
gem_engine_can_store_dword() should handle the situation.
Signed-off-by: Andi Shyti <andi.shyti at intel.com>
---
lib/igt_gt.c | 11 ++++++++---
lib/igt_gt.h | 1 +
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index b28fca0387ed..12e19417a827 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -557,7 +557,7 @@ const struct intel_execution_engine intel_execution_engines[] = {
{ NULL, 0, 0 }
};
-bool gem_can_store_dword(int fd, unsigned int engine)
+bool gem_class_can_store_dword(int fd, int class)
{
uint16_t devid = intel_get_drm_devid(fd);
const struct intel_device_info *info = intel_get_device_info(devid);
@@ -569,8 +569,8 @@ bool gem_can_store_dword(int fd, unsigned int engine)
if (gen == 3 && (info->is_grantsdale || info->is_alviso))
return false; /* only supports physical addresses */
- if (gen == 6 && ((engine & 0x3f) == I915_EXEC_BSD))
- return false; /* kills the machine! */
+ if (gen == 6 && class == I915_ENGINE_CLASS_VIDEO)
+ return false;
if (info->is_broadwater)
return false; /* Not sure yet... */
@@ -578,6 +578,11 @@ bool gem_can_store_dword(int fd, unsigned int engine)
return true;
}
+bool gem_can_store_dword(int fd, unsigned int engine)
+{
+ return gem_class_can_store_dword(fd, gem_eb_to_class(engine));
+}
+
const struct intel_execution_engine2 intel_execution_engines2[] = {
{ "rcs0", I915_ENGINE_CLASS_RENDER, 0 },
{ "bcs0", I915_ENGINE_CLASS_COPY, 0 },
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index 970ca22fb134..7ca52633a835 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -90,6 +90,7 @@ bool gem_ring_is_physical_engine(int fd, unsigned int ring);
bool gem_ring_has_physical_engine(int fd, unsigned int ring);
bool gem_can_store_dword(int fd, unsigned int engine);
+bool gem_class_can_store_dword(int fd, int class);
extern const struct intel_execution_engine2 {
const char *name;
--
2.20.1
More information about the igt-dev
mailing list