[Intel-gfx] GEM object write

Shaohua Li shaohua.li at intel.com
Mon Mar 30 03:19:58 CEST 2009


Hi,
I recently did some benchmarks with different GEM object write methods

1. bo_map.
This approach will memory map the gem object to write-back, and then
flush cache to memory. I did a benchmark to compare mapping memory to
write-back (and then clflush cache) and write-combine. In my test,
write-combine is about 3 times faster than the write-back (please try
with attached module). The data is quite stable in my test.

2. pwrite
pwrite almost will map gem object to write-combine (if the gem object is
in gtt, and this is almost true in general case), but it adds extra
copy. In my XVMC test, pwrite approach cause 20% performance lost.

3. bo_map_gtt
this approach will bind gem object to gtt and map object as
write-combine. This is the fastest approach and equal to the performance
without GEM, but the object should be bound to gtt and can't be swapped
out as the mapping is for a device.

Since the real cause of performance lost is the memory mapping type, I
suggest have a new API which is like bo_map_gtt, but don't bind object
to GTT, that is just doing write-combine map. This still has the
unswappable issue, but has a fast API. Any idea?

Thanks,
Shaohua
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 1451 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090330/58f328a7/attachment.c>


More information about the Intel-gfx mailing list