intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* i915 | Bug in virtual PCH detection
@ 2024-09-01  9:56 Andrey Toloknev
  2024-09-03 13:38 ` Ville Syrjälä
  2024-09-04 15:28 ` ✗ Fi.CI.BUILD: failure for " Patchwork
  0 siblings, 2 replies; 9+ messages in thread
From: Andrey Toloknev @ 2024-09-01  9:56 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 1651 bytes --]

Hello!

I have 2 machines with Comet Lake CPUs on Tiger Lake PCH (500 series of
Intel chipsets).
For that configuration there was a patch for adding support for Tiger Lake
PCH with CometLake CPU in 2021 -
https://patchwork.freedesktop.org/patch/412664/
This patch made possible correct detection of such chipset and cpu
configuration for i915 kernel module. Without it there was no output to any
display (HDMI/DP/DVI, even VGA).

But this patch doesn't touch intel_virt_detect_pch method, when you
passthrough iGPU to a virtual machine.
So, virtual PCH incorrectly detects as Cannon Lake and you have no output
to a physical display with i915 driver:

[    2.933139] i915 0000:00:02.0: [drm:intel_virt_detect_pch [i915]]
Assuming PCH ID a300
[    2.933308] i915 0000:00:02.0: [drm:intel_pch_type [i915]] Found Cannon
Lake PCH (CNP)


The bug is on line 173 in drivers/gpu/drm/i915/soc/intel_pch.c in method
intel_virt_detect_pch:

else if (IS_TIGERLAKE(dev_priv) || IS_ROCKETLAKE(dev_priv))

id = INTEL_PCH_TGP_DEVICE_ID_TYPE;

It must be:

else if (IS_TIGERLAKE(dev_priv) || IS_ROCKETLAKE(dev_priv) ||
IS_GEN9_BC(dev_priv))

id = INTEL_PCH_TGP_DEVICE_ID_TYPE;


After that small change you get correct detection of PCH and have output to
a physical display in VM with passthrough iGPU:

[   16.139809] i915 0000:00:02.0: [drm:intel_virt_detect_pch [i915]]
Assuming PCH ID a080
[   16.261151] i915 0000:00:02.0: [drm:intel_pch_type [i915]] Found Tiger
Lake LP PCH


All kernel versions in any distro since 2021 are affected by this small bug.
The patch for i915 module of the actual kernel version is in attachment.

-- 
Best regards, Andrey Toloknev

[-- Attachment #1.2: Type: text/html, Size: 2868 bytes --]

[-- Attachment #2: tgl_vpch_fix.patch --]
[-- Type: application/octet-stream, Size: 566 bytes --]

--- a/drivers/gpu/drm/i915/soc/intel_pch.c	2024-09-01 14:20:44.470847098 +0500
+++ b/drivers/gpu/drm/i915/soc/intel_pch.c	2024-09-01 14:29:46.695998586 +0500
@@ -170,7 +170,7 @@
 
 	if (IS_ALDERLAKE_S(dev_priv) || IS_ALDERLAKE_P(dev_priv))
 		id = INTEL_PCH_ADP_DEVICE_ID_TYPE;
-	else if (IS_TIGERLAKE(dev_priv) || IS_ROCKETLAKE(dev_priv))
+	else if (IS_TIGERLAKE(dev_priv) || IS_ROCKETLAKE(dev_priv) || IS_GEN9_BC(dev_priv))
 		id = INTEL_PCH_TGP_DEVICE_ID_TYPE;
 	else if (IS_JASPERLAKE(dev_priv) || IS_ELKHARTLAKE(dev_priv))
 		id = INTEL_PCH_MCC_DEVICE_ID_TYPE;

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-09-09 12:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-01  9:56 i915 | Bug in virtual PCH detection Andrey Toloknev
2024-09-03 13:38 ` Ville Syrjälä
2024-09-04 12:25   ` Andrey Toloknev
2024-09-04 12:52     ` Ville Syrjälä
2024-09-04 13:00       ` Andrey Toloknev
2024-09-04 13:37         ` Andrey Toloknev
2024-09-04 14:27           ` Jani Nikula
2024-09-05  4:35             ` Andrey Toloknev
2024-09-04 15:28 ` ✗ Fi.CI.BUILD: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).