[igt-dev] [PATCH i-g-t v7 05/16] lib/drmtest: Add driver enum for i915/xe

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Apr 27 20:02:56 UTC 2023


Library code like intel-bb and intel-buf which requires adoption
to handle both drivers should store driver on which fd they are
working on instead of calling costful is_i915/xe_device() helper.

Introduce intel_driver enum which will be used on library code
adoption to Xe.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
 lib/drmtest.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/drmtest.h b/lib/drmtest.h
index 5878f65129..3c88b85c6f 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -62,6 +62,14 @@
  */
 #define DRIVER_ANY 	~(DRIVER_VGEM)
 
+/*
+ * Compile friendly enum for i915/xe.
+ */
+enum intel_driver {
+	INTEL_DRIVER_I915 = 1,
+	INTEL_DRIVER_XE,
+};
+
 void __set_forced_driver(const char *name);
 
 /**
-- 
2.34.1



More information about the igt-dev mailing list