Bug 97916 - Dual monitors unusable with DRI3 on Ivy Bridge
Summary: Dual monitors unusable with DRI3 on Ivy Bridge
Status: NEW
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-24 17:25 UTC by John Lindgren
Modified: 2017-12-18 13:27 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
X.org log with DRI3 (28.33 KB, text/x-log)
2016-09-24 17:25 UTC, John Lindgren
no flags Details
X.org log with DRI2 (24.76 KB, text/x-log)
2016-09-24 17:25 UTC, John Lindgren
no flags Details
dmesg log with DRI3 (64.92 KB, text/x-log)
2016-09-24 17:25 UTC, John Lindgren
no flags Details
dmesg log with DRI2 (64.32 KB, text/x-log)
2016-09-24 17:26 UTC, John Lindgren
no flags Details
X.org log with DRI3, debug=full (781.79 KB, application/gzip)
2016-09-28 19:41 UTC, John Lindgren
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Lindgren 2016-09-24 17:25:10 UTC
Created attachment 126764 [details]
X.org log with DRI3

Using Arch Linux x86_64 with:
linux 4.7.4-1
xorg-server 1.18.4-1
xf86-video-intel 1:2.99.917+703+g15c5ff1-1
xfwm4 4.12.3-2
compton 0.1_beta2.5-3

With default settings (no xorg.conf), dual monitors can only be used in "clone" mode.  When trying to switch to "extend" mode, the right-hand display freezes and continues to display a snapshot of the cloned display contents at the time of the switch.  Using Option "DRI" "2" in xorg.conf is a workaround.

My system is a Dell Latitude E5530 (Core i5 3210m).  The left-hand monitor in this case is the laptop display and the right-hand monitor is an Acer external display connected to the docking station with a DVI cable.
Comment 1 John Lindgren 2016-09-24 17:25:29 UTC
Created attachment 126765 [details]
X.org log with DRI2
Comment 2 John Lindgren 2016-09-24 17:25:49 UTC
Created attachment 126766 [details]
dmesg log with DRI3
Comment 3 John Lindgren 2016-09-24 17:26:11 UTC
Created attachment 126767 [details]
dmesg log with DRI2
Comment 4 Chris Wilson 2016-09-25 07:17:07 UTC
That sounds like the compositor is not noticing the configuration change (or something similar). When you switch to extended configuration, we copy the current frontbuffer to the new configuration (tiling so that it looks like the original clone) and then go back to normal. If the DRI3 client continues to only update its original window it will only cover the left output.

The challenge is proving that, and finding the bug.
Comment 5 John Lindgren 2016-09-27 14:13:47 UTC
I added some tracing to compton and confirmed that it is aware of the change in screen size (ConfigureEvent received on the root window with the new size), and calls glViewport with the new size.  I'm not sure where else to look for a bug on the client side.

The xrender backend doesn't suffer from the same problem, only --backend glx.
Comment 6 Chris Wilson 2016-09-27 14:26:50 UTC
Mesa/dri3 has its own event/hook XCB_PRESENT_CONFIGURE_NOTIFY which it requires to notice the change in back buffer size. If that was missed, the compositor would be rendering the new size but only the original size would be shown - that would be easy to see. dri3_get_buffer() would be the right spot to add printfs to see what was going on.

Compiling xf86-video-intel with ./configure --enable-debug=full would generate a huge Xorg.log from which we can check what size of pixmap is being rendered. But again not why.
Comment 7 John Lindgren 2016-09-28 19:11:49 UTC
(In reply to Chris Wilson from comment #6)
> ... dri3_get_buffer() would be the right
> spot to add printfs to see what was going on.

I am not very familiar with the mesa/dri architecture.  Is dri3_get_buffer() a function in mesa?  I can try adding some printf's at some point but for now I will probably stick with DRI2, which "just works".
Comment 8 Chris Wilson 2016-09-28 19:17:10 UTC
Yes, under mesa/src/loader/loader_dri3_helper.c No worries, if you don't have time/inclination to do it. Could I ask for a full-debug Xorg.0.log though?

Will hopefully get around to trying a compton + DRI3 + multimonitor setup sometime in the near future...
Comment 9 John Lindgren 2016-09-28 19:41:32 UTC
Created attachment 126835 [details]
X.org log with DRI3, debug=full

Here it is.  The system froze shortly after trying to extending the desktop to both displays, but hopefully enough of the log was captured first to be useful to you.
Comment 10 Chris Wilson 2016-09-28 19:50:11 UTC
At least that says what I expected; after the resize, we continue to process SwapBuffers only covering the left 1920x1080. Something is definitely amiss in the dri3 window resizing.
Comment 11 Michel Dänzer 2017-02-22 09:11:11 UTC
FWIW, seems to work fine with the compton option --paint-on-overlay. Compositors should really draw to the composite overlay window instead of to the root window — all other popular compositors I know of do so by default, not sure why compton doesn't.

On the server side, looks like present_config_notify doesn't get called for the root window.

Given the above, I'd be inclined to resolve this as either NOTOURBUG (compton should use the composite overlay window by default or even unconditionally) or WONTFIX (looks like this may not be fixable in the Present extension for the root window).
Comment 12 John Lindgren 2017-02-23 04:37:41 UTC
I can confirm that --paint-on-overlay works around the problem.

So is it correct to say that by design, DRI3 will not work (or will not work properly) for painting the root window?  If that's true, then perhaps mesa ought to be smart enough to fall back to software rendering in that case.  That would be better than silently failing to update the screen contents.
Comment 13 jimijames.bove 2017-04-11 06:04:02 UTC
I just had a very long night of troubleshooting before figuring out, I have this exact bug, and the --paint-on-overlay option fixes it for me, too. And yeah, it is indeed not intel-specific, because I'm on nouveau. But even though this is fixed for me now, there are two things I can't figure out on my own that I'd like explained to me, if they're explicable:

1. Why did I not run into this issue until going from 4.9.8 to 4.10.8, when John started having it in 4.7.4? I'm also on Arch Linux, so our packages can't be different besides their versions.

2. Why did disabling compton, which was one of the first things I tried at the beginning of this painfully long night of troubleshooting, not fix the issue? Why did I have to either downgrade my kernel or apply the --paint-on-overlay option? Is XFCE's (or generally Linux's for all I know) dual monitor support SUPPOSED to be broken for people who don't use a compositor?
Comment 14 Michel Dänzer 2017-04-11 06:09:52 UTC
(In reply to jimijames.bove from comment #13)

No, it sounds like you ran into a different issue without compton, most likely either in XFCE or the nouveau drivers.
Comment 15 jimijames.bove 2017-04-11 06:19:28 UTC
But I already tried downgrading XFCE and the nouveau drivers and literally everything that has anything to do with X or my graphics drivers, and this issue, which showed up on my first reboot after updating all of those things, never went away until I downgraded the kernel. Plus running compton with that option fixes it. Despite all that, is it still probably a separate bug? Because if it is, I think it's still a bug in the kernel, rather than XFCE or nouveau.
Comment 16 Michel Dänzer 2017-04-11 06:25:20 UTC
You might have run into the issue fixed by https://cgit.freedesktop.org/nouveau/xf86-video-nouveau/commit/?id=924083938c8f209d8f6ff472caf8692a644f7e78 .
Comment 17 jimijames.bove 2017-04-11 06:34:10 UTC
I don't think so. That bug seems to cause the display to never come back on at all until X is restarted. My behavior was different. On boot, I had a properly functioning dual monitor setup, but once the 2nd monitor got disconnected (it's on an HDMI switch with gaming consoles and such), it started having 100% identical behavior to this bug report here. Until I turned the display off and back on in XFCE's Display preferences--then it would go back to a proper dual setup.
Comment 18 Michel Dänzer 2017-04-11 06:50:08 UTC
Anyway, since your problem doesn't happen under exactly the same conditions as the one this report is about, it's clearly not the same. Please file your own report.
Comment 19 jimijames.bove 2017-04-11 07:23:08 UTC
Here's that report for anyone who's curious: https://bugzilla.kernel.org/show_bug.cgi?id=195321


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.