[igt-dev] [PATCH i-g-t 1/3] lib/i915: Add graphics release subversion to device info

Nirmoy Das nirmoy.das at intel.com
Wed Jul 6 18:00:15 UTC 2022


Record the minor incremental changes between the major gen12 platforms as
a release version.

v2: add missing "," to last struct member and move
graphics_rel next to graphics_ver.
v3: add graphics_rel for ats-m and other minor fixes.

Acked-by: Matthew Auld <matthew.auld at intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Suggested-by: Chris Wilson <chris.p.wilson at intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
---
 lib/intel_chipset.h     |  4 ++++
 lib/intel_device_info.c | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/lib/intel_chipset.h b/lib/intel_chipset.h
index 06f732110..d7a6ff190 100644
--- a/lib/intel_chipset.h
+++ b/lib/intel_chipset.h
@@ -38,6 +38,7 @@ uint32_t intel_get_drm_devid(int fd);
 
 struct intel_device_info {
 	unsigned graphics_ver;
+	unsigned graphics_rel;
 	unsigned display_ver;
 	unsigned gt; /* 0 if unknown */
 	bool has_4tile : 1;
@@ -90,6 +91,7 @@ struct intel_device_info {
 const struct intel_device_info *intel_get_device_info(uint16_t devid) __attribute__((pure));
 
 unsigned intel_gen(uint16_t devid) __attribute__((pure));
+unsigned intel_graphics_ver(uint16_t devid) __attribute__((pure));
 unsigned intel_display_ver(uint16_t devid) __attribute__((pure));
 
 extern enum pch_type intel_pch;
@@ -107,6 +109,8 @@ void intel_check_pch(void);
 #define HAS_CPT (intel_pch == PCH_CPT)
 #define HAS_LPT (intel_pch == PCH_LPT)
 
+#define IP_VER(ver, rel)		((ver) << 8 | (rel))
+
 /* Exclude chipset #defines, they just add noise */
 #ifndef __GTK_DOC_IGNORE__
 
diff --git a/lib/intel_device_info.c b/lib/intel_device_info.c
index bfdd9fa5c..ebfcea737 100644
--- a/lib/intel_device_info.c
+++ b/lib/intel_device_info.c
@@ -385,6 +385,7 @@ static const struct intel_device_info intel_rocketlake_info = {
 
 static const struct intel_device_info intel_dg1_info = {
 	.graphics_ver = 12,
+	.graphics_rel = 10,
 	.display_ver = 12,
 	.is_dg1 = true,
 	.codename = "dg1"
@@ -392,6 +393,7 @@ static const struct intel_device_info intel_dg1_info = {
 
 static const struct intel_device_info intel_dg2_info = {
 	.graphics_ver = 12,
+	.graphics_rel = 55,
 	.display_ver = 13,
 	.has_4tile = true,
 	.is_dg2 = true,
@@ -429,6 +431,7 @@ static const struct intel_device_info intel_alderlake_n_info = {
 
 static const struct intel_device_info intel_ats_m_info = {
 	.graphics_ver = 12,
+	.graphics_rel = 55,
 	.display_ver = 0, /* no display support */
 	.is_dg2 = true,
 	.has_4tile = true,
@@ -583,6 +586,13 @@ unsigned intel_gen(uint16_t devid)
 	return intel_get_device_info(devid)->graphics_ver ?: -1u;
 }
 
+unsigned intel_graphics_ver(uint16_t devid)
+{
+	const struct intel_device_info *info = intel_get_device_info(devid);
+
+	return IP_VER(info->graphics_ver, info->graphics_rel);
+}
+
 /**
  * intel_display_ver:
  * @devid: pci device id
-- 
2.35.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


More information about the igt-dev mailing list