]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm: cope with reserved buffers on swap list in ttm_bo_swapout, v2
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>
Wed, 28 Nov 2012 11:25:42 +0000 (11:25 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 10 Dec 2012 10:21:06 +0000 (20:21 +1000)
commit898f8746f3d0f34da061fba802af58e91e527329
treee5ae35e162bf9d2248362d34126488447a7e0ab3
parent708cb175aec37e4cae71f9d2b3cff16f5f40d33f
drm/ttm: cope with reserved buffers on swap list in ttm_bo_swapout, v2

Replace the while loop with a simple for each loop, and only run the
delayed destroy cleanup if we can reserve the buffer first.

No race occurs, since lru lock is never dropped any more. An empty list
and a list full of unreservable buffers both cause -EBUSY to be returned,
which is identical to the previous situation.

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