[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/8] vfio/igd: fix GTT stolen memory size calculation for gen 7
From: |
Tomita Moeko |
Subject: |
[PATCH 1/8] vfio/igd: fix GTT stolen memory size calculation for gen 7 |
Date: |
Mon, 2 Dec 2024 00:09:31 +0800 |
Both intel documentation [1][2] and i915 driver shows GGMS represents
GTT stolen memory size in multiple of 1MB, not 2MB starting from gen 8.
[1]
https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/3rd-gen-core-desktop-vol-2-datasheet.pdf
[2]
https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/4th-gen-core-family-desktop-vol-2-datasheet.pdf
Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
---
hw/vfio/igd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c
index 4047f4f071..e40e601026 100644
--- a/hw/vfio/igd.c
+++ b/hw/vfio/igd.c
@@ -268,7 +268,7 @@ static int vfio_igd_gtt_max(VFIOPCIDevice *vdev)
gmch = vfio_pci_read_config(&vdev->pdev, IGD_GMCH, sizeof(gmch));
ggms = (gmch >> (gen < 8 ? 8 : 6)) & 0x3;
- if (gen > 6) {
+ if (gen > 7) {
ggms = 1 << ggms;
}
@@ -678,7 +678,7 @@ void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr)
/* Determine the size of stolen memory needed for GTT */
ggms_mb = (gmch >> (gen < 8 ? 8 : 6)) & 0x3;
- if (gen > 6) {
+ if (gen > 7) {
ggms_mb = 1 << ggms_mb;
}
--
2.45.2
[PATCH 5/8] vfio/igd: add Alder/Raptor/Rocket/Ice/Jasper Lake device ids, Tomita Moeko, 2024/12/01