Bug 79994 - intel-virtual-output: fatal IO error 9 when external display is enabled
Summary: intel-virtual-output: fatal IO error 9 when external display is enabled
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-13 17:06 UTC by main.haarp
Modified: 2014-06-13 20:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
i-v-o debug output (16.25 KB, text/plain)
2014-06-13 17:06 UTC, main.haarp
no flags Details
i-v-o debug output (3.54 KB, text/plain)
2014-06-13 18:08 UTC, main.haarp
no flags Details

Description main.haarp 2014-06-13 17:06:22 UTC
Created attachment 100992 [details]
i-v-o debug output

Greetings.

I'm using today's git of xf86-video-intel (but the same can be observed on 2.99.912). xorg-server-1.15.0. Gentoo Linux. Thinkpad W520 (SNB) with Nvidia Quadro 2000M (handled via bumblebee).


I'm trying to get i-v-o to work. I can start the second X server on the discrete GPU and have it enable the external display. It is disabled again when I start i-v-o. so far so good.

Main X is on :0 and the secondary X on :8.

I now go ahead and enable the virtual output on :0
$ xrandr --output VIRTUAL1 --auto --right-of LVDS1

As soon as I do that, i-v-o crashes with:
XIO:  fatal IO error 9 (Bad file descriptor) on X server ":0.0"

Also see the attached log. There is nothing suspicious in either X's logfiles. If you need any additional logs, let me know.

What's going on here? How can I help?
Comment 1 Chris Wilson 2014-06-13 17:23:49 UTC
You can quickly confirm the cause is 67b37332bd45dd4cea297107bfdc9df21984fdcd by reverting it:

$ git revert 67b37332bd45dd4cea297107bfdc9df21984fdcd
Comment 2 Chris Wilson 2014-06-13 17:38:48 UTC
Ok, I think this should be it:

commit c8074b6bcfa8c208433574721135faa4d919d32a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jun 13 18:37:15 2014 +0100

    intel-virtual-output: Check for an error creating the DRI3 fd
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79994
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

I had expected it to generate a regular XError no XIOError.
Comment 3 main.haarp 2014-06-13 18:08:05 UTC
Created attachment 100996 [details]
i-v-o debug output

Heh, that was quick! :)

Indeed, this fixes the crash. But now a new problem arises:

X11 error from display :8, serial=89, error=2, req=130.3, repeated several times

Also see attachment. The external display is activated, but stays black.

I'm unsure if this is related or a separate bug, tho.
Comment 4 Chris Wilson 2014-06-13 18:16:34 UTC
Yes, that is due to 

X11 error from display :8, serial=89, error=2, req=130.3

which says the SHMPutImage to the dGPU failed. :|
Comment 5 Chris Wilson 2014-06-13 18:31:20 UTC
Try:

commit 0c6fa0cdf0cebcd592281e578da7a7f53cbfe186
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jun 13 19:29:41 2014 +0100

    intel-virtual-output: Initialise image after clone
    
    As the image inherits its width/height from the clone, we need to set
    those first on the clone.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79994
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk
Comment 6 main.haarp 2014-06-13 18:48:03 UTC
aaaand fixed. :) Thanks! You're quite fast


(small side note: i've noticed that terminating i-v-o leaves the outputs on the discrete gpu active. they should probably be shut down before terminating :)
Comment 7 Chris Wilson 2014-06-13 19:00:38 UTC
commit 8a92261b22a8c134a48d1491627ac05136563603
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jun 13 19:59:16 2014 +0100

    intel-virtual-output: Disable outputs on remote displays upon shutdown
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=79994
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 8 main.haarp 2014-06-13 20:31:58 UTC
Unfortunately it triggers compilation errors:

virtual.c: In function ‘display_cleanup’:
virtual.c:3067:2: error: ‘res’ undeclared (first use in this function)
virtual.c:3067:2: note: each undeclared identifier is reported only once for each function it appears in
virtual.c: In function ‘context_cleanup’:
virtual.c:3085:23: error: request for member ‘display’ in something not a structure or union
Comment 9 Chris Wilson 2014-06-13 20:44:50 UTC
I keep forgetting that that machine doesn't actually compile i-v-o.

commit 05fdfe3b2813495ea122471ed6dde340e538aa65
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jun 13 21:41:16 2014 +0100

    intel-virtual-output: Compile fixes
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


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.