drm/ttm: Optimize delayed buffer destruction
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 19 Oct 2010 07:01:01 +0000 (09:01 +0200)
committerDave Airlie <airlied@redhat.com>
Thu, 21 Oct 2010 01:53:28 +0000 (11:53 +1000)
commite1efc9b6ac22c605fd326b3f6af9b393325d43b4
tree98960a29a6b4217b3ac219fd2be37e6b648e4589
parent40d857bba2915a4e8d82f44744a186bfdd1a46ea
drm/ttm: Optimize delayed buffer destruction

This commit replaces the ttm_bo_cleanup_ref function with two new functions.
One for the case where the bo is not yet on the delayed destroy list, and
one for the case where the bo was on the delayed destroy list, at least at
the time of call. This makes it possible to optimize the two cases somewhat.

It also enables the possibility to directly destroy buffers on the
delayed delete list when they are about to be evicted or swapped out.
Currently they were only evicted / swapped and destruction was left for the
delayed buffer destruction thread.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/ttm/ttm_bo.c