Annotated i965_prepare_composite ready for optimization

Carl Worth cworth at cworth.org
Tue Jun 26 10:54:40 PDT 2007


On Fri, 22 Jun 2007 12:35:28 +0200, Michel Dänzer wrote:
> The state memory is probably in the AGP aperture, so uncacheable. It
> should also be write-combined though, so an easy improvement could be to
> initialize a malloced copy and then memcpy it to the final destination
> in one go.

Thanks for the suggestion. I actually tried malloc'ing the whole state
structure and copying it all, but for some reason I couldn't get that
to work correctly. Keith suggested I take it a piece at a time and
start with each of the sub-structures. That approach also means that
there's no need to malloc anything since the structure sizes are all
known at compile time, (the size of the super-structure is computed
dynamically to account for various alignment constraints).

So here's a short series of patches to do that. This series also
removes one of the calls to i830WaitSync which appears totally
unnecessary.

With this series, i965_prepare_composite falls off the top of the
profile where it had been consuming 27% of the total time and it's now
showing up down at 5.8%. Meanwhile, this series does also add an
additional 3% of time due to memcpy. So, more could definitely be done
to improve things by not copying unchanged data. But I think this is a
good start for now.

I'll put some charts showing the improvement up on my blog at

	http://cworth.org/blog

Would someone like to review this series and push it or just give me
the go ahead to push it? The patchset is attached and there's also a
git branch available here:

	http://cgit.freedesktop.org/~cworth/xf86-video-intel/

	git://people.freedesktop.org/~cworth/xf86-video-intel/

Thanks,

-Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: speedup-i965_prepare_composite.patchset
Type: application/octet-stream
Size: 15948 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20070626/1f26ed06/attachment.obj>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20070626/1f26ed06/attachment.pgp>


More information about the xorg mailing list