Glamo Speed Improvement(s)

Thomas White taw at bitwiz.org.uk
Sun Nov 15 14:42:47 CET 2009


Executive summary: speed of 2D engine doubles if LCD FIFO settings are
tuned.  Also: no more busywaits with latest DRM kernel.

Hi all,

While debugging something different late last night, I noticed some
flags in one of Glamo's registers which looked interesting: FIFO
settings for the LCD engine.  This reminded me of an observation by Lars
a few weeks ago that the LCD engine seems to conflict with the 2D
engine on memory accesses, leading to slower performance of
accelerated 2D operations when the screen is switched on.  So I turned
the FIFO up to "8 stages" (from 1) to see what happened.  The result
was much faster 2D operations - literally twice the speed!

At "8 stages", the price of this was that the display became jittery
and unstable.  However, the same speed improvement is seen at the "4
stages" setting. I've also seen some occasional artifacts with this
setting, so I'm using 2 stages at the moment, where the speed is still
right up there.  I'll be testing some more and seeing if we can tune
the memory access even more.

Because we don't make the maximum use possible of the 2D engine, this
doesn't immediately translate into a huge increase in the UI speed.  But
the differences are very obvious with x11perf and some of my test
programs.

In addition, this week I've been working on kernel code to eliminate
the busywaits which are currently used when the CPU needs to wait for
the GPU.  I did this by implementing fence objects and a wait queue
mechanism where processes are sent to sleep until woken up by an
interrupt when Glamo is finished.

That means that we can now do accelerated operations at flat out speed
with little or no CPU usage. In practice it's not so simple, of course,
because there's an overhead associated with sending the process to
sleep then waking it up (and X seems to like accelerating even very
small operations), but combined with the FIFO improvements described
above this seems to make a noticeable improvement in the overall GUI
speed.

Anyone brave/stupid enough to test this will need the latest
drm-tracking kernel and xf86-video-glamo with KMS enabled.  For people
who don't currently use KMS, here's patch against current andy-tracking
which enabled the "magic FIFO" - but the busywait removal cannot easily
be implemented without DRM:
http://www.bitwiz.org.uk/glamo-lcd-fifo.patch

Tom

-- 
Thomas White <taw at bitwiz.org.uk>



More information about the devel mailing list