Skip to contentSkip to conversation

tools/intel_gtt: add support for gen10+ devices

PATCH In review Tomita Moeko 3 participants 3 messages Apr 24, 2025 – Apr 30, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/intel_gtt: add support for gen10+ devices

Gen10 and later devices all have the same 64 bit GGTT entries as gen8. Additionally, devices from Meator Lake onwards have bits 45:12 for physical address [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=341ad0e8e254267704e0b87e35ad23aba5c02359

---
 tools/intel_gtt.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
tools/intel_gtt.c +8 -1
index c0f3d16a6..658336d99 100644
@@ -86,7 +86,14 @@ static uint64_t get_phys(uint32_t pt_offset)
 			break;
 		case 8:
 		case 9:
-			phys = phys & 0x7ffffff000;
+		case 10:
+		case 11:
+		case 12:
+		case 20:
+			if (intel_graphics_ver(devid) >= IP_VER(12, 70))
+				phys = phys & 0x3ffffffff000;
+			else
+				phys = phys & 0x7ffffff000;
 			break;
 		default:
 			fprintf(stderr, "Unsupported platform\n");
Signature · 1 line
2.47.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Tomita Moeko

Hi Tomita,

Quoted 6 lines · Tomita Moeko

Gen10 and later devices all have the same 64 bit GGTT entries as gen8. Additionally, devices from Meator Lake onwards have bits 45:12 for physical address [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=341ad0e8e254267704e0b87e35ad23aba5c02359

I will add Closes: 'gitlab issue' here

Quoted 1 line

LGTM,

Quoted 27 lines
---
 tools/intel_gtt.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
tools/intel_gtt.c +8 -1
index c0f3d16a6..658336d99 100644
@@ -86,7 +86,14 @@ static uint64_t get_phys(uint32_t pt_offset)
 			break;
 		case 8:
 		case 9:
-			phys = phys & 0x7ffffff000;
+		case 10:
+		case 11:
+		case 12:
+		case 20:
+			if (intel_graphics_ver(devid) >= IP_VER(12, 70))
+				phys = phys & 0x3ffffffff000;
+			else
+				phys = phys & 0x7ffffff000;
 			break;
 		default:
 			fprintf(stderr, "Unsupported platform\n");
Signature · 1 line
2.47.2