Bug 29387

Summary: [KMS] DVI-0 connected, but shown as HDMI-0; regression
Product: xorg Reporter: Oldrich Jedlicka <oldium.pro>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg
none
Xorg.0.log
none
`xrandr --verbose`
none
dmesg after your patch
none
Xorg.0.log after your patch
none
`xrandr --verbose` after your patch
none
add quirk
none
add quirk
none
dmesg after your "add quirk" patch
none
Xorg.0.log after your "add quirk" patch
none
`xrandr --verbose` after your "add quirk" patch none

Description Oldrich Jedlicka 2010-08-03 11:33:25 UTC
Latest git kernel (drm-radeon-testing), mesa, libdrm and xf86-video-ati started to show my DVI-0 as HDMI-0. DVI-0 is shown as disconnected, changing modes through HDMI-0 works. My monitor is connected DVI.

I have ATI Mobility Radeon HD 3470, xorg-server 1.8.2, kernel (git drm-radeon-testing), mesa (git master), libdrm (git master), xf86-video-ati (git master).

It used to work. For reference, fixes of outputs on my machine - bug #26616 (KMS), bug #25150 (KMS), bug #21767 (non-KMS, has the ATI BIOS attached).

dmesg, X.log.0, xrandr output attached.
Comment 1 Oldrich Jedlicka 2010-08-03 11:34:25 UTC
Created attachment 37549 [details]
dmesg
Comment 2 Oldrich Jedlicka 2010-08-03 11:34:51 UTC
Created attachment 37550 [details]
Xorg.0.log
Comment 3 Oldrich Jedlicka 2010-08-03 11:35:19 UTC
Created attachment 37551 [details]
`xrandr --verbose`
Comment 4 Alex Deucher 2010-08-03 11:47:47 UTC
Perhaps the hpd pins are reversed on your system.  Does the following hack fix it?

--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -173,10 +173,10 @@ static struct radeon_hpd radeon_atom_get_hpd_info_from_gpio(struct radeon_device
        if (gpio->reg == reg) {
                switch(gpio->mask) {
                case (1 << 0):
-                       hpd.hpd = RADEON_HPD_1;
+                       hpd.hpd = RADEON_HPD_2;
                        break;
                case (1 << 8):
-                       hpd.hpd = RADEON_HPD_2;
+                       hpd.hpd = RADEON_HPD_1;
                        break;
                case (1 << 16):
                        hpd.hpd = RADEON_HPD_3;
Comment 5 Oldrich Jedlicka 2010-08-03 12:37:52 UTC
I'm not sure if there is something reversed (because it worked long time before), but your patch works.

I cannot verify if the HDMI port works as expected, I don't have any HDMI device...
Comment 6 Oldrich Jedlicka 2010-08-03 12:39:51 UTC
Created attachment 37554 [details]
dmesg after your patch
Comment 7 Oldrich Jedlicka 2010-08-03 12:40:15 UTC
Created attachment 37555 [details]
Xorg.0.log after your patch
Comment 8 Oldrich Jedlicka 2010-08-03 12:40:38 UTC
Created attachment 37556 [details]
`xrandr --verbose` after your patch
Comment 9 Alex Deucher 2010-08-03 14:05:29 UTC
(In reply to comment #5)
> I'm not sure if there is something reversed (because it worked long time
> before), but your patch works.

The original fix worked by accident since it always chose the DVI port if the edid did not contain the hdmi flag.  Unfortunately, it didn't work properly with HDMI to DVI converters and monitors without the hdmi flag in the edid.
Comment 10 Alex Deucher 2010-08-03 14:08:28 UTC
It doesn't really matter as both the hdmi and dvi ports use the same encoder and ddc channel so the signal will be the same on either one and you cannot use them both at the same time with independent timing.
Comment 11 Alex Deucher 2010-08-03 14:10:36 UTC
What are the pci ids for your card (lspci -vnn) so I can add a quirk?
Comment 12 Oldrich Jedlicka 2010-08-03 22:04:16 UTC
Here is the ATI section of my `lspci -vnn`:

01:00.0 VGA compatible controller [0300]: ATI Technologies Inc Mobility Radeon HD 3400 Series [1002:95c4] (prog-if 00 [VGA controller])
        Subsystem: Acer Incorporated [ALI] Device [1025:013c]
        Flags: bus master, fast devsel, latency 0, IRQ 44
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        Memory at cfef0000 (64-bit, non-prefetchable) [size=64K]
        I/O ports at 2000 [size=256]
        [virtual] Expansion ROM at cfe00000 [disabled] [size=128K]
        Capabilities: [50] Power Management version 3
        Capabilities: [58] Express Legacy Endpoint, MSI 00
        Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [100] Vendor Specific Information <?>
        Kernel driver in use: radeon

01:00.1 Audio device [0403]: ATI Technologies Inc RV620 Audio device [Radeon HD 34xx Series] [1002:aa28]
        Subsystem: ATI Technologies Inc RV620 Audio device [Radeon HD 34xx Series] [1002:aa28]
        Flags: bus master, fast devsel, latency 0, IRQ 47
        Memory at cfeec000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [50] Power Management version 3
        Capabilities: [58] Express Legacy Endpoint, MSI 00
        Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [100] Vendor Specific Information <?>
        Kernel driver in use: HDA Intel
Comment 13 Alex Deucher 2010-08-03 23:05:13 UTC
Created attachment 37562 [details] [review]
add quirk

This patch should fix it.
Comment 14 Oldrich Jedlicka 2010-08-05 12:57:58 UTC
(In reply to comment #13)
> Created an attachment (id=37562) [details]
> add quirk
> 
> This patch should fix it.

Doesn't work. There is one section for my laptop already, but removing it and keeping your latest changes fixes the problem. So your patch works when the old section gets removed.
Comment 15 Alex Deucher 2010-08-05 13:17:08 UTC
Created attachment 37602 [details] [review]
add quirk

Updated patch.
Comment 16 Oldrich Jedlicka 2010-08-05 21:24:37 UTC
(In reply to comment #15)
> Created an attachment (id=37602) [details]
> add quirk
> 
> Updated patch.

The updated patch works. Thanks!
Comment 17 Oldrich Jedlicka 2010-08-05 21:25:51 UTC
Created attachment 37615 [details]
dmesg after your "add quirk" patch
Comment 18 Oldrich Jedlicka 2010-08-05 21:26:18 UTC
Created attachment 37616 [details]
Xorg.0.log after your "add quirk" patch
Comment 19 Oldrich Jedlicka 2010-08-05 21:26:40 UTC
Created attachment 37617 [details]
`xrandr --verbose` after your "add quirk" patch
Comment 20 Alex Deucher 2010-08-05 21:28:24 UTC
I've sent the patch upstream.
Comment 21 madbiologist 2010-08-16 07:13:37 UTC
The patch has been included in kernel 2.6.36-rc1

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.