[i-g-t,2/2] i915/gem_engine_topology: Fix virtual engine check
diff mbox series

Message ID 20200122152349.12154-2-tvrtko.ursulin@linux.intel.com
State New
Headers show
Series
  • [i-g-t,1/2] i915/gem_engine_topology: Generate engine names based on class
Related show

Commit Message

Tvrtko Ursulin Jan. 22, 2020, 3:23 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Engine class/instance have to be u16 for the virtual engine check to work.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/i915/gem_engine_topology.c | 2 +-
 lib/igt_gt.h                   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Chris Wilson Jan. 22, 2020, 6:04 p.m. UTC | #1
Quoting Tvrtko Ursulin (2020-01-22 15:23:49)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Engine class/instance have to be u16 for the virtual engine check to work.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Reported-by: Chris Wilson <chris@chris-wilson.co.uk>

I feel there may be more, but this seems to be a crucial one.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

Patch
diff mbox series

diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c
index c3645eab8538..989a6e26d6ef 100644
--- a/lib/i915/gem_engine_topology.c
+++ b/lib/i915/gem_engine_topology.c
@@ -105,7 +105,7 @@  static const char *class_names[] = {
 };
 
 static void init_engine(struct intel_execution_engine2 *e2,
-			int class, int instance, uint64_t flags)
+			uint16_t class, uint16_t instance, uint64_t flags)
 {
 	int ret;
 
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index 6a8eceb68817..e880cd4ed11f 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -96,8 +96,8 @@  bool gem_class_can_store_dword(int fd, int class);
 
 extern const struct intel_execution_engine2 {
 	char name[16];
-	int class;
-	int instance;
+	uint16_t class;
+	uint16_t instance;
 	uint64_t flags;
 	bool is_virtual;
 } intel_execution_engines2[];