Bug 32612

Summary: Issues when vga monitor connected
Product: Drivers Reporter: Riccardo Magliocchetti (riccardo.magliocchetti)
Component: Video(DRI - Intel)Assignee: drivers_video-dri-intel (drivers_video-dri-intel)
Status: CLOSED CODE_FIX    
Severity: normal CC: chris, florian
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 78fca1b95837a44983608302e89c7258981be9b3 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: 2.6.39-rc1 dmesg
2.6.39-rc1 xrandr
2.6.36 dmesg
2.6.36 xrandr
Reset GMBUS after NAK
Remove CRT 0xa0 probe
dmesg with patches and debug
Initialise g4x watermarks for disabled pipes.
dmesg with watermark patch
dmesg with patches on top of updated git

Description Riccardo Magliocchetti 2011-04-04 07:17:52 UTC
Created attachment 53372 [details]
2.6.39-rc1 dmesg

When i attach an external vga monitor to a GM45 laptop lvds panel is off and external monitor works at max 1024x768 vs its native 1600x1200.

IIRC 2.6.38-rc7 was working fine but i don't have it around anymore, 2.6.36 is working fine.

Userspace is drm 2.4.23 and video-intel 2.14.0.
Comment 1 Riccardo Magliocchetti 2011-04-04 07:18:16 UTC
Created attachment 53382 [details]
2.6.39-rc1 xrandr
Comment 2 Riccardo Magliocchetti 2011-04-04 07:18:42 UTC
Created attachment 53392 [details]
2.6.36 dmesg
Comment 3 Riccardo Magliocchetti 2011-04-04 07:19:11 UTC
Created attachment 53402 [details]
2.6.36 xrandr
Comment 4 Chris Wilson 2011-04-04 07:27:06 UTC
Created attachment 53412 [details]
Reset GMBUS after NAK
Comment 5 Chris Wilson 2011-04-04 07:27:31 UTC
Created attachment 53422 [details]
Remove CRT 0xa0 probe
Comment 6 Riccardo Magliocchetti 2011-04-04 17:02:28 UTC
With both patches attached the vga monitor has the proper resolution out of the box. Still the lvds panel is off by default which is a different behavior from what it used to but i don't know if this is intended or not.
If you want you can add a:
Tested-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Thanks!
Comment 7 Chris Wilson 2011-04-04 17:19:44 UTC
(In reply to comment #6)
> With both patches attached the vga monitor has the proper resolution out of
> the
> box. Still the lvds panel is off by default which is a different behavior
> from
> what it used to but i don't know if this is intended or not.

Can you please grab a drm.debug=0xe (add that to your grub kernel parameters) dmesg? Hopefully I'll be able to tell what's going on with the panel from that.
Comment 8 Riccardo Magliocchetti 2011-04-04 17:30:55 UTC
Created attachment 53452 [details]
dmesg with patches and debug
Comment 9 Riccardo Magliocchetti 2011-04-04 17:33:08 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > With both patches attached the vga monitor has the proper resolution out of
> the
> > box. Still the lvds panel is off by default which is a different behavior
> from
> > what it used to but i don't know if this is intended or not.
> 
> Can you please grab a drm.debug=0xe (add that to your grub kernel parameters)
> dmesg? Hopefully I'll be able to tell what's going on with the panel from
> that.

Attached, thanks.
Comment 10 Chris Wilson 2011-04-04 17:47:57 UTC
Created attachment 53462 [details]
Initialise g4x watermarks for disabled pipes.

Well this should make a difference at least...
Comment 11 Riccardo Magliocchetti 2011-04-05 12:17:03 UTC
Created attachment 53552 [details]
dmesg with watermark patch

I booted two times with this patch, the first one the vga monitor has a 640x480 resolution but that looks like another issue, unfortunately debug was off. lvds is still off.
Comment 12 Riccardo Magliocchetti 2011-04-05 12:20:37 UTC
Ah and there were 29 lines of delta so probably i'm missing some patches. I've seen Linus pulled at least one of these patches, should retest against latest git?
Comment 13 Chris Wilson 2011-04-05 12:26:42 UTC
Oh, the LVDS is that old chestnut...

linus/master commit 6ee3b5a12740eddc5a76e130b6cc7cc64468d1f7
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Mar 24 13:26:43 2011 +0000

    drm/i915/lvds: Always return connected in the absence of better information
    
    The LVDS connector should default to connected. We tried our best to
    verify the claims of the BIOS that the hardware exists during init(),
    and then during detect() we then try to verify that the panel is open.
    In the event of an unsuccessful query, we should then always report
    that the LVDS panel is connected. This was only the case for gen2/3,
    later generations leaked the return value from the panel probe instead.
    
    Reported-and-tested-by: Alessandro Suardi <alessandro.suardi@gmail.com>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Keith Packard <keithp@keithp.com>

We're almost there... Just capture what goes wrong with VGA at 640x480 with a debug dmesg and we can call it a day! :)
Comment 14 Riccardo Magliocchetti 2011-04-05 16:02:16 UTC
Created attachment 53562 [details]
dmesg with patches on top of updated git

So i've updated to latest git which include drm merge, now it is back to 2.6.36 state, and 2.6.38 too for what i can say, where under X LVDS and VGA are both at 1024x768 because the X screen is duplicated on each monitor.
Comment 15 Chris Wilson 2011-04-06 06:30:22 UTC
Marking as closed since we seem to have restored stable behaviour.

Riccardo, if you can reproduce the bogus VGA resolution and can capture a debug dmesg and intel_reg_dumper for it, please do file a new bug.
Comment 16 Riccardo Magliocchetti 2011-04-06 07:00:20 UTC
A last question, is technically possible to have proper native resolution for LVDS and VGA out of the box even if by default they show the same screen? Anyway thanks for the prompt response!
Comment 17 Chris Wilson 2011-04-06 07:03:32 UTC
Yes, I think it is possible to set per-connector modes using video=
Comment 18 Florian Mickler 2011-04-06 09:49:44 UTC
A patch referencing this bug report has been merged in 1:

commit 0de009c900e7ebd21097797f723a40813e953879
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Apr 5 16:04:39 2011 +0100

    drm/i915/crt: Remove 0xa0 probe for VGA
Comment 19 Florian Mickler 2011-04-27 06:16:19 UTC
A patch referencing this bug report has been merged in v2.6.39-rc5:

commit 5c72d064f7ead1126bed6faab0c2bfb7418036e2
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Apr 13 09:28:23 2011 +0100

    drm/i915: Initialise g4x watermarks for disabled pipes