Bug 50616 - glClear occasionally taking >60ms
Summary: glClear occasionally taking >60ms
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r600 (show other bugs)
Version: 8.0
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-02 06:29 UTC by Lauri Kasanen
Modified: 2012-06-06 04:16 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Lauri Kasanen 2012-06-02 06:29:45 UTC
I have a test app that draws 65k point sprites, apitrace: http://kiwi6.com/file/0c0512r1no (980kb).

Apitrace says that on average glClear takes 28ms, and many clear calls take over 60ms. Surely it shouldn't take that long?

If it were because of tearing prevention, it should take at most 16ms (1/60Hz).


--

vblank_mode=0 had no change, oprofile says Mesa takes less than 2% cpu.
Latencytop shows radeon_fence_wait taking between 3 and 5ms during rendering.

--

Mesa 8.0.3
Linux 3.2.17
HD4350 / r600g
Comment 1 Lauri Kasanen 2012-06-02 06:32:41 UTC
http://kiwi6.com/file/95a4z148f2 (550kb)

The timing output from apitrace.
Comment 2 Alex Deucher 2012-06-03 08:08:04 UTC
Does setting:
Option "SwapbuffersWait" "false"
in the device section of your xorg.conf help?
Comment 3 Lauri Kasanen 2012-06-03 08:22:27 UTC
No, it does not.

It improved the average a tiny bit, but the long ones were still there.
Comment 4 Michel Dänzer 2012-06-05 03:46:52 UTC
(In reply to comment #3)
> It improved the average a tiny bit, but the long ones were still there.

Did you try it with vblank_mode=0 as well?


Calling glFinish() instead of glFlush() before glXSwapBuffers() might give a better idea of where the time is actually spent.


P.S. Please attach files here directly instead of referencing external sites.
Comment 5 Lauri Kasanen 2012-06-05 11:42:35 UTC
OK, with swapbufferswait off, vblank_mode=0, and added glFinish, most of the time is indeed spent in glFinish, up to 60ms.

glClear takes on average 110 us, with the highest being 2.6ms. Still high, but not alarmingly so.

I suppose this means the card is just that slow?

PS:
On the files, last time I tried to attach apitrace output here I hit a size limit...
Comment 6 Michel Dänzer 2012-06-06 02:13:30 UTC
(In reply to comment #5)
> I suppose this means the card is just that slow?

It means the time is spent for the actual rendering, not just for the clears. Maybe you can narrow it down further, e.g. by sprinkling glFinish() calls across more places.

You might get better performance out of the card with a current 3.5-rc kernel thanks to better tiling setup, but it is a lower end card, so I wouldn't expect any miracles. :)


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.