diff mbox series

[1/1,SRU,M] UBUNTU: SAUCE: drm/i915/quirks: Add multiple VBT quirk for HP ZBook Power G10

Message ID 20230630080955.601886-2-acelan.kao@canonical.com
State New
Headers show
Series HDMI output with More than one child device for port B in VBT error | expand

Commit Message

AceLan Kao June 30, 2023, 8:09 a.m. UTC
From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>

BugLink: https://bugs.launchpad.net/bugs/2025195

The quirk is to fix the bug[1] when you see this message[2]. The first
port is not the right port we want to use and it leads to the HDMI
monitor doesn't work.

According the bug report, skip the return workaround the issue, so I
created the DMI quirk to list affected platforms.

Intel is submitting patches[3][4] to fix the issue, but it requires to
backport huge drm structure changes, too. As there is no regression
found with this workaround, it's safer to use the DMI quirk to handle
this issue.

1. https://gitlab.freedesktop.org/drm/intel/-/issues/7709
2. kernel: i915 0000:00:02.0: [drm:intel_bios_init [i915]] More than one child device for port B in VBT, using the first.
3. https://patchwork.freedesktop.org/series/117641/
4. https://patchwork.freedesktop.org/series/114200/

Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c    |   3 +-
 drivers/gpu/drm/i915/display/intel_display.c |   2 +
 drivers/gpu/drm/i915/display/intel_quirks.c  | 255 +++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_quirks.h  |   2 +
 4 files changed, 261 insertions(+), 1 deletion(-)

Comments

AceLan Kao July 3, 2023, 8:26 a.m. UTC | #1
The whole platforms should all have the same issue, so I'll submit v2 to remove the sku number in the DMI quirk.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 04b846440de6..d505c478a6ff 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -34,6 +34,7 @@ 
 #include "intel_display.h"
 #include "intel_display_types.h"
 #include "intel_gmbus.h"
+#include "intel_quirks.h"
 
 #define _INTEL_BIOS_PRIVATE
 #include "intel_vbt_defs.h"
@@ -2730,7 +2731,7 @@  static void parse_ddi_port(struct intel_bios_encoder_data *devdata)
 		return;
 	}
 
-	if (i915->display.vbt.ports[port]) {
+	if (i915->display.vbt.ports[port] && !intel_has_quirk(i915, QUIRK_MULTIPLE_VBT_DEVICES)) {
 		drm_dbg_kms(&i915->drm,
 			    "More than one child device for port %c in VBT, using the first.\n",
 			    port_name(port));
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index c84b581c61c6..ea90f957a5b9 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -8666,6 +8666,8 @@  int intel_modeset_init_noirq(struct drm_i915_private *i915)
 			return ret;
 	}
 
+	intel_init_quirks_early(i915);
+
 	intel_bios_init(i915);
 
 	ret = intel_vga_register(i915);
diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
index a280448df771..bd34145a5868 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.c
+++ b/drivers/gpu/drm/i915/display/intel_quirks.c
@@ -65,6 +65,12 @@  static void quirk_no_pps_backlight_power_hook(struct drm_i915_private *i915)
 	drm_info(&i915->drm, "Applying no pps backlight power quirk\n");
 }
 
+static void quirk_multiple_vbt_devices(struct drm_i915_private *i915)
+{
+	intel_set_quirk(i915, QUIRK_MULTIPLE_VBT_DEVICES);
+	drm_info(&i915->drm, "Applying multiple VBT devices quirk\n");
+}
+
 struct intel_quirk {
 	int device;
 	int subsystem_vendor;
@@ -90,6 +96,12 @@  static int intel_dmi_no_pps_backlight(const struct dmi_system_id *id)
 	return 1;
 }
 
+static int intel_dmi_multiple_vbt_devices(const struct dmi_system_id *id)
+{
+	DRM_INFO("Allow multiple VBT devices in one port on %s\n", id->ident);
+	return 1;
+}
+
 static const struct intel_dmi_quirk intel_dmi_quirks[] = {
 	{
 		.dmi_id_list = &(const struct dmi_system_id[]) {
@@ -138,6 +150,239 @@  static const struct intel_dmi_quirk intel_dmi_quirks[] = {
 	},
 };
 
+static const struct intel_dmi_quirk intel_dmi_quirks_early[] = {
+	{
+		.dmi_id_list = &(const struct dmi_system_id[]) {
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "XW5SKU1#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "XW5SKU4#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "XW5SKU5#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "XW5SKUA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "XW5SKUC#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83P94AW#ABJ"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83P99AW#ABU"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83P83AW#UUF"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83R24AW#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83M96AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83M97AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83M98AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83N02AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83Q00AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83N03AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83M99AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83N04AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83Q10AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83N09AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83Q11AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83N10AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83N06AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83N07AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83N08AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83N01AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83N05AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83Q12AA#ABA"),
+				},
+			},
+			{
+				.callback = intel_dmi_multiple_vbt_devices,
+				.ident = "HP ZBook Power 15.6 inch G10 Mobile Workstation PC",
+				.matches = {DMI_EXACT_MATCH(DMI_SYS_VENDOR, "HP"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ZBook Power 15.6 inch G10 Mobile Workstation PC"),
+					    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "83Q13AA#ABA"),
+				},
+			},
+			{ }
+		},
+		.hook = quirk_multiple_vbt_devices,
+	},
+};
+
 static struct intel_quirk intel_quirks[] = {
 	/* Lenovo U160 cannot use SSC on LVDS */
 	{ 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable },
@@ -224,6 +469,16 @@  void intel_init_quirks(struct drm_i915_private *i915)
 	}
 }
 
+void intel_init_quirks_early(struct drm_i915_private *i915)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(intel_dmi_quirks_early); i++) {
+		if (dmi_check_system(*intel_dmi_quirks_early[i].dmi_id_list) != 0)
+			intel_dmi_quirks_early[i].hook(i915);
+	}
+}
+
 bool intel_has_quirk(struct drm_i915_private *i915, enum intel_quirk_id quirk)
 {
 	return i915->display.quirks.mask & BIT(quirk);
diff --git a/drivers/gpu/drm/i915/display/intel_quirks.h b/drivers/gpu/drm/i915/display/intel_quirks.h
index 10a4d163149f..4faa16e46882 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.h
+++ b/drivers/gpu/drm/i915/display/intel_quirks.h
@@ -17,9 +17,11 @@  enum intel_quirk_id {
 	QUIRK_INVERT_BRIGHTNESS,
 	QUIRK_LVDS_SSC_DISABLE,
 	QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK,
+	QUIRK_MULTIPLE_VBT_DEVICES,
 };
 
 void intel_init_quirks(struct drm_i915_private *i915);
+void intel_init_quirks_early(struct drm_i915_private *i915);
 bool intel_has_quirk(struct drm_i915_private *i915, enum intel_quirk_id quirk);
 
 #endif /* __INTEL_QUIRKS_H__ */