Bug 97566 - [dri3] The frame of a window and its open gl content are out of sync.
Summary: [dri3] The frame of a window and its open gl content are out of sync.
Status: NEW
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 12.0
Hardware: x86-64 (AMD64) Linux (All)
: high major
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-01 19:23 UTC by Manuel Schneider
Modified: 2017-12-06 17:00 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Schneider 2016-09-01 19:23:33 UTC
The frame of a window and its open gl content are out of sync.
Check this screencast: https://youtu.be/c32nxfBk4fA

I could "fix" it by setting the option "DRI" "2"
Comment 1 Manuel Schneider 2016-09-01 20:50:42 UTC
I forgot to mention that this bug seems to affect only Intel. The few people I talked to in irc that did not encouter this problem had radeon or nvidia drivers. 

Further in a vm (virtualbox) chromium is completely black. This holds for dri2 too. See:
http://pix.toile-libre.org/upload/original/1472762750.png
Comment 2 Manuel Schneider 2016-09-09 00:04:08 UTC
Hi,

I think this issue should get higher priority, since it affects a wide range of applications and platforms. 

Most people that dont play games dont have graphic cards. Afaik gaming on linux is not that widespread. OpenGL applications are everywhere. Afaik most KDE applications are based on QML wich is in turn based on OpenGL.
Comment 3 Eero Tamminen 2016-09-12 15:04:13 UTC
What Intel HW, disto version, desktop/compositor and applications / GUI toolkit do you use?

(HW: You've filed this against 915 driver component which is for really old Intel IGPs.  SW: DRI3 requires quite a lot of components to be up to date and right extensions to be used.)

Glxgears I would ignore, it's not designed for synchronized drawing.  I've seen it process X resize events at completely different rate (tens of seconds late) than at what desktop Window manager (Unity/compiz) does the window resizing.


(In reply to Manuel Schneider from comment #1)
> I forgot to mention that this bug seems to affect only Intel. The few people
> I talked to in irc that did not encouter this problem had radeon or nvidia
> drivers. 

Did they use Mesa drivers or proprietary ones?  Did they have exactly the same distro version (same X, Mesa, compositor, application / widget set versions)?   How did they verify that they also had DRI3 enabled?  (e.g. Latest Ubuntu 16.04 defaults to DRI2 although 15.10 defaulted to DRI3)


> Further in a vm (virtualbox) chromium is completely black. This holds for
> dri2 too. See:
> http://pix.toile-libre.org/upload/original/1472762750.png

Please file a separate bug against whatever driver you use in the VM (swrast?).
Comment 4 Manuel Schneider 2016-09-12 20:15:41 UTC
Intel HW: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz with Intel HD Graphics 4600
Distro version: Arch Linux (Rolling release with upstream software)
Desktop: Cinnamon 3.0.7
Compositor: Muffin 3.0.5
Applications: Chromium and my own QML app, which is a launcher that resized depending on the amount of the output.
GUI toolkit: Well both Qt (my app) and chromium uses gtk I guess
OpenGL version string: 3.0 Mesa 12.0.2

xorg-server 1.18.4
xorg-xdriinfo 1.0.5
xf86-video-intel 1:2.99.917+688+g49daf5d
libva-intel-driver 1.7.1
mesa 12.0.2
mesa-demos 8.3.0
mesa-libgl 12.0.2

I am not familiar with the linux graphics stack. If you need more info let me know.


> Did they use Mesa drivers or proprietary ones?
Dont remember. In my bug report at the archlinux bug tracker (https://bugs.archlinux.org/task/50241?project=1&opened=20625) someone with amd radeon HD4650 pcie, radeon driver, mesa 12.0.1-5 has no problems.
Comment 5 Manuel Schneider 2016-09-13 21:24:25 UTC
I think it necessary to take a deeper look. Archlinux performs somehow worse than ubuntu.

archlinux dri2
https://youtu.be/RxZ4qO3gpL8

archlinux dri3
https://youtu.be/EB0xabvo1Ew

ubuntu 16 04 dri2
https://youtu.be/eM6If13dgIA

ubuntu 16 04 dri3
https://youtu.be/9Upauh38jfw

Any ideas?
Comment 6 Eero Tamminen 2016-09-15 08:28:51 UTC
Ubuntu has older versions of all the components you have in Arch (kernel 4.4 with 4.6 GPU driver backport, 2.18.3 X server, Mesa 11.2, April version of Intel DDX etc), and has some additional patches on top of them.

Things that could cause flickering I see in your DRI3 video:
- kernel
- X server / X libraries
- Intel X DDX
- Mesa
- Compositor

For now, I'm moving this bug to GLX component, DRI3  issues aren't related to Intel backend (especially 915 as you have Haswell :)), but you need to do quite a bit more testing to identify what's the problematic component of the above list (is it Mesa at all).


> Compositor: Muffin 3.0.5

Your Ubuntu video seems to use Unity i.e. Ubuntu version of compiz.

You could start by trying modesetting to see whether issue is with Intel DDX.  To test that, you can just rename X Intel driver temporarily and restart X, and it will fallback to modesettings.

If that doesn't help, try e.g. Gnome3 (gnome-shell compositor).  If that works OK, there may be an issue with your compositor instead of e.g. Mesa.
Comment 7 Manuel Schneider 2016-09-15 09:31:45 UTC
I can exclude compositors since the flickering is visible in every desktop environment
and even in plain window manager setups without compositor.

https://youtu.be/VNFoYd-LQQo
Comment 8 Manuel Schneider 2016-09-15 09:32:33 UTC
By the way ignore the flickering of the complete screen. This is only visible in the video and has to be a ffmpeg bug.
Comment 9 Manuel Schneider 2016-09-17 19:22:41 UTC
I just renamed /usr/lib/xorg/modules/drivers/intel_drv.so. X did not start after this.

Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (--) Log file renamed from "/var/lib/gdm/.local/share/xorg/Xorg.pid-8321.log" to "/var/lib/gdm/.local/share/xorg/Xorg.0.log"
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: X.Org X Server 1.18.4
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: Release Date: 2016-07-19
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: X Protocol Version 11, Revision 0
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: Build Operating System: Linux 4.5.4-1-ARCH x86_64
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: Current Operating System: Linux argon 4.7.2-1-ARCH #1 SMP PREEMPT Sat Aug 20 23:02:56 CEST 2016 x86_64
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: Kernel command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root=/dev/sda2 rw quiet pcie_aspm=force acpi_osi="Linux" #drm.debug=0x0e
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: Build Date: 19 July 2016  05:54:24PM
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:  
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: Current version of pixman: 0.34.0
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         Before reporting problems, check http://wiki.x.org
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         to make sure that you have the latest version.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: Markers: (--) probed, (**) from config file, (==) default setting,
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         (++) from command line, (!!) notice, (II) informational,
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) Log file: "/var/lib/gdm/.local/share/xorg/Xorg.0.log", Time: Sat Sep 17 21:17:45 2016
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) Using config directory: "/etc/X11/xorg.conf.d"
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) Using system config directory "/usr/share/X11/xorg.conf.d"
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) No Layout section.  Using the first Screen section.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) No screen section available. Using defaults.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (**) |-->Screen "Default Screen Section" (0)
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (**) |   |-->Monitor "<default monitor>"
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) No device specified for screen "Default Screen Section".
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         Using the first device section listed.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (**) |   |-->Device "Intel Graphics"
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) No monitor specified for screen "Default Screen Section".
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         Using a default monitor configuration.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) Automatically adding devices
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) Automatically enabling devices
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) Automatically adding GPU devices
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) Max clients allowed: 256, resource mask: 0x1fffff
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) FontPath set to:
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         /usr/share/fonts/misc/,
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         /usr/share/fonts/TTF/,
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         /usr/share/fonts/OTF/,
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         /usr/share/fonts/Type1/,
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         /usr/share/fonts/100dpi/,
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         /usr/share/fonts/75dpi/
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) ModulePath set to "/usr/lib/xorg/modules"
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) The server relies on udev to provide the list of input devices.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         If no devices become available, reconfigure udev or disable AutoAddDevices.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) Loader magic: 0x821d40
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) Module ABI versions:
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         X.Org ANSI C Emulation: 0.4
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         X.Org Video Driver: 20.0
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         X.Org XInput driver : 22.1
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         X.Org Server Extension : 9.0
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (++) using VT number 1
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) systemd-logind: took control of session /org/freedesktop/login1/session/c389
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) xfree86: Adding drm device (/dev/dri/card0)
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 9 paused 0
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (--) PCI:*(0:0:2:0) 8086:0412:1462:7851 rev 6, Mem @ 0xf7800000/4194304, 0xe0000000/268435456, I/O @ 0x0000f000/64, BIOS @ 0x????????/131072
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) LoadModule: "glx"
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) Module glx: vendor="X.Org Foundation"
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         compiled for 1.18.4, module version = 1.0.0
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:         ABI class: X.Org Server Extension, version 9.0
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (==) AIGLX enabled
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) LoadModule: "intel"
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (WW) Warning, couldn't open module intel
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) UnloadModule: "intel"
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (II) Unloading intel
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (EE) Failed to load module "intel" (module does not exist, 0)
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (EE) No drivers available.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (EE)
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: Fatal server error:
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (EE) no screens found(EE)
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (EE)
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: Please consult the The X.Org Foundation support
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:          at http://wiki.x.org
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]:  for help.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (EE) Please also check the log file at "/var/lib/gdm/.local/share/xorg/Xorg.0.log" for additional information.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (EE)
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (EE) Server terminated with error (1). Closing log file.
Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: Unable to run X server
Comment 10 Eero Tamminen 2016-09-19 13:03:13 UTC
...
> Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (EE) Failed to load module "intel" (module does not exist, 0)
> Sep 17 21:17:45 argon /usr/lib/gdm/gdm-x-session[8319]: (EE) No drivers 
available.

It seems that you don't have modesetting driver?

On Ubuntu that is included in the X server package.  It's found in the same directory as Intel driver:
$ dpkg -S modesetting_drv
xserver-xorg-core: /usr/lib/xorg/modules/drivers/modesetting_drv.so

On Arch it should come with the xorg-server package...
Comment 11 Manuel Schneider 2016-09-20 14:18:30 UTC
It is there:

.:[manuel@argon]:. /usr/lib/xorg/modules/drivers $ ll
insgesamt 1,8M
-rwxr-xr-x 1 root root 1,7M 11. Sep 14:14 intel_drv.so
-rwxr-xr-x 1 root root  77K 19. Jul 19:55 modesetting_drv.so
-rwxr-xr-x 1 root root  27K 11. Nov 2015  vesa_drv.so
Comment 12 Manuel Schneider 2016-09-26 20:46:41 UTC
I just realized that I have to change the Driver value in the xorg conf. Well but no luck. I also downgraded the kernel to a lts version. (4.7.4 and 4.7.22) None of the combinations makes it any better.
Comment 13 Eero Tamminen 2016-09-27 07:36:59 UTC
Moving to more correct component (HSW HD Graphics 4600 is handled by i965 driver).

(In reply to Manuel Schneider from comment #12)
> I just realized that I have to change the Driver value in the xorg conf.

Weird, on Ubuntu X server defaults to modesetting if Intel driver isn't present.  I wonder why Arch doesn't do that.

Martin is going to check things on his Arch setups and comment.
Comment 14 Martin Peres 2016-09-27 08:06:19 UTC
So, you are obviously using the Intel DDX. I tried replicating your setup on my desktop PC (hsw-gt2) with intel the same xorg options but rendering was solid on both kwin and mutter. Same on my ivybridge laptop.

Now, I wonder what the heck unity is doing because it looks like DRI3 is never enabled (based on the rendering). You should actually check that you are indeed using DRI3 by running the following command:

LIBGL_DEBUG=verbose glxgears

I suspect that mesa or the intel ddx has not been compiled with dri3 support and you just get never get it, despite asking for it.
Comment 15 Manuel Schneider 2016-09-27 12:31:42 UTC
.:[manuel@argon]:. ~ $ LIBGL_DEBUG=verbose glxgears
libGL: Can't open configuration file /home/manuel/.drirc: No such file or directory.
libGL: pci id for fd 4: 8086:0412, driver i965
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/tls/i965_dri.so
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/i965_dri.so
libGL: Can't open configuration file /home/manuel/.drirc: No such file or directory.
libGL: Using DRI3 for screen 0
libGL: Can't open configuration file /home/manuel/.drirc: No such file or directory.
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.


Does this help?
Comment 16 Manuel Schneider 2016-09-27 12:35:17 UTC
Was interested in drirc and stumbled over this thread

https://forums.gentoo.org/viewtopic-t-932988-start-0.html

export vblank_mode=0 fixes the problem, yeah! But I have no clue what it does. Is this a workaround? Does it introduce further problems?
Comment 17 Manuel Schneider 2016-09-27 13:43:23 UTC
Looks good: https://www.youtube.com/watch?v=ASrbamIhKCc&feature=youtu.be

But the more I read about this variable the more it seems like that the rate is so high that the missing synchronisation does not stand out.
Comment 18 Martin Peres 2016-09-27 14:26:59 UTC
(In reply to Manuel Schneider from comment #15)
> .:[manuel@argon]:. ~ $ LIBGL_DEBUG=verbose glxgears
> libGL: Can't open configuration file /home/manuel/.drirc: No such file or
> directory.
> libGL: pci id for fd 4: 8086:0412, driver i965
> libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/tls/i965_dri.so
> libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/i965_dri.so
> libGL: Can't open configuration file /home/manuel/.drirc: No such file or
> directory.
> libGL: Using DRI3 for screen 0
> libGL: Can't open configuration file /home/manuel/.drirc: No such file or
> directory.
> Running synchronized to the vertical refresh.  The framerate should be
> approximately the same as the monitor refresh rate.
> 
> 
> Does this help?

Was this on ubuntu? This is the first thing I would like to know :s
Comment 19 Manuel Schneider 2016-09-27 14:54:06 UTC
I am not sure if I wrote the /etc/X11/xorg.conf.d/20-intel.conf so I commented all its content. 

manuel@b85i:~$ LIBGL_DEBUG=verbose glxgears
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/i965_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
libGL: Can't open configuration file /home/manuel/.drirc: No such file or directory.
libGL: Using DRI2 for screen 0
libGL: Can't open configuration file /home/manuel/.drirc: No such file or directory.
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
Comment 20 Manuel Schneider 2016-11-07 14:02:57 UTC
The impact is even bigger than I thought. every application using web-kit or electron suffer this issue. Meanwhile there are a lot of them. See http://electron.atom.io/apps/.

Setting DRI2 does not fix it and vblank_mode=0 is pretty CPU heavy.
Comment 21 Manuel Schneider 2016-12-13 09:04:17 UTC
Is there any progress on this one?
Comment 22 Martin Peres 2016-12-13 09:04:58 UTC
(In reply to Manuel Schneider from comment #21)
> Is there any progress on this one?

Not yet. It is on my TODO list though.
Comment 23 Manuel Schneider 2017-09-07 15:01:51 UTC
I have to revoke my second comment. This seems to affect nvidia people too.
Comment 24 Manuel Schneider 2017-09-07 15:03:03 UTC
Has there been any progress meanwhile?
Comment 25 Manuel Schneider 2017-12-06 13:09:56 UTC
@Martin Peres can I somehow help you to solve this issue? This is really a critical issue for all resizing, windowed apps.
Comment 26 Martin Peres 2017-12-06 13:32:45 UTC
(In reply to Manuel Schneider from comment #25)
> @Martin Peres can I somehow help you to solve this issue? This is really a
> critical issue for all resizing, windowed apps.

Sorry, no updates, and I really have no time to work on this at all :s I am very sorry about this, but we are spending as much time as possible on improving automated testing, and windowing system integration is going to be last on the list until we have a reasonable system and I can move back to driver development :s


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.