[igt-dev] [PATCH i-g-t 1/2] lib: intel: report GT size from the database if available

Lionel Landwerlin lionel.g.landwerlin at intel.com
Tue Mar 20 13:47:40 UTC 2018


The scheme if getting the GT size from the PCI-id doesn't work anymore
on Coffeelake.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105451, https://bugs.freedesktop.org/show_bug.cgi?id=101740
---
 lib/intel_device_info.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/intel_device_info.c b/lib/intel_device_info.c
index 1c710733..c104c9c4 100644
--- a/lib/intel_device_info.c
+++ b/lib/intel_device_info.c
@@ -410,8 +410,17 @@ unsigned intel_gen(uint16_t devid)
  */
 unsigned intel_gt(uint16_t devid)
 {
+	const struct intel_device_info *devinfo = intel_get_device_info(devid);
 	unsigned mask = intel_gen(devid);
 
+	/* If in the database, just use that information. */
+	if (devinfo->gt != 0)
+		return devinfo->gt - 1;
+
+	/*
+	 * This scheme doesn't work on Coffeelake, we should probably
+	 * not rely on this anymore.
+	 */
 	if (mask >= 8)
 		mask = 0xf;
 	else if (mask >= 6)
-- 
2.16.2



More information about the igt-dev mailing list