From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 19/24] drm/i915: detect digital outputs on Haswell Date: Mon, 30 Apr 2012 17:27:50 -0700 Message-ID: <20120430172750.2f3340f3@jbarnes-desktop> References: <1335464479-648-1-git-send-email-eugeni.dodonov@intel.com> <1335464479-648-20-git-send-email-eugeni.dodonov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy7-pub.bluehost.com (oproxy7-pub.bluehost.com [67.222.55.9]) by gabe.freedesktop.org (Postfix) with SMTP id B26EE9EF60 for ; Mon, 30 Apr 2012 17:27:52 -0700 (PDT) In-Reply-To: <1335464479-648-20-git-send-email-eugeni.dodonov@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Eugeni Dodonov Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, 26 Apr 2012 15:21:14 -0300 Eugeni Dodonov wrote: > Digital port detection on Haswell is indicated by the presence of a bit in > DDI_BUF_CTL for port A, and by a different register for ports B, C and D. > So we check for those bits during the initialization time and let the hdmi > function know about those. > > Note that this bit does not indicates whether the output is DP or HDMI. > However, the DDI buffers can be programmed in a way that is shared between > DP/HDMI and FDI/HDMI except for PORT E. > > So for now, we detect those digital outputs as being HDMI, but proper DP > support is still pending. > > Note that DDI A can only drive eDP, so we do not handle it here for hdmi > initialization. > > v2: simplify Haswell handling logic > > v3: use generic function for handling digital outputs. > > Signed-off-by: Eugeni Dodonov > --- > drivers/gpu/drm/i915/intel_ddi.c | 29 +++++++++++++++++++++++++++++ > drivers/gpu/drm/i915/intel_display.c | 21 ++++++++++++++++++++- > drivers/gpu/drm/i915/intel_drv.h | 1 + > 3 files changed, 50 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c > index 93436caa..cd6fbaa 100644 > --- a/drivers/gpu/drm/i915/intel_ddi.c > +++ b/drivers/gpu/drm/i915/intel_ddi.c > @@ -230,3 +230,32 @@ void ddi_fdi_link_train(struct drm_crtc *crtc) > if (IS_HASWELL(dev)) > hsw_fdi_link_train(crtc); > } > + > +/* For DDI connections, it is possible to support different outputs over the > + * same DDI port, such as HDMI or DP or even VGA via FDI. So we don't know by > + * the time the output is detected what exactly is on the other end of it. This > + * function aims at providing support for this detection and proper output > + * configuration. > + */ > +void intel_ddi_init(struct drm_device *dev, enum port port) > +{ > + /* For now, we don't do any proper output detection and assume that we > + * handle HDMI only */ > + > + switch(port){ > + case PORT_A: > + /* We don't handle eDP and DP yet */ > + DRM_DEBUG_DRIVER("Found digital output on DDI port A\n"); > + break; > + /* Assume that the ports B, C and D are working in HDMI mode for now */ > + case PORT_B: > + case PORT_C: > + case PORT_D: > + intel_hdmi_init(dev, DDI_BUF_CTL(port)); > + break; > + default: > + DRM_DEBUG_DRIVER("No handlers defined for port %d, skipping DDI initialization\n", > + port); > + break; > + } > +} We really really need to get the port detection working on HSW using the VBT. -- Jesse Barnes, Intel Open Source Technology Center