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 21:17:14 +0300 Message-ID: <20100621181714.GN17817@reaktio.net> References: <20100603153045.GF17817@reaktio.net> <20100603160706.GG17817@reaktio.net> <20100609155956.GZ17817@reaktio.net> <20100618184522.GY17817@reaktio.net> <20100619192453.GS17817@reaktio.net> <20100621092310.GD17817@reaktio.net> <20100621093122.GE17817@reaktio.net> <20100621124544.GD2350@barney.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from ydin.reaktio.net (reaktio.net [194.89.68.22]) by gabe.freedesktop.org (Postfix) with ESMTP id D77079E90F for ; Mon, 21 Jun 2010 11:17:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: 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 On Mon, Jun 21, 2010 at 11:03:08AM -0400, Alex Deucher wrote: > On Mon, Jun 21, 2010 at 8:45 AM, Jerome Glisse w= rote: > > On Mon, Jun 21, 2010 at 12:31:22PM +0300, Pasi K=E4rkk=E4inen wrote: > >> 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 wrot= e: > >> > > > > > > >> > > >> > > > > > > >> > I wonder if that HDMI-0 is the key to the problem.. I= don't have anything connected > >> > > > > > > >> > to the HDMI connector on the laptop. There's no HDMI = connector 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 c= ome 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 base= d on the EDID, > >> > > > > > > >> but perhaps that got broken at some point. > >> > > > > > > >> > >> > > > > > > > > >> > > > > > > > Makes sense. Does some kernel option/parameter affect th= at? > >> > > > > > > > >> > > > > > > No. =A0I'll check the code and see if I can figure out wha= t's going on. > >> > > > > > > > >> > > > > > > >> > > > > > Ok, thanks! > >> > > > > > > >> > > > > > >> > > > > Hello, > >> > > > > > >> > > > > I'll be near the dock tomorrow.. So if you have a chance of lo= oking at this, and want me to test something, > >> > > > > I could do it on thursday/friday. > >> > > > > > >> > > > > >> > > > I just tried the latest Fedora 13 kernel (2.6.33.5-124.fc13.x86_= 64) and the latest > >> > > > Fedora development (rawhide 2.6.34-43.fc14.x86_64) kernel, but t= he behaviour was the same. > >> > > > > >> > > > Connecting display to the DVI connector makes the HDMI connector= also show the same display, > >> > > > breaking things.. > >> > > > > >> > > > >> > > Here's a new log with drm.debug=3D4.. that's the biggest debug lev= el that still allows me to grab > >> > > the whole dmesg log before it's overwritten by huge amount of debu= g messages. > >> > > > >> > > Full dmesg log: > >> > > http://pasik.reaktio.net/fedora/bz593429/both-internal-and-externa= l-displays-active/dmesg-with-drmdebug4.txt > >> > > > >> > > >> > Ok.. I did some debugging, and figured out how to make it work. Patc= h attached. > >> > I'm not sure if this is the correct method.. someone familiar with t= he code should review it. > >> > > >> > > >> > Some debugging information for my system (HP EliteBook 8530p): > >> > > >> > > > >> > > [drm] Radeon Display Connectors > >> > > [drm] Connector 0: > >> > > [drm] =A0 VGA > >> > > [drm] =A0 DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x= 7e4c > >> > > [drm] =A0 Encoders: > >> > > [drm] =A0 =A0 CRT1: INTERNAL_KLDSCP_DAC1 > >> > > >> > connector->devices for VGA is: 1 > >> > > >> > > [drm] Connector 1: > >> > > [drm] =A0 LVDS > >> > > [drm] =A0 Encoders: > >> > > [drm] =A0 =A0 LCD1: INTERNAL_KLDSCP_LVTMA > >> > > >> > connector->devices for LVDS is: 2 > >> > > >> > > [drm] Connector 2: > >> > > [drm] =A0 DVI-D > >> > > [drm] =A0 HPD1 > >> > > [drm] =A0 DDC: 0x7e60 0x7e60 0x7e64 0x7e64 0x7e68 0x7e68 0x7e6c 0x= 7e6c > >> > > [drm] =A0 Encoders: > >> > > [drm] =A0 =A0 DFP1: INTERNAL_UNIPHY > >> > > >> > connector->devices for DVI-D is: 8 > >> > > >> > > [drm] Connector 3: > >> > > [drm] =A0 HDMI-A > >> > > [drm] =A0 HPD2 > >> > > [drm] =A0 DDC: 0x7e60 0x7e60 0x7e64 0x7e64 0x7e68 0x7e68 0x7e6c 0x= 7e6c > >> > > [drm] =A0 Encoders: > >> > > [drm] =A0 =A0 DFP2: INTERNAL_UNIPHY > >> > > >> > connector->devices for HDMI-A is: 128 > >> > > >> > > >> > > >> > The code in radeon_connectors.c in radeon_dvi_detect(): > >> > > >> > =A0 =A0 /* multiple connectors on the same encoder with the same ddc= line > >> > =A0 =A0 =A0* This tends to be HDMI and DVI on the same encoder with = the > >> > =A0 =A0 =A0* same ddc line. =A0If the edid says HDMI, consider the H= DMI port > >> > =A0 =A0 =A0* connected and the DVI port disconnected. =A0If the edid= doesn't > >> > =A0 =A0 =A0* say HDMI, vice versa. > >> > =A0 =A0 =A0*/ > >> > =A0 =A0 if (radeon_connector->shared_ddc && (ret =3D=3D connector_st= atus_connected)) { > >> > =A0 =A0 =A0 =A0 =A0 =A0 struct drm_device *dev =3D connector->dev; > >> > =A0 =A0 =A0 =A0 =A0 =A0 struct drm_connector *list_connector; > >> > =A0 =A0 =A0 =A0 =A0 =A0 struct radeon_connector *list_radeon_connect= or; > >> > =A0 =A0 =A0 =A0 =A0 =A0 list_for_each_entry(list_connector, &dev->mo= de_config.connector_list, head) { > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (connector =3D=3D list_co= nnector) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 list_radeon_connector =3D to= _radeon_connector(list_connector); > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (radeon_connector->device= s =3D=3D list_radeon_connector->devices) { > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (drm_dete= ct_hdmi_monitor(radeon_connector->edid)) { > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 if (connector->connector_type =3D=3D DRM_MODE_CONNECTOR_DVID) { > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 kfree(radeon_connector->edid); > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 radeon_connector->edid =3D NULL; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 ret =3D connector_status_disconnected; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 } > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 if ((connector->connector_type =3D=3D DRM_MODE_CONNECTOR_HDMIA) || > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 (connector->connector_type =3D=3D DRM_MODE_CONNECTOR_HDMIB)) { > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 kfree(radeon_connector->edid); > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 radeon_connector->edid =3D NULL; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 ret =3D connector_status_disconnected; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 } > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > >> > =A0 =A0 =A0 =A0 =A0 =A0 } > >> > =A0 =A0 } > >> > > >> > > >> > Ok, so at least on my system the "if (connector =3D=3D list_connecto= r)" will SKIP the connector > >> > that actually would match in "if (radeon_connector->devices =3D=3D l= ist_radeon_connector->devices)", > >> > and thus the drm_detect_hdmi_monitor() is never called. > >> > > >> > My patch removes that "if (connector =3D=3D list_connector)" check a= nd fixes the problem on my system. > >> > Is this the correct way to do it? > >> > > >> > radeon-fix-shared_ddc-dvi-hdmi-edid-detection.patch: > >> > =A0 =A0 - allow checking against all connectors to be able to proper= ly detect shared_ddc dvi/hdmi displays > >> > =A0 =A0 - patch applies to 2.6.33.5, 2.6.34 and 2.6.35-rc3. Tested w= ith Fedora 13 2.6.33.5-124.fc13.x86_64. > >> > =A0 =A0 - Signed-off-by: Pasi K=E4rkk=E4inen > >> > > >> > >> And actually attached now :) > >> > >> -- Pasi > > > > I am not sure your patch is right, my guess is that devices field of > > radeon connector structure btw the HDMI & DVI connector are different > > and thus that drm_detect_hdmi_monitor is not call. I expect it's normal > > for the device field to be different (my understanding being that HDMI > > will have one more bit set than the DVI connector). Bottom line is > > i think we want to discard non hdmi connector just in case we face > > shared connector. > > > > Alex would have to comment on the device field test, maybe your atombios > > is broken. Does it works if instead of removing > > if (connector =3D=3D list_connector) > > =A0 =A0 =A0 =A0continue; > > You remove : > > if (radeon_connector->devices =3D=3D list_radeon_connector->devices) > > > > Also can you print the radeon_connector->devices of all your connector > > so we can compare them. > = > The code was for systems with shared ddc lines and shared encoders, > but it looks like your system may have a shared ddc line and (sort of) > non-shared encoders. I suspect the DVI port is using UNIPHY A or A+B > (for dual link) and HDMI is using UNIPHY link B. It's probably > actually using router objects (gpio toggle to switch gpio routing > between physical ports), however support for that is not implemented > yet which is why we have the current code. Can you send me a copy of > your vbios so I can verify? > = > To access your vbios (as root): > cd /sys/bus/pci/device/ > echo 1 > rom > cat rom > /tmp/vbios.rom > echo 0 > rom > = Here you are: http://pasik.reaktio.net/fedora/bz593429/vbios-hp-elitebook-8530p-ati-radeo= n-hd3650.rom # lspci -vv 01:00.0 VGA compatible controller: ATI Technologies Inc Mobility Radeon HD = 3650 (prog-if 00 [VGA controller]) Subsystem: Hewlett-Packard Company Device 30e7 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-= Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort- SERR- Kernel driver in use: radeon Kernel modules: radeon 01:00.1 Audio device: ATI Technologies Inc RV635 Audio device [Radeon HD 36= 00 Series] Subsystem: ATI Technologies Inc RV635 Audio device [Radeon HD 3600 = Series] Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-= Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort- SERR- Kernel driver in use: HDA Intel Kernel modules: snd-hda-intel -- Pasi