Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 6/6] drm/i915: Ignore LFP2 for now
Date: Wed,  9 Nov 2022 13:16:49 +0200	[thread overview]
Message-ID: <20221109111649.23062-7-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20221109111649.23062-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 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


  parent reply	other threads:[~2022-11-09 11:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 11:16 [Intel-gfx] [PATCH 0/6] drm/i915: Fake dual eDP VBT fixes Ville Syrjala
2022-11-09 11:16 ` [Intel-gfx] [PATCH 1/6] drm/i915: Introduce intel_panel_init_alloc() Ville Syrjala
2022-11-09 14:49   ` Jani Nikula
2022-11-09 11:16 ` [Intel-gfx] [PATCH 2/6] drm/i915: Do panel VBT init early if the VBT declares an explicit panel type Ville Syrjala
2022-11-09 14:59   ` Jani Nikula
2022-11-09 11:16 ` [Intel-gfx] [PATCH 3/6] drm/i915: Generalize the PPS vlv_pipe_check() stuff Ville Syrjala
2022-11-09 15:24   ` Jani Nikula
2022-11-09 11:16 ` [Intel-gfx] [PATCH 4/6] drm/i915: Try to use the correct power sequencer intiially on bxt/glk Ville Syrjala
2022-11-10 13:56   ` Manna, Animesh
2022-11-10 14:41     ` Ville Syrjälä
2022-11-10 19:30       ` Ville Syrjälä
2022-11-09 11:16 ` [Intel-gfx] [PATCH 5/6] drm/915: Extend dual PPS handlind for ICP+ Ville Syrjala
2022-11-10 14:09   ` Manna, Animesh
2022-11-10 14:45   ` Ville Syrjälä
2022-11-09 11:16 ` Ville Syrjala [this message]
2022-11-09 11:31   ` [Intel-gfx] [PATCH 6/6] drm/i915: Ignore LFP2 for now Ville Syrjälä
2022-11-09 14:03 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Fake dual eDP VBT fixes Patchwork
2022-11-09 14:25 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-09 19:22 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221109111649.23062-7-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox