From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= Subject: Re: [RFC PATCH] Re: KMS:RV635:Radeon 3650HD graphics driver broken on a laptop when connected to a docking station and external display Date: Mon, 21 Jun 2010 12:31:22 +0300 Message-ID: <20100621093122.GE17817@reaktio.net> References: <20100603115617.GY17817@reaktio.net> <20100603153045.GF17817@reaktio.net> <20100603160706.GG17817@reaktio.net> <20100609155956.GZ17817@reaktio.net> <20100618184522.GY17817@reaktio.net> <20100619192453.GS17817@reaktio.net> <20100621092310.GD17817@reaktio.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="AH+kv8CCoFf6qPuz" Content-Transfer-Encoding: 7bit Return-path: Received: from ydin.reaktio.net (reaktio.net [194.89.68.22]) by gabe.freedesktop.org (Postfix) with ESMTP id A474C9E76B for ; Mon, 21 Jun 2010 02:31:20 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20100621092310.GD17817@reaktio.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Alex Deucher Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --AH+kv8CCoFf6qPuz Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 21, 2010 at 12:23:10PM +0300, Pasi K=E4rkk=E4inen wrote: > On Sat, Jun 19, 2010 at 10:24:53PM +0300, Pasi K=E4rkk=E4inen wrote: > > On Fri, Jun 18, 2010 at 09:45:22PM +0300, Pasi K=E4rkk=E4inen wrote: > > > > > > >> > > > > > > > >> > I wonder if that HDMI-0 is the key to the problem.. I do= n't have anything connected > > > > > > >> > to the HDMI connector on the laptop. There's no HDMI con= nector on the dock, it's only in the laptop. > > > > > > >> > > > > > > >> Indeed that is the problem. =A0On your system the HDMI and= DVI ports > > > > > > >> share the same encoder and DDC line so they will both come= up as > > > > > > >> connected since the line is shared. =A0The driver used to = check the edid > > > > > > >> when the lines where shared and select HDMI or DVI based o= n the EDID, > > > > > > >> but perhaps that got broken at some point. > > > > > > >> > > > > > > > > > > > > > > Makes sense. Does some kernel option/parameter affect that? > > > > > >=20 > > > > > > No. I'll check the code and see if I can figure out what's g= oing on. > > > > > >=20 > > > > >=20 > > > > > Ok, thanks! > > > > >=20 > > > >=20 > > > > Hello, > > > >=20 > > > > I'll be near the dock tomorrow.. So if you have a chance of looki= ng at this, and want me to test something, > > > > I could do it on thursday/friday. > > > >=20 > > >=20 > > > I just tried the latest Fedora 13 kernel (2.6.33.5-124.fc13.x86_64)= and the latest=20 > > > Fedora development (rawhide 2.6.34-43.fc14.x86_64) kernel, but the = behaviour was the same. > > >=20 > > > Connecting display to the DVI connector makes the HDMI connector al= so show the same display,=20 > > > breaking things.. > > >=20 > >=20 > > Here's a new log with drm.debug=3D4.. that's the biggest debug level = that still allows me to grab > > the whole dmesg log before it's overwritten by huge amount of debug m= essages. > >=20 > > Full dmesg log: > > http://pasik.reaktio.net/fedora/bz593429/both-internal-and-external-d= isplays-active/dmesg-with-drmdebug4.txt > >=20 >=20 > Ok.. I did some debugging, and figured out how to make it work. Patch a= ttached. > I'm not sure if this is the correct method.. someone familiar with the = code should review it. >=20 >=20 > Some debugging information for my system (HP EliteBook 8530p): >=20 > >=20 > > [drm] Radeon Display Connectors > > [drm] Connector 0: > > [drm] VGA > > [drm] DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c > > [drm] Encoders: > > [drm] CRT1: INTERNAL_KLDSCP_DAC1 >=20 > connector->devices for VGA is: 1 >=20 > > [drm] Connector 1: > > [drm] LVDS > > [drm] Encoders: > > [drm] LCD1: INTERNAL_KLDSCP_LVTMA >=20 > connector->devices for LVDS is: 2 >=20 > > [drm] Connector 2: > > [drm] DVI-D > > [drm] HPD1 > > [drm] DDC: 0x7e60 0x7e60 0x7e64 0x7e64 0x7e68 0x7e68 0x7e6c 0x7e6c > > [drm] Encoders: > > [drm] DFP1: INTERNAL_UNIPHY >=20 > connector->devices for DVI-D is: 8 >=20 > > [drm] Connector 3: > > [drm] HDMI-A > > [drm] HPD2 > > [drm] DDC: 0x7e60 0x7e60 0x7e64 0x7e64 0x7e68 0x7e68 0x7e6c 0x7e6c > > [drm] Encoders: > > [drm] DFP2: INTERNAL_UNIPHY >=20 > connector->devices for HDMI-A is: 128 >=20 >=20 >=20 > The code in radeon_connectors.c in radeon_dvi_detect(): >=20 > /* multiple connectors on the same encoder with the same ddc line > * This tends to be HDMI and DVI on the same encoder with the > * same ddc line. If the edid says HDMI, consider the HDMI port > * connected and the DVI port disconnected. If the edid doesn't > * say HDMI, vice versa. > */ > if (radeon_connector->shared_ddc && (ret =3D=3D connector_status_conne= cted)) { > struct drm_device *dev =3D connector->dev; > struct drm_connector *list_connector; > struct radeon_connector *list_radeon_connector; > list_for_each_entry(list_connector, &dev->mode_config.connector_list,= head) { > if (connector =3D=3D list_connector) > continue; > list_radeon_connector =3D to_radeon_connector(list_connector); > if (radeon_connector->devices =3D=3D list_radeon_connector->devices)= { > if (drm_detect_hdmi_monitor(radeon_connector->edid)) { > if (connector->connector_type =3D=3D DRM_MODE_CONNECTOR_DVID) { > kfree(radeon_connector->edid); > radeon_connector->edid =3D NULL; > ret =3D connector_status_disconnected; > } > } else { > if ((connector->connector_type =3D=3D DRM_MODE_CONNECTOR_HDMIA) || > (connector->connector_type =3D=3D DRM_MODE_CONNECTOR_HDMIB)) { > kfree(radeon_connector->edid); > radeon_connector->edid =3D NULL; > ret =3D connector_status_disconnected; > } > } > } > } > } >=20 >=20 > Ok, so at least on my system the "if (connector =3D=3D list_connector)"= will SKIP the connector > that actually would match in "if (radeon_connector->devices =3D=3D list= _radeon_connector->devices)", > and thus the drm_detect_hdmi_monitor() is never called. >=20 > My patch removes that "if (connector =3D=3D list_connector)" check and = fixes the problem on my system. > Is this the correct way to do it?=20 >=20 > radeon-fix-shared_ddc-dvi-hdmi-edid-detection.patch: > - allow checking against all connectors to be able to properly detect = shared_ddc dvi/hdmi displays > - patch applies to 2.6.33.5, 2.6.34 and 2.6.35-rc3. Tested with Fedora= 13 2.6.33.5-124.fc13.x86_64. > - Signed-off-by: Pasi K=E4rkk=E4inen >=20 And actually attached now :) -- Pasi >=20 > Thanks! >=20 > Btw. I still have some other problems related to lid open/closed detect= ion for the LVDS but I'll open another thread about that :)=20 >=20 > -- Pasi >=20 > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel --AH+kv8CCoFf6qPuz Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="radeon-fix-shared_ddc-dvi-hdmi-edid-detection.patch" --- a/drivers/gpu/drm/radeon/radeon_connectors.c 2010-06-21 11:54:59.684266030 +0300 +++ b/drivers/gpu/drm/radeon/radeon_connectors.c 2010-06-21 11:55:44.362635333 +0300 @@ -790,8 +790,8 @@ struct drm_connector *list_connector; struct radeon_connector *list_radeon_connector; list_for_each_entry(list_connector, &dev->mode_config.connector_list, head) { - if (connector == list_connector) - continue; + /*if (connector == list_connector) + continue;*/ list_radeon_connector = to_radeon_connector(list_connector); if (radeon_connector->devices == list_radeon_connector->devices) { if (drm_detect_hdmi_monitor(radeon_connector->edid)) { --AH+kv8CCoFf6qPuz Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --AH+kv8CCoFf6qPuz--