[PATCH 6/6] drm/i915: Ignore LFP2 for now

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

There are tons of ADL machines in the wild where the VBT has
two child devices (eDP and HDMI) for port B. Our code can't
handle that as the whole parse_ddi_port() stuff assumes a
single child device per port. So even if we fix the PPS issues
around the (typically) non-present second eDP port we still
won't be able to use the HDMI port after the eDP init fails.

The easiest way to get the HDMI port operational is to just
ignore the second eDP child device entirely. Dual eDP systems
should be exceedingly rare anyway.

Cc: Animesh Manna <animesh.manna@xxxxxxxxx>
Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 31 ++++++++++++++++++++---
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 64f927f6479d..1011ccc2836b 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -2705,10 +2705,33 @@ static void parse_ddi_port(struct intel_bios_encoder_data *devdata)
 	}
 
 	if (i915->display.vbt.ports[port]) {
-		drm_dbg_kms(&i915->drm,
-			    "More than one child device for port %c in VBT, using the first.\n",
-			    port_name(port));
-		return;
+		const struct child_device_config *other_child =
+			&i915->display.vbt.ports[port]->child;
+
+		/*
+		 * FIXME: Temporary hack for many ADL machines where
+		 * the VBT declares two eDPs, the second of which
+		 * conflicts with an external HDMI port. Ideally
+		 * we should fall back to consulting the HDMI port
+		 * child device after the eDP init fails, but that
+		 * does not work with the current port based
+		 * i915->display.vbt.ports[] stuff.
+		 *
+		 * Hopefully this does not conflict with any other
+		 * bogus VBT case...
+		 */
+		if (other_child->handle == DEVICE_HANDLE_LFP2 &&
+		    child->handle != DEVICE_HANDLE_LFP2) {
+			drm_dbg_kms(&i915->drm,
+				    "More than one child device for port %c in VBT, using the last.\n",
+				    port_name(port));
+			i915->display.vbt.ports[port] = NULL;
+		} else {
+			drm_dbg_kms(&i915->drm,
+				    "More than one child device for port %c in VBT, using the first.\n",
+				    port_name(port));
+			return;
+		}
 	}
 
 	sanitize_device_type(devdata, port);
-- 
2.37.4




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux