drm/ttm: Add a swap_notify callback.
This is needed for a bugfix in the vmwgfx driver. Drivers may have GPU bindings on buffers that core TTM is not aware of, and TTM may view those buffers as ordinary system memory buffers. Add a notifier to such drivers when TTM is about to move the buffer contents out to swappable memory. The driver must then release any private GPU bindings on those buffers. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
committed by
Dave Airlie
parent
effe1105be
commit
3f09ea4ecd
@@ -1844,6 +1844,9 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
|
||||
* anyone tries to access a ttm page.
|
||||
*/
|
||||
|
||||
if (bo->bdev->driver->swap_notify)
|
||||
bo->bdev->driver->swap_notify(bo);
|
||||
|
||||
ret = ttm_tt_swapout(bo->ttm, bo->persistant_swap_storage);
|
||||
out:
|
||||
|
||||
|
Reference in New Issue
Block a user