Bug 59066

Summary: [965g dvi sdvo] mode setting with xrandr does not work reliable
Product: DRI Reporter: Christian Eggers <ceggers>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xrandr --verbose (before mode switching)
none
Output of intel_reg_dump (before mode switching)
none
vbios.dump (before mode switching)
none
Output of intel_reg_dumper (after switching to 1024x768)
none
vbios.dump (after switching to 1024x768)
none
Output of intel_reg_dumper (after switching back to 1600x1200)
none
vbios.dump (after switching back to 1600x1200)
none
Output of dmesg (after switching back to 1600x1200)
none
Xorg.0.log (after switching back to 1600x1200)
none
Output of dmesg (after login, before modesetting)
none
Output of dmesg (after failure) none

Description Christian Eggers 2013-01-05 20:11:12 UTC
Created attachment 72557 [details]
xrandr --verbose (before mode switching)

Bug description:
Since installing openSUSE 12.1, I've problems when switching to another mode (again, see #24748).

System environment:
-- chipset: G965
-- system architecture: x86_64
-- xf86-video-intel: 2.20.3
-- xserver: 1.12.3
-- mesa: 8.0.4
-- libdrm: 2.4.33
-- kernel: 3.4.11
-- Linux distribution: openSUSE 12.1
-- Machine or mobo model: Intel mainboard with i965G chipset
-- Display connector: DVI (via ADD2 card)

Reproducing steps:
- Power up, boot system and login to KDE desktop (resolution is now 1600x1200@60)
- Open konsole
    xrandr --output DVI1 --mode 0x4b # (1024x768@60)
    sleep 5
    xrandr --output DVI1 --mode 0x43 # (1600x768@60)
- I've everything is ok, repeat mode switching


Additional info:
-- Previous bug report for openSUSE 11.4 (has been solved):
https://bugs.freedesktop.org/show_bug.cgi?id=24748
-- Photo:
https://bugs.freedesktop.org/attachment.cgi?id=30732

Upgrading to kernel 3.7.1 didn't help.
Comment 1 Christian Eggers 2013-01-05 20:12:13 UTC
Created attachment 72558 [details]
Output of intel_reg_dump (before mode switching)
Comment 2 Christian Eggers 2013-01-05 20:12:55 UTC
Created attachment 72559 [details]
vbios.dump (before mode switching)
Comment 3 Christian Eggers 2013-01-05 20:13:55 UTC
Created attachment 72560 [details]
Output of intel_reg_dumper (after switching to 1024x768)
Comment 4 Christian Eggers 2013-01-05 20:14:29 UTC
Created attachment 72561 [details]
vbios.dump (after switching to 1024x768)
Comment 5 Christian Eggers 2013-01-05 20:15:12 UTC
Created attachment 72562 [details]
Output of intel_reg_dumper (after switching back to 1600x1200)
Comment 6 Christian Eggers 2013-01-05 20:15:50 UTC
Created attachment 72563 [details]
vbios.dump (after switching back to 1600x1200)
Comment 7 Christian Eggers 2013-01-05 20:16:30 UTC
Created attachment 72564 [details]
Output of dmesg (after switching back to 1600x1200)
Comment 8 Christian Eggers 2013-01-05 20:16:52 UTC
Created attachment 72565 [details]
Xorg.0.log (after switching back to 1600x1200)
Comment 9 Christian Eggers 2013-01-05 20:19:11 UTC
Typo:    xrandr --output DVI1 --mode 0x43 # (1600x768@60)
Correct: xrandr --output DVI1 --mode 0x43 # (1600x1200@60)
Comment 10 Daniel Vetter 2013-01-07 14:33:44 UTC
Can you please boot with drm.debug=0xe added to your kernel cmdline and attach the complete dmesg after boot. Then try to reproduce the issue until the modeset has failed, and then again grab a new dmesg (there's tons of debug stuff, so usually after a few modeset cycles the important boot message are lost, hence 2 dmesgs required). Please don't do any other modeset changes in between, so that we can correlate the dmesg noise with the failed modeset.
Comment 11 Christian Eggers 2013-01-07 19:16:08 UTC
Created attachment 72645 [details]
Output of dmesg (after login, before modesetting)
Comment 12 Christian Eggers 2013-01-07 19:17:25 UTC
Created attachment 72646 [details]
Output of dmesg (after failure)
Comment 13 Christian Eggers 2013-01-20 08:29:50 UTC
ping?
Comment 14 Daniel Vetter 2013-01-20 11:38:14 UTC
I didn't see anything in the logs which would point towards a modeset failure. So dunno what to do here ...
Comment 15 Daniel Vetter 2013-02-15 10:30:22 UTC
Can you please retest with latest drm-intel-nightly from

http://cgit.freedesktop.org/~danvet/drm-intel

I've just merged two patches to adjust the pll limits for sdvo/lvds on gen3/4.
Comment 16 Christian Eggers 2013-02-19 20:14:22 UTC
Tested three different testcases several times which _all_ didn't work reliable before:
- Mode settings from shell script in a loop: over 500 loops --> fine
- X11 login as a 2nd user (VT-8) with a different mode (calling xrandr in .xinitrc) --> fine
- Connect 2nd monitor to VGA1 --> fine

Can this be applied to mainline and stable series? I would like to switch back to openSUSE 12.2 distribution kernel (3.4.x) after this has been applied.

Thank you very much.
Christian
Comment 17 Daniel Vetter 2013-02-19 21:51:45 UTC
Wohooo, nice that this works! Patch is on the way to get merged to 3.9, with a cc: stable tag. So should show up in a stable kernel near you eventually.

commit 0568d08790bff87652aabed3b0f534fbc0a6f651
Author: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Date:   Wed Feb 13 22:20:22 2013 +0100

    drm/i915: Set i9xx sdvo clock limits according to specifications
Comment 18 Christian Eggers 2013-03-03 08:15:38 UTC
Unfortunately only one of the two patches ("drm/i915: Set i9xx sdvo clock limits according to specifications") has been applied to linux-stable. The other one ("drm/i915: Set i9xx lvds clock limits according to specifications") doesn't have the "Cc: stable@vger.kernel.org" tag.
Comment 19 Daniel Vetter 2013-03-04 10:39:50 UTC
Hm, I've thought you only need the sdvo patch to make your machine work. Do you need the lvds one, too?
Comment 20 Christian Eggers 2013-03-05 10:13:35 UTC
I downloaded and tested the whole 
http://cgit.freedesktop.org/~danvet/drm-intel tree which included both patches. 

Is there any reason not to send both patches to linux-stable? If really required I can test again with the current 3.8.1 kernel which only includes the first patch.
Comment 21 Daniel Vetter 2013-03-05 10:36:39 UTC
Yeah, testing with 3.8.1 would be appreciated to make sure we've backported the right patches.
Comment 22 Christian Eggers 2013-03-13 19:49:54 UTC
Retested with kernel-3.8.2 from openSUSE build service. Everything looks fine.

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.