diff mbox

drm/i915: don't setup hdmi for port D edp in ddi_init

Message ID 1365629315-21878-1-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter April 10, 2013, 9:28 p.m. UTC
dp_init_connector adjusts the encoder type if it is a eDP panel. Use
that to decide whether we should set up a hdmi connector or not.

To do so reorder the hdmi connector setup sequence in ddi_init a bit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_ddi.c |   25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

Comments

Daniel Vetter May 4, 2013, 9:45 a.m. UTC | #1
On Wed, Apr 10, 2013 at 11:28:35PM +0200, Daniel Vetter wrote:
> dp_init_connector adjusts the encoder type if it is a eDP panel. Use
> that to decide whether we should set up a hdmi connector or not.
> 
> To do so reorder the hdmi connector setup sequence in ddi_init a bit.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Does what it says on the tin and works as advertised on my deskop hsw
machine with edp on port D. Can someone please review?

Thanks, Daniel
Ville Syrjala May 6, 2013, 8:31 a.m. UTC | #2
On Sat, May 04, 2013 at 11:45:33AM +0200, Daniel Vetter wrote:
> On Wed, Apr 10, 2013 at 11:28:35PM +0200, Daniel Vetter wrote:
> > dp_init_connector adjusts the encoder type if it is a eDP panel. Use
> > that to decide whether we should set up a hdmi connector or not.
> > 
> > To do so reorder the hdmi connector setup sequence in ddi_init a bit.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Does what it says on the tin and works as advertised on my deskop hsw
> machine with edp on port D. Can someone please review?

Looks all right to me.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Daniel Vetter May 6, 2013, 9:19 a.m. UTC | #3
On Mon, May 06, 2013 at 11:31:57AM +0300, Ville Syrjälä wrote:
> On Sat, May 04, 2013 at 11:45:33AM +0200, Daniel Vetter wrote:
> > On Wed, Apr 10, 2013 at 11:28:35PM +0200, Daniel Vetter wrote:
> > > dp_init_connector adjusts the encoder type if it is a eDP panel. Use
> > > that to decide whether we should set up a hdmi connector or not.
> > > 
> > > To do so reorder the hdmi connector setup sequence in ddi_init a bit.
> > > 
> > > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > 
> > Does what it says on the tin and works as advertised on my deskop hsw
> > machine with edp on port D. Can someone please review?
> 
> Looks all right to me.
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Queued for -next, thanks for the review.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 22524cb..649bb81 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1513,16 +1513,6 @@  void intel_ddi_init(struct drm_device *dev, enum port port)
 		return;
 	}
 
-	if (port != PORT_A) {
-		hdmi_connector = kzalloc(sizeof(struct intel_connector),
-					 GFP_KERNEL);
-		if (!hdmi_connector) {
-			kfree(dp_connector);
-			kfree(intel_dig_port);
-			return;
-		}
-	}
-
 	intel_encoder = &intel_dig_port->base;
 	encoder = &intel_encoder->base;
 
@@ -1540,8 +1530,6 @@  void intel_ddi_init(struct drm_device *dev, enum port port)
 	intel_dig_port->port = port;
 	intel_dig_port->port_reversal = I915_READ(DDI_BUF_CTL(port)) &
 					DDI_BUF_PORT_REVERSAL;
-	if (hdmi_connector)
-		intel_dig_port->hdmi.hdmi_reg = DDI_BUF_CTL(port);
 	intel_dig_port->dp.output_reg = DDI_BUF_CTL(port);
 
 	intel_encoder->type = INTEL_OUTPUT_UNKNOWN;
@@ -1549,7 +1537,16 @@  void intel_ddi_init(struct drm_device *dev, enum port port)
 	intel_encoder->cloneable = false;
 	intel_encoder->hot_plug = intel_ddi_hot_plug;
 
-	if (hdmi_connector)
-		intel_hdmi_init_connector(intel_dig_port, hdmi_connector);
 	intel_dp_init_connector(intel_dig_port, dp_connector);
+
+	if (intel_encoder->type != INTEL_OUTPUT_EDP) {
+		hdmi_connector = kzalloc(sizeof(struct intel_connector),
+					 GFP_KERNEL);
+		if (!hdmi_connector) {
+			return;
+		}
+
+		intel_dig_port->hdmi.hdmi_reg = DDI_BUF_CTL(port);
+		intel_hdmi_init_connector(intel_dig_port, hdmi_connector);
+	}
 }