Bug 35634 - Booting with external monitor attached and unplug before switching results in blank screen with X cursor
Summary: Booting with external monitor attached and unplug before switching results in...
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-24 12:15 UTC by Rick Bramley
Modified: 2017-07-24 23:05 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Dmesg output with drm.debug=0xe and a marker indicating where the unplug occurred (74.91 KB, text/plain)
2011-03-24 16:43 UTC, Rick Bramley
no flags Details
X log (46.67 KB, text/plain)
2011-03-24 16:43 UTC, Rick Bramley
no flags Details
intel_reg_dump before unplugging (8.89 KB, text/plain)
2011-03-24 16:43 UTC, Rick Bramley
no flags Details
intel_reg_dump after unplugging (8.89 KB, text/plain)
2011-03-24 16:44 UTC, Rick Bramley
no flags Details

Description Rick Bramley 2011-03-24 12:15:39 UTC
On SandyBridge platforms as well as PineTrail if you boot with an external monitor attached but don't switch to it, when you unplug the cable the screen goes blank and all you see is an X cursor.
Comment 1 Chris Wilson 2011-03-24 13:17:09 UTC
Boot into what? VT console, X + gnome/metacity, X + gnome/compiz/mutter, X + kwin? What do you mean by "Don't switch to it"? Does fbcon not attach itself to the external display? When do you unplug the monitor, during kernel booting, userspace initialisation or after X starting?

(Presuming the external monitor is VGA since PineView is involved.)

Can you please attach a drm.debug=0xe dmesg and Xorg.log for the boot process?
Comment 2 Rick Bramley 2011-03-24 15:59:45 UTC
This is booting into X + gnome/compiz without a console.   No automatic switching to VGA (in both cases) is done.  The monitor is unplugged after user space initialization and X is running.   I will grab the logs now.
Comment 3 Rick Bramley 2011-03-24 16:43:08 UTC
Created attachment 44797 [details]
Dmesg output with drm.debug=0xe and a marker indicating where the unplug occurred
Comment 4 Rick Bramley 2011-03-24 16:43:32 UTC
Created attachment 44798 [details]
X log
Comment 5 Rick Bramley 2011-03-24 16:43:56 UTC
Created attachment 44799 [details]
intel_reg_dump before unplugging
Comment 6 Rick Bramley 2011-03-24 16:44:23 UTC
Created attachment 44800 [details]
intel_reg_dump after unplugging
Comment 7 Chris Wilson 2011-03-25 11:08:43 UTC
Ok, the kernel looks to have sanely handed the hotplug event and torn down the crtc attached to the VGA connector. So the question is why didn't userspace handle it? Similarly X seems to have changed modes correctly. The only thing missing in this chain of events is the desktop.

Anything in ~/.xsession-errors?
Comment 8 Rick Bramley 2011-03-28 10:16:35 UTC
Still checking on the ~/.xsession-errors content (file did not exist I need to track down if there is some option needed to turn this on).


Debugging that has been done so far has found the following:

Values of DSPASTRIDE(0x70188) and DSPABASE(0x70184) after boot with external monitor connected.

sh-4.0# ./iotools mmio_read32 0x561f0188
0x00001000
sh-4.0# ./iotools mmio_read32 0x561f0184
0x00800000

Unplug external monitor cable. After a second you only see mouse on a blank screen with backlight on. 

Values of DSPASTRIDE(0x70188) and DSPABASE(0x70184): 

sh-4.0# ./iotools mmio_read32 0x561f0188
0x00001680
sh-4.0# ./iotools mmio_read32 0x561f0184
0x00030000

Setting these registers back to their initial values restores screen output.

sh-4.0# ./iotools mmio_write32 0x561f0188 0x00001000
sh-4.0# ./iotools mmio_write32 0x561f0184 0x00800000
Comment 9 Rick Bramley 2011-03-30 20:39:37 UTC
Any thoughts about the register results?
Comment 10 Chris Wilson 2011-04-05 04:30:40 UTC
Sure. They just indicate that userspace changed the mode configuration and we have not yet replaced the old fb in the GTT with anything else.
Comment 11 Manjeet Singh 2011-04-05 22:33:34 UTC
Hi Chris,

We are seeing one more issue (see description below) and we think the root cause is same as this bug:

Issue#2-

Boot to Quickweb- Put system to sleep and resume --> 2 out of 8 attempts the system shows Black screen with backlight.

Workaround- Do another sleep/resume cycle and system will resume up fine next time.
Comment 12 Chris Wilson 2011-04-05 22:51:53 UTC
(In reply to comment #11) 
> Boot to Quickweb- Put system to sleep and resume --> 2 out of 8 attempts the
> system shows Black screen with backlight.
> 
> Workaround- Do another sleep/resume cycle and system will resume up fine next
> time.

What's the exact state of the output after the resume? Only if it shows the symptom of only showing a cursor I'd classify it as the same bug. Otherwise, we have another fickle s&r bug.

Once in the black screen of boredom, can you switch VT (or ssh in) and start an xterm? etc.
Comment 13 Rick Bramley 2011-04-14 11:05:55 UTC
We've worked around this with a couple of different changes (one having to do with the hotplug interrupt handling) and a change to do an xset dpms force off in the resume path.

I am pulling together a more coherent list of what we did so you can take a look and see if there is a better way to accomplish what we are doing.
Comment 14 Chris Wilson 2011-07-18 07:58:14 UTC
Rick, if you can provide details on the workaround, that would be useful.

The DPMS/hotplug is very reminiscent of https://bugzilla.kernel.org/show_bug.cgi?id=24982
Comment 15 Rick Bramley 2011-07-21 23:33:37 UTC
Hi Chris, it looks like the workaround was for drm_fb_helper_hotplug_event() to always set fb_helper->delayed_hotplug to true and return false!   There were some xset dpms calls changed at the same time but they appear to be for a different issue specific to pinetrail.
Comment 16 Eugeni Dodonov 2011-11-03 14:08:45 UTC
Is this still valid with 3.1 kernel by a chance?
Comment 17 Daniel Vetter 2012-06-20 01:32:53 UTC
Hm, sounds like fbcon is too eager to show it's framebuffer. Please test the patch at:

http://permalink.gmane.org/gmane.comp.video.dri.devel/70460
Comment 18 Daniel Vetter 2012-08-22 11:28:10 UTC
Bug reporter seems to have disappeared, bug itself presumably fixed with the linked patch.


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.