freedreno: add bo cache
authorRob Clark <robclark@freedesktop.org>
Fri, 13 Dec 2013 17:48:30 +0000 (12:48 -0500)
committerRob Clark <robclark@freedesktop.org>
Fri, 13 Dec 2013 20:48:10 +0000 (15:48 -0500)
commit068ea68b3f7ebd5efcfcc2f6ae417651423c8382
treee094e44e8d01c33ab8e5d74aa489308f267d3eea
parent1489811a805fb6b5b19d61fa99b9b962cc06bd22
freedreno: add bo cache

Workloads which create many transient buffers cause significant CPU
overhead in buffer allocation, zeroing, cache maint, and mmap setup.
By caching and re-using existing buffers, the CPU overhead drops
significantly.  See:

http://bloggingthemonkey.blogspot.com/2013/09/freedreno-update-moar-fps.html

A simple time based policy is used for purging the cache.  Once the
kernel supports it, we could use madvise style API to handle memory
pressure scenarios a bit better.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/freedreno_bo.c
freedreno/freedreno_device.c
freedreno/freedreno_priv.h
freedreno/kgsl/kgsl_bo.c