Bug 57926 - [SNB] Stretched output on LVDS1 after undocking external monitors during suspend
Summary: [SNB] Stretched output on LVDS1 after undocking external monitors during suspend
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-05 20:44 UTC by Thilo-Alexander Ginkel
Modified: 2017-07-24 22:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
xrandr --verbose (5.70 KB, text/plain)
2012-12-05 20:45 UTC, Thilo-Alexander Ginkel
no flags Details
intel_reg_dumper (11.70 KB, text/plain)
2012-12-05 20:45 UTC, Thilo-Alexander Ginkel
no flags Details
vbios.dump (64.00 KB, application/octet-stream)
2012-12-05 20:46 UTC, Thilo-Alexander Ginkel
no flags Details
Xorg.0.log (106.76 KB, text/plain)
2012-12-05 20:47 UTC, Thilo-Alexander Ginkel
no flags Details
dmesg (242.93 KB, text/plain)
2012-12-05 20:48 UTC, Thilo-Alexander Ginkel
no flags Details
kern.log (w/ drm.debug=0x06) (247.20 KB, text/plain)
2012-12-07 01:03 UTC, Thilo-Alexander Ginkel
no flags Details
intel_reg_dumper (display ok) (11.69 KB, text/plain)
2012-12-07 08:03 UTC, Thilo-Alexander Ginkel
no flags Details

Description Thilo-Alexander Ginkel 2012-12-05 20:44:26 UTC
System environment: 
-- chipset: Sandybridge Mobile (GT2+)
-- system architecture: x86_64
-- xf86-video-intel: 2.17.0
-- mesa: 8.0.4
-- xserver: 1.11.3
-- libdrm: 2.4.32
-- Linux kernel: 3.4.15
-- Linux distribution: Kubuntu 12.04
-- Machine or mobo model: Lenovo ThinkPad T420s 4174-P5G
-- Display connector: 1x LVDS, 2x DVI (appearing as HDMI)

Problem description:

When booting with both external displays connected suspending, disconnecting the external displays and then resuming, the output on LVDS1 appears horizontally stretched.

This used to work correctly in previous kernel versions, most likely 3.2.x (I can verify this if required).

Reproduction steps:

1. Boot with both DVI outputs connected (LVDS1 will be inactive)
2. Configure correct resolution on external displays using:
   xrandr -d :0.0 --output LVDS1 --off --output HDMI3 --mode 1600x1200 --primary --auto
   sleep 5
   xrandr -d :0.0 --output HDMI2 --mode 1600x1200 --right-of HDMI3 --auto
3. Suspend
4. Remove external displays
5. Resume
6. Switch to LVDS1 using:
   xrandr -d :0.0 --output HDMI2 --off
   sleep 5
   xrandr -d :0.0 --output LVDS1 --mode 1600x900 --auto
   sleep 5
   xrandr -d :0.0 --output HDMI3 --off

The screen output is now horizontally stretched (and clipped). This can only be corrected using a reboot. While shutting down, even the plymouth shutdown graphic appears stretched.

Photo: https://www.dropbox.com/s/5mv3enqmm4pkeuq/2012-12-05%2020.22.19.jpg

Logs will follow shortly...
Comment 1 Thilo-Alexander Ginkel 2012-12-05 20:45:05 UTC
Created attachment 71048 [details]
xrandr --verbose
Comment 2 Thilo-Alexander Ginkel 2012-12-05 20:45:40 UTC
Created attachment 71049 [details]
intel_reg_dumper
Comment 3 Thilo-Alexander Ginkel 2012-12-05 20:46:15 UTC
Created attachment 71050 [details]
vbios.dump
Comment 4 Thilo-Alexander Ginkel 2012-12-05 20:47:18 UTC
Created attachment 71051 [details]
Xorg.0.log
Comment 5 Thilo-Alexander Ginkel 2012-12-05 20:48:40 UTC
Created attachment 71052 [details]
dmesg
Comment 6 Daniel Vetter 2012-12-05 22:18:05 UTC
Can you please attach a reg dump after you've done your littel dance to stretch the panel's output from both 3.4 (broken) and 3.2 (where it should work). Thanks.
Comment 7 Thilo-Alexander Ginkel 2012-12-07 01:02:02 UTC
Hm... Strange as it may sound I am not able to fix the issue by reverting to an older kernel version. So far I tried 3.2.x (current Ubuntu Kernel), 3.0.55 and 3.1.4.

So while I am certain that this worked in the past it may not be related to the kernel version.

BTW, the register dump attached is already based on the bad state.

Fortunately, during testing I figured out that it is possible to simplify the reproduction steps:

Suspend/resume is not required. Undocking is not required. Just make sure to:
1. Boot with the external displays attached
2. Run the following sequence:
   xrandr -d :0.0 --output LVDS1 --off --output HDMI3 --mode 1600x1200 \
     --primary --auto
   sleep 5
   xrandr -d :0.0 --output HDMI2 --mode 1600x1200 --right-of HDMI3 --auto
   xrandr -d :0.0 --output HDMI2 --off
   sleep 5
   xrandr -d :0.0 --output LVDS1 --mode 1600x900 --auto
   sleep 5
   xrandr -d :0.0 --output HDMI3 --off

=> The display will show up stretched.

What will, however, reliably prevent the issue is to boot with the external monitors being detached and only attaching them after boot. Would a register dump captured for this scenario help to figure out what's different?

Just in case it helps I have captured a kernel log with drm.debug=0x06 set.

Any ideas?
Comment 8 Thilo-Alexander Ginkel 2012-12-07 01:03:44 UTC
Created attachment 71107 [details]
kern.log (w/ drm.debug=0x06)

Captured after executing the sequence outlined in the previous comment.
Comment 9 Daniel Vetter 2012-12-07 07:54:06 UTC
(In reply to comment #7)
> What will, however, reliably prevent the issue is to boot with the external
> monitors being detached and only attaching them after boot. Would a register
> dump captured for this scenario help to figure out what's different?

Yep, please attach that, thanks.
Comment 10 Thilo-Alexander Ginkel 2012-12-07 08:03:15 UTC
Created attachment 71116 [details]
intel_reg_dumper (display ok)

This file was captured after the following sequence:

1. Boot with the external displays *detached*
2. Dock the external displays
3. Run the following sequence:
   xrandr -d :0.0 --output LVDS1 --off --output HDMI3 --mode 1600x1200 \
     --primary --auto
   sleep 5
   xrandr -d :0.0 --output HDMI2 --mode 1600x1200 --right-of HDMI3 --auto
   xrandr -d :0.0 --output HDMI2 --off
   sleep 5
   xrandr -d :0.0 --output LVDS1 --mode 1600x900 --auto
   sleep 5
   xrandr -d :0.0 --output HDMI3 --off

=> The LVDS1 output is correct and not stretched
Comment 11 Thilo-Alexander Ginkel 2012-12-07 08:25:34 UTC
Just another thought: This may be related to the "Primary Monitor" setting in my laptop's BIOS, which was formerly set to "LVDS1" and that I eventually changed to "HDMI-{2|3}". When booting with the external displays detached the BIOS probably falls back to LVDS1 as the primary display.
Comment 12 Chris Wilson 2012-12-07 19:24:29 UTC
Can you please confirm the bug with a recent kernel, a 3.7-rc would be close to ideal, drm-intel-next more so...
Comment 13 Thilo-Alexander Ginkel 2012-12-11 15:04:23 UTC
Looks like this is actually fixed in linux-drm-next (as of commit 2ff4aeac39dbdcac934694413767f09a27965e11).

There are two other regressions (also present in mainline 3.7) for which I will file separate bugs.


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.