From 98cb8df47c992b5c8dbed95cdc9f0e669bdab7bf Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 13 Jan 2010 22:28:40 +0100 Subject: [PATCH] --- yaml --- r: 179845 b: refs/heads/master c: 3f09ea4ecdcbcea05541f83e557d6ce2e56626d8 h: refs/heads/master i: 179843: 64284619a25eaf674270d3d8018fd4a63754a316 v: v3 --- [refs] | 2 +- trunk/drivers/gpu/drm/ttm/ttm_bo.c | 3 +++ trunk/include/drm/ttm/ttm_bo_driver.h | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 4a316f366c1e..e37ce6fd8711 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: effe1105bef07f42366c20eac41b80ff9fcf675e +refs/heads/master: 3f09ea4ecdcbcea05541f83e557d6ce2e56626d8 diff --git a/trunk/drivers/gpu/drm/ttm/ttm_bo.c b/trunk/drivers/gpu/drm/ttm/ttm_bo.c index 2920f9a279e1..e10a04e7c4e9 100644 --- a/trunk/drivers/gpu/drm/ttm/ttm_bo.c +++ b/trunk/drivers/gpu/drm/ttm/ttm_bo.c @@ -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: diff --git a/trunk/include/drm/ttm/ttm_bo_driver.h b/trunk/include/drm/ttm/ttm_bo_driver.h index ff7664e0c3cd..4c4e0f8375b3 100644 --- a/trunk/include/drm/ttm/ttm_bo_driver.h +++ b/trunk/include/drm/ttm/ttm_bo_driver.h @@ -353,6 +353,11 @@ struct ttm_bo_driver { /* notify the driver we are taking a fault on this BO * and have reserved it */ void (*fault_reserve_notify)(struct ttm_buffer_object *bo); + + /** + * notify the driver that we're about to swap out this bo + */ + void (*swap_notify) (struct ttm_buffer_object *bo); }; /**