drm/ttm: revert "add optional LRU removal callback v2"
authorChristian König <christian.koenig@amd.com>
Thu, 12 Jan 2017 10:54:11 +0000 (11:54 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 27 Jan 2017 17:20:35 +0000 (12:20 -0500)
Without the custom LRU management the callback is not used any more.

agd: fix trivial warning

Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-and-Tested-by: Roger.He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/ttm/ttm_bo.c
include/drm/ttm/ttm_bo_driver.h

index 8c5c64d52af284310ff1e70b94d2bb3356c13955..e7ab0264001d2a6a5155410de460a325799883b3 100644 (file)
@@ -186,12 +186,8 @@ EXPORT_SYMBOL(ttm_bo_add_to_lru);
 
 int ttm_bo_del_from_lru(struct ttm_buffer_object *bo)
 {
-       struct ttm_bo_device *bdev = bo->bdev;
        int put_count = 0;
 
-       if (bdev->driver->lru_removal)
-               bdev->driver->lru_removal(bo);
-
        if (!list_empty(&bo->swap)) {
                list_del_init(&bo->swap);
                ++put_count;
@@ -201,6 +197,11 @@ int ttm_bo_del_from_lru(struct ttm_buffer_object *bo)
                ++put_count;
        }
 
+       /*
+        * TODO: Add a driver hook to delete from
+        * driver-specific LRU's here.
+        */
+
        return put_count;
 }
 
@@ -229,14 +230,10 @@ EXPORT_SYMBOL(ttm_bo_del_sub_from_lru);
 
 void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo)
 {
-       struct ttm_bo_device *bdev = bo->bdev;
        int put_count = 0;
 
        lockdep_assert_held(&bo->resv->lock.base);
 
-       if (bdev->driver->lru_removal)
-               bdev->driver->lru_removal(bo);
-
        put_count = ttm_bo_del_from_lru(bo);
        ttm_bo_list_ref_sub(bo, put_count, true);
        ttm_bo_add_to_lru(bo);
index f1b243f112aaf16a4a3980d6167dfff25a076a42..7e75fa0534739c2c35c357d9a0f88afeb098b07f 100644 (file)
@@ -462,12 +462,6 @@ struct ttm_bo_driver {
                              struct ttm_mem_reg *mem);
        void (*io_mem_free)(struct ttm_bo_device *bdev,
                            struct ttm_mem_reg *mem);
-
-       /**
-        * Optional driver callback for when BO is removed from the LRU.
-        * Called with LRU lock held immediately before the removal.
-        */
-       void (*lru_removal)(struct ttm_buffer_object *bo);
 };
 
 /**