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)
commit2b7b3ad2fb8f904ae9ba7ca71323bc11c0978d91
treee5ae35e162bf9d2248362d34126488447a7e0ab3
parent85b144f860176ec18db927d6d9ecdfb24d9c6483
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