]> 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)
commit154d5a189bb8cb55b3d5ef7ed8116f1d086abd9c
treee5ae35e162bf9d2248362d34126488447a7e0ab3
parent2c8ec96ae0b0742326549c8f9245b9a685aad8f3
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