Bug 16612 - [vblank]swap become slow after rotation
Summary: [vblank]swap become slow after rotation
Status: VERIFIED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: git
Hardware: Other Linux (All)
: medium major
Assignee: Keith Packard
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-03 22:39 UTC by liuhaien
Modified: 2010-05-19 18:38 UTC (History)
8 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg (120.66 KB, text/plain)
2008-07-03 22:39 UTC, liuhaien
no flags Details
xorg.0.log (89.53 KB, text/plain)
2008-07-03 22:41 UTC, liuhaien
no flags Details
xorg conf file (3.62 KB, text/plain)
2008-07-03 22:43 UTC, liuhaien
no flags Details
glswap.c (3.18 KB, text/plain)
2008-07-03 23:09 UTC, liuhaien
no flags Details

Description liuhaien 2008-07-03 22:39:41 UTC
Created attachment 17516 [details]
dmesg

System Environment:
--------------------------

--Platform:gm965

--Architecture:32-bit

--2D driver: master 55678c64bc6e3ed613ea6db14c105c18a0cf28ce

--3D driver:master d3f7b463c3975c070503053e4ad70af99016a756

--DRM: master 5d27fd94afaaf434c3a92af0075420b550055bfb

--Xserver:master e4335e876d254e446a965259e845ad955da5b5c2


--Kernel:2.6.26-rc6

Bug detailed description:
--------------------------
when run glswap with vblank_mode=3,it works well without rotation,but if I run "xrandr --output LVDS --rotate left" or other rotations ,the swap become very slow:about one swap in two seconds.In dmesg ,we can get such info:
"[drm:i915_vblank_swap] *ERROR* Invalid pipe 1"
Reproduce steps:
----------------
1. startx 
2.vblank-mode=3 ./glswap
3.xrandr --output LVDS --rotate left



Current result:
----------------
after rotation,swap become very slow.




Expected result:
----------------
work well after rotation.
Comment 1 liuhaien 2008-07-03 22:41:42 UTC
Created attachment 17517 [details]
xorg.0.log
Comment 2 liuhaien 2008-07-03 22:43:05 UTC
Created attachment 17518 [details]
xorg conf file
Comment 3 liuhaien 2008-07-03 22:46:13 UTC
sometimes,we cannot see any swap after rotation.
Comment 4 liuhaien 2008-07-03 23:09:48 UTC
Created attachment 17521 [details]
glswap.c
Comment 5 Gordon Jin 2009-02-23 23:50:01 UTC
Haien, does this still exist?
Comment 6 liuhaien 2009-02-23 23:58:31 UTC
(In reply to comment #5)
> Haien, does this still exist?
> 

yes,still exists against the latest driver.
Comment 7 liuhaien 2009-02-24 00:25:46 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Haien, does this still exist?
> > 
> 
> yes,still exists against the latest driver.
> 

we retest it with below commit:
Libdrm:         (master)4a0d19ef4f210cea9e60c5acc355df03723ef808
Mesa:           (mesa_7_4_branch)e2092bb23c956ba9ab940935f803ef843db81af2
Xserver:        (server-1.6-branch)4557b3f6c4273cd83b701beaf7a150c806fed298
Xf86_video_intel:              
(master)81c652e9a666a7459bcc5217c8a5ec518b6e00da
GEM_kernel:       (for-airlied)99d31f896d243c13bb90b56620d33b416a5cffa7
Comment 8 liuhaien 2009-03-22 20:41:06 UTC
still exists against:
Libdrm:         (master)00d8e960ca665b7f0528438331f4d0ae77fbb4cc
Mesa:(mesa_7_4_branch)b009a32bf428192fef2dc4787d25f022a472854f          
Xserver:        (server-1.6-branch)60c161545af80eb78eb790a05bde79409dfdf16e
Xf86_video_intel:       (2.7)e2465249a90b9aefe6d7a96eb56a51fde54698a0
Kernel:       (for-airlied)a2e785c32b886dd7f0289d1cf15fc14e9c81bc01
Comment 9 Jesse Barnes 2009-05-04 14:02:12 UTC
I think this particular bug must be gone now since vblank_mode=3 won't have any effect with DRI2.  But we do need to support rotation better; right now we just blit from the front buffer to the rotate buffer at block handler time.  It should be done at vblank time if there's ever anything to copy.
Comment 10 Jesse Barnes 2009-06-11 11:03:15 UTC
Here's the rotation slowness bug Keith, have fun.
Comment 11 Gordon Jin 2009-06-12 11:32:37 UTC
removing "vblank_mode=3" from title since this is not the key now.
Comment 12 Gordon Jin 2009-08-19 02:15:07 UTC
keith, any plan to fix this "rotation slowness"? It'll be good if we fix it in Q3.
Comment 13 Keith Packard 2009-08-19 10:13:03 UTC
I'm fairly sure the slowness is caused by X server scheduling which limits how often the screen is redrawn under rotation. I've been considering what changes might be made within the X server to reduce the delays. But, none of this work would be done within the video driver, so it's not really related to our Q3 release.

You can test this in your environment by running two copies of glxgears; that will force the X server to schedule screen updates more often.

I'm going to refile this with the X server instead of the video driver.
Comment 14 Eric Anholt 2009-08-26 18:01:48 UTC
commit e7dd1efef408effe52d0bd3d3aa0b5d4ee10ed90
Author: Keith Packard <keithp@keithp.com>
Date:   Tue Aug 25 18:07:00 2009 -0700

    Ensure that rotation updates happen frequently
Comment 15 zhao jian 2009-08-28 01:09:37 UTC
But now it can't be tested with glswap because SGI_swap_control was disabled by the following commit in Mesa. 

commit 279143c6e808b37c333321b696d80df77f709a04
Author: Owen W. Taylor <otaylor@fishsoup.net>
Date:   Sat Jun 6 14:46:22 2009 -0400

    Disable SGI_swap_control extension for DRI2
Comment 16 zhao jian 2009-08-31 00:25:45 UTC
For the SGI_swap_control was disabled on both master and 7_5 branch, so I rebuilt it with 7_4 branch of mesa. I tested with glswap, after rotation, it becomes slower compared with before it rotates. And I tried with the method mentioned by Keith that I run two glxgears it looks a little faster than without glxgears but it still slower than before it rotates.  
I tested with 
Libdrm:         (master)ce6c68dc8a893ed8673f49d381a8500c2ee3c29f
Mesa:           (mesa_7_4_branch)4f84350abc28dc2e5153c9f5c7acab1fb23107c3
Xserver:        (server-1.6-branch)3044711412d0a08ba65a491bd2441c0c8980f5e2
Xf86_video_intel:    (master)6361c3b9af39265df9222b1f3b6fb9c4197087c1
Comment 17 zhao jian 2009-09-02 03:10:36 UTC
I tested with the newest code, after I start X, run glxgears, it is 248 fps, and run openarena/stress_bases3 it is 18.1 fps. Then I rotate the screen, the glxgears is only 81 fps, and openarena is 13.1 fps. I test with: 
Libdrm:         (master)73b59c894380995a2889b98e79acadd2da0bb237
Mesa:           (master)7d361537661b93a501c9533271458a41b965ea79
Xserver:         (server-1.6-branch)3044711412d0a08ba65a491bd2441c0c8980f5e2
Xf86_video_intel:   (master)5812531e08147576de776b2dd64e7f94c08eb851
Kernel:         (master)326ba5010a5429a5a528b268b36a5900d4ab0eba
So I think this issue still existed and I reopen it. 
Comment 18 Gordon Jin 2009-09-14 02:26:24 UTC
lower priority: Moblin has got a workaround and not pushing hard now.
Comment 19 Stefan Dirsch 2010-04-03 03:08:09 UTC
(In reply to comment #18)
> lower priority: Moblin has got a workaround and not pushing hard now.

Which kind of workaround is this. Could you share more details with us, please?
Comment 20 Stefan Dirsch 2010-04-09 05:47:14 UTC
The statement of " Moblin has got a workaround" came from Novell! More details:

======================================================================
That comment in freedesktop bugzilla is not totally correct, as what
we have for moblin is not a workaround at all.

At first, <vendor> requested us to provide the ability to show a 1024x768
desktop within a 1024x600 LCD screen for netbook. But then, we found the bug
https://bugzilla.novell.com/show_bug.cgi?id=527359.  At the end, due to
various performance issues with X, <vendor> dropped that requirement. So, we
didn't have a workaround for the problem, <vendor> simply dropped the
requirement so we no longer need to work on it.
======================================================================
Comment 21 zhao jian 2010-05-19 03:25:04 UTC
I teseted with the newest code on master branches on piketon and pinetrail, don't see such issue now. And it has no affect on our use after the rotation. The data is as following:

On Piketon:
before rotate:
glxgears: 60 fps; glxgears without vblank_sync: 836 fps
openarena(1024x768): 69.3 fps; openarena without vblank_sync: 72.9 fps
after rotation: (I rotate it left, right, inverted and then back to normal)
glxgears: 60 fps; glxgears without vblank_sync: 835 fps
openarena(1024x768): 66.6 fps; openarena without vblank_sync: 72.9 fps

On Pinetrail:
glxgears: 60 fps; glxgears without vblank_sync: 299 fps
openarena: can't run 
after rotation: (I rotate it left, right, inverted and then back to normal)
glxgears: 60 fps; glxgears without vblank_sync: 299 fps
Comment 22 Gordon Jin 2010-05-19 18:37:57 UTC
closing


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.