Created attachment 45347 [details] systeminformation I have talked to smspillaz on IRC (#compiz-dev) about the problem and he thought it is a good idea to ask on #intel-gfx. As I haven't got an answer I thought it would be good to describe my problem in an bug-report. As you can see from the screenshot the refresh rate is limited to 30FPS also the actual app (xbmc) is drawing at 60FPS http://img23.imageshack.us/i/compiz.jpg/ The result is, that not all frames make it to the screen and animations are not as smooth as they should be. "Sync to Vblank" is enabled in compiz. If I disable the option "Sync to Vblank" fullscreen updates do work much better, but if I move a window with "Sync to Vblank" disabled, the movement is very sluggish. This problem occurs every time a fullscreen update happens. Not only xbmc is affected, also other apps, even compiz itself is affected by the problem. For more information about my system please take a look at the attached gfx_info.log. If you need more information or if you think this is not a driver bug, please let me know.
A redirected app running at 60fps when vsynced under compiz will never hit 60fps...
2011/4/6 <bugzilla-daemon@freedesktop.org> > https://bugs.freedesktop.org/show_bug.cgi?id=36029 > > --- Comment #1 from Chris Wilson <chris@chris-wilson.co.uk> 2011-04-06 > 08:32:27 PDT --- > A redirected app running at 60fps when vsynced under compiz will never hit > 60fps... > > Okay, I never thought that I would only get 1/2 FPS with Sync to Vblank. Interesting is that partial screen updates are not affected by this problem. So the conclusion is that the compiz people need to fix there fullscreen behavior, like Martin described in his blog? http://blog.martin-graesslin.com/blog/2011/04/turning-compositing-off-in-the-right-way/
30fps sounds about right if the app is presenting frames every 16ms, but it takes a finite amount of time for it to be swapped i.e. every other frame will miss the vblank and so you will halve the framerate. Jesse can explain it much better if you want, since this is one of his favourite topics. In order for the app to hit 60fps it has to include the finite amount of time for the buffer to reach the hardware, that is it should be calling swapbuffers roughly half-way between vblanks. Kristian's favourite topic.
What I do not understand is, that if I reduce the resolution, I would expect to hit 60FPS at one point. The lowest resolution that I tried was 720x480@60Hz and I am still stuck at 30FPS. 1920x1080@60Hz http://img806.imageshack.us/i/compizsync2vblank.png/ 1280x800@60Hz http://img821.imageshack.us/i/20110427164111.jpg/ Is it because compiz doesn't support intel_swap_event or maybe XSync Fence Objects?
Today I had to kill compiz from tty1. After switching back to my Desktop I noticed everything was very smooth. Fullscreen updates where suddenly running with 60FPS. There was also no tearing, so it seems some component of the graphics stack is still taking care of that. But in my Xorg.log I saw this: [ 7382.770] (II) AIGLX: Suspending AIGLX clients for VT switch [ 7414.595] (II) Open ACPI successful (/var/run/acpid.socket) [ 7414.595] (II) AIGLX: Resuming AIGLX clients after VT switch [ 7414.910] (II) intel(0): EDID vendor "NEC", prod id 26489 [ 7414.910] (II) intel(0): Using hsync ranges from config file [ 7414.910] (II) intel(0): Using vrefresh ranges from config file [ 7414.910] (II) intel(0): Printing DDC gathered Modelines: [ 7414.910] (II) intel(0): Modeline "1920x1080"x0.0 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync (67.5 kHz) [ 7414.910] (II) intel(0): Modeline "1280x720"x0.0 74.25 1280 1390 1430 1650 720 725 730 750 +hsync +vsync (45.0 kHz) [ 7414.910] (II) intel(0): Modeline "720x480"x0.0 27.00 720 736 798 858 480 489 495 525 -hsync -vsync (31.5 kHz) [ 7414.910] (II) intel(0): Modeline "720x576"x0.0 27.00 720 732 796 864 576 581 586 625 -hsync -vsync (31.2 kHz) [ 7414.910] (II) intel(0): Modeline "1280x720"x0.0 74.25 1280 1720 1760 1980 720 725 730 750 +hsync +vsync (37.5 kHz) [ 7414.910] (II) intel(0): Modeline "1920x1080"x0.0 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync (56.2 kHz) [ 7414.910] (II) intel(0): Modeline "1920x1080i"x0.0 74.25 1920 2008 2052 2200 1080 1084 1094 1125 interlace +hsync +vsync (33.8 kHz) [ 7414.910] (II) intel(0): Modeline "800x600"x0.0 40.00 800 840 968 1056 600 601 605 628 +hsync +vsync (37.9 kHz) [ 7414.910] (II) intel(0): Modeline "800x600"x0.0 36.00 800 824 896 1024 600 601 603 625 +hsync +vsync (35.2 kHz) [ 7414.910] (II) intel(0): Modeline "640x480"x0.0 31.50 640 656 720 840 480 481 484 500 -hsync -vsync (37.5 kHz) [ 7414.911] (II) intel(0): Modeline "640x480"x0.0 31.50 640 664 704 832 480 489 492 520 -hsync -vsync (37.9 kHz) [ 7414.911] (II) intel(0): Modeline "640x480"x0.0 30.24 640 704 768 864 480 483 486 525 -hsync -vsync (35.0 kHz) [ 7414.911] (II) intel(0): Modeline "640x480"x0.0 25.18 640 656 752 800 480 490 492 525 -hsync -vsync (31.5 kHz) [ 7414.911] (II) intel(0): Modeline "720x400"x0.0 28.32 720 738 846 900 400 412 414 449 -hsync +vsync (31.5 kHz) [ 7414.911] (II) intel(0): Modeline "1280x1024"x0.0 135.00 1280 1296 1440 1688 1024 1025 1028 1066 +hsync +vsync (80.0 kHz) [ 7414.911] (II) intel(0): Modeline "1024x768"x0.0 78.75 1024 1040 1136 1312 768 769 772 800 +hsync +vsync (60.0 kHz) [ 7414.911] (II) intel(0): Modeline "1024x768"x0.0 75.00 1024 1048 1184 1328 768 771 777 806 -hsync -vsync (56.5 kHz) [ 7414.911] (II) intel(0): Modeline "1024x768"x0.0 65.00 1024 1048 1184 1344 768 771 777 806 -hsync -vsync (48.4 kHz) [ 7414.911] (II) intel(0): Modeline "832x624"x0.0 57.28 832 864 928 1152 624 625 628 667 -hsync -vsync (49.7 kHz) [ 7414.911] (II) intel(0): Modeline "800x600"x0.0 49.50 800 816 896 1056 600 601 604 625 +hsync +vsync (46.9 kHz) [ 7414.911] (II) intel(0): Modeline "800x600"x0.0 50.00 800 856 976 1040 600 637 643 666 +hsync +vsync (48.1 kHz) [ 7414.911] (II) intel(0): Modeline "1152x864"x0.0 108.00 1152 1216 1344 1600 864 865 868 900 +hsync +vsync (67.5 kHz) [ 7414.911] (II) intel(0): Modeline "1280x800"x0.0 71.00 1280 1328 1360 1440 800 803 809 823 +hsync -vsync (49.3 kHz) [ 7414.911] (II) intel(0): Modeline "1280x960"x0.0 108.00 1280 1376 1488 1800 960 961 964 1000 +hsync +vsync (60.0 kHz) [ 7414.911] (II) intel(0): Modeline "1280x1024"x0.0 108.00 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync (64.0 kHz) [ 7414.911] (II) intel(0): Modeline "1280x720"x60.0 74.48 1280 1336 1472 1664 720 721 724 746 -hsync +vsync (44.8 kHz) [ 7414.911] (II) intel(0): Modeline "1440x900"x0.0 88.75 1440 1488 1520 1600 900 903 909 926 +hsync -vsync (55.5 kHz) [ 7414.911] (II) intel(0): Modeline "1400x1050"x0.0 101.00 1400 1448 1480 1560 1050 1053 1057 1080 +hsync -vsync (64.7 kHz) [ 7414.911] (II) intel(0): Modeline "1680x1050"x0.0 119.00 1680 1728 1760 1840 1050 1053 1059 1080 +hsync -vsync (64.7 kHz) [ 7414.911] (II) intel(0): Modeline "1600x900"x60.0 119.00 1600 1696 1864 2128 900 901 904 932 -hsync +vsync (55.9 kHz) [ 7415.374] (WW) intel(0): I830DRI2GetMSC:1144 get vblank counter failed: Invalid argument [ 7415.608] (WW) intel(0): I830DRI2GetMSC:1144 get vblank counter failed: Invalid argument [ 7415.609] (WW) intel(0): I830DRI2GetMSC:1144 get vblank counter failed: Invalid argument [ 7415.610] (WW) intel(0): I830DRI2GetMSC:1144 get vblank counter failed: Invalid argument [ 7417.351] (WW) intel(0): I830DRI2GetMSC:1144 get vblank counter failed: Invalid argument [ 7423.238] (WW) intel(0): I830DRI2ScheduleWaitMSC:1204 get vblank counter failed: Invalid argument [ 7423.238] (WW) intel(0): first get vblank counter failed: Invalid argument [ 7423.261] (WW) intel(0): I830DRI2ScheduleWaitMSC:1204 get vblank counter failed: Invalid argument [ 7423.261] (WW) intel(0): first get vblank counter failed: Invalid argument [ 7423.267] (WW) intel(0): I830DRI2ScheduleWaitMSC:1204 get vblank counter failed: Invalid argument [ 7423.301] (WW) intel(0): I830DRI2ScheduleWaitMSC:1204 get vblank counter failed: Invalid argument [ 7423.308] (WW) intel(0): I830DRI2ScheduleWaitMSC:1204 get vblank counter failed: Invalid argument [ 7425.768] (WW) intel(0): first get vblank counter failed: Invalid argument [ 7427.810] (WW) intel(0): first get vblank counter failed: Invalid argument [ 7430.870] (WW) intel(0): first get vblank counter failed: Invalid argument [ 7430.875] (WW) intel(0): first get vblank counter failed: Invalid argument
I have updated to xorg-edgers ppa to see if it makes any difference. So far nothing has changed. I also did some tests with different options in compiz and the intel driver. The test are all about fullscreen updates. As earlier stated partial screen updates work like expected. This are my results: xorg.conf: Option "SwapbuffersWait" "1" Compiz: Sync to vblank "enabled" No tearing but stuck at 30 FPS. xorg.conf: Option "SwapbuffersWait" "1" Compiz: Sync to vblank "disabled" No tearing and 60 FPS xorg.conf: Option "SwapbuffersWait" "0" Compiz: Sync to vblank "enabled" Tearing and min 83 FPS, max 170 FPS. xorg.conf: Option "SwapbuffersWait" "0" Compiz: Sync to vblank "disabled" Tearing and min 83 FPS, max 170 FPS. The first two cases give the impression, that something is to often syncing to vblank. Other people in irc (#compiz) toled me that they don't have that issue with AMD or Nvidia. I can't test it, because I don't have any other system except the intel one. To my mind the last two cases show, that my graphcis chip should be able to run 60 FPS with sync to vblank without any problems. If you need more information, please let me know.
Created attachment 47517 [details] updated systeminformation
That does suggest that you are seeing two synchronous updates. Break out xtrace and see the commands being sent, look for DRI2*.
(In reply to comment #8) > That does suggest that you are seeing two synchronous updates. Break out xtrace > and see the commands being sent, look for DRI2*. Can you give me some advice how to use xtrace? This is what I get: $ xtrace No display name to create specified, trying :9 That's it nothing else happens. Is there something that I need to do before xtrace can work?
(In reply to comment #8) > That does suggest that you are seeing two synchronous updates. Break out xtrace > and see the commands being sent, look for DRI2*. After some "googeling", I found a bit more information on how to use xtrace. I was not able to run compiz under xtrace. So I have done two tests with "Revenge Of The Titans" under xtrace. One test was with sync to vblank in compiz enabled and one with sync to vblank in compiz disabled. My internet connection is very slow, so I am going to attach only a view lines with the keyword "DRI2". I hope this information is helpful.
Created attachment 47569 [details] Revenge Of The Titans xtrace
I noticed that in the typical condition of queuing a page-flip on the next vblank, we incurred an unnecessary rtt through the kernel to first queue a vblank wakeup and then pageflip. I've attempted a fix for this under sna, and I would be grateful if you can checkout xf86-video-intel.git and compile with --enable-sna and see if this improves performance on your system. If not, we'll enable the debug in that file and see what compiz is requesting.
(In reply to comment #12) > I noticed that in the typical condition of queuing a page-flip on the next > vblank, we incurred an unnecessary rtt through the kernel to first queue a > vblank wakeup and then pageflip. > > I've attempted a fix for this under sna, and I would be grateful if you can > checkout xf86-video-intel.git and compile with --enable-sna and see if this > improves performance on your system. > > If not, we'll enable the debug in that file and see what compiz is requesting. Today I tried to get this up and running, but it didn't work. dri2proto version of xorg-edgers is to old. It is 2.3, while the new intel driver requests 2.6. Then I tried to install everything from git with the help of this wiki page: http://www.x.org/wiki/CompileXserverManually Xserver doesn't want to build, so I grabbed it from your tree: git://anongit.freedesktop.org/~ickle/xserver and it build. But then as I tried to start the server I got this error: [ 23767.808] (EE) Error compiling keymap (server-0) [ 23767.808] (EE) XKB: Couldn't compile keymap [ 23767.808] (EE) XKB: Failed to load keymap. Loading default keymap instead. [ 23767.811] (EE) Error compiling keymap (server-0) [ 23767.811] (EE) XKB: Couldn't compile keymap [ 23767.811] XKB: Failed to compile keymap [ 23767.811] Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config. [ 23767.811] Fatal server error: Latest dri2proto was installed from git but at that time I hadn't build mesa. I guess that is also needed. Is there a chance that someone from the xorg-edgers people is going to pull the intel driver with sna-support? I am sorry that I am not very helpful at the moment.
Good news, xorg-edgers has enabled sna! (Hopefully you don't get caught by too many of the kernel/X bugs it has so far revealed.) But you can be first victim to test tripple-buffer vsync support... So please do install xserver-xorg-video-intel from ppa:xorg-edgers and see what happens.
(In reply to comment #14) > Good news, xorg-edgers has enabled sna! (Hopefully you don't get caught by too > many of the kernel/X bugs it has so far revealed.) > > But you can be first victim to test tripple-buffer vsync support... So please > do install xserver-xorg-video-intel from ppa:xorg-edgers and see what happens. Now I am very impressed. Compiz is running very smooth with 60FPS and vsync. Thank you very much.
Triple buffering landed for UXA in 2.16. *fingers crossed*
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.