Skip to content

Commit

Permalink
drm/ttm: revert "add optional LRU removal callback v2"
Browse files Browse the repository at this point in the history
Without the custom LRU management the callback is not used any more.

agd: fix trivial warning

Reviewed-by: Sinclair Yeh <[email protected]>
Signed-off-by: Christian König <[email protected]>
Reviewed-and-Tested-by: Roger.He <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
  • Loading branch information
ChristianKoenigAMD authored and alexdeucher committed Jan 27, 2017
1 parent 260498f commit 896d630
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 5 additions & 8 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down
6 changes: 0 additions & 6 deletions include/drm/ttm/ttm_bo_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

/**
Expand Down

0 comments on commit 896d630

Please sign in to comment.