[Intel-gfx] [PATCH] drm/i915/bxt: fix intel_prepare_ddi for DSI ports

Imre Deak imre.deak at intel.com
Wed Jun 17 06:12:49 PDT 2015


BXT introduces DSI ports, for which we need to skip the DDI port setup.
Also there is no real reason for having a BUG for unknown port types so
convert it to a WARN.

Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 31b29e8..9ae297a 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -210,7 +210,7 @@ static const struct bxt_ddi_buf_trans bxt_ddi_translations_hdmi[] = {
 	{ 154, 0x9A, 1, 128, true },	/* 9:	1200		0   */
 };
 
-static void ddi_get_encoder_port(struct intel_encoder *intel_encoder,
+static bool ddi_get_encoder_port(struct intel_encoder *intel_encoder,
 				 struct intel_digital_port **dig_port,
 				 enum port *port)
 {
@@ -228,9 +228,10 @@ static void ddi_get_encoder_port(struct intel_encoder *intel_encoder,
 		*dig_port = NULL;
 		*port = PORT_E;
 	} else {
-		DRM_ERROR("Invalid DDI encoder type %d\n", type);
-		BUG();
+		return false;
 	}
+
+	return true;
 }
 
 enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder)
@@ -238,7 +239,8 @@ enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder)
 	struct intel_digital_port *dig_port;
 	enum port port;
 
-	ddi_get_encoder_port(intel_encoder, &dig_port, &port);
+	if (WARN_ON(!ddi_get_encoder_port(intel_encoder, &dig_port, &port)))
+		return PORT_A;
 
 	return port;
 }
@@ -390,7 +392,8 @@ void intel_prepare_ddi(struct drm_device *dev)
 		enum port port;
 		bool supports_hdmi;
 
-		ddi_get_encoder_port(intel_encoder, &intel_dig_port, &port);
+		if (!ddi_get_encoder_port(intel_encoder, &intel_dig_port, &port))
+			continue;
 
 		if (visited[port])
 			continue;
-- 
2.1.4



More information about the Intel-gfx mailing list