Commit b0e2c9ea authored by Christian König's avatar Christian König
parent 5d05b988
...@@ -51,10 +51,11 @@ EXPORT_SYMBOL(ttm_lru_bulk_move_init); ...@@ -51,10 +51,11 @@ EXPORT_SYMBOL(ttm_lru_bulk_move_init);
*/ */
void ttm_lru_bulk_move_tail(struct ttm_lru_bulk_move *bulk) void ttm_lru_bulk_move_tail(struct ttm_lru_bulk_move *bulk)
{ {
unsigned i; unsigned i, j;
for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) { for (i = 0; i < TTM_NUM_MEM_TYPES; ++i) {
struct ttm_lru_bulk_move_pos *pos = &bulk->tt[i]; for (j = 0; j < TTM_MAX_BO_PRIORITY; ++j) {
struct ttm_lru_bulk_move_pos *pos = &bulk->pos[i][j];
struct ttm_resource_manager *man; struct ttm_resource_manager *man;
if (!pos->first) if (!pos->first)
...@@ -64,25 +65,10 @@ void ttm_lru_bulk_move_tail(struct ttm_lru_bulk_move *bulk) ...@@ -64,25 +65,10 @@ void ttm_lru_bulk_move_tail(struct ttm_lru_bulk_move *bulk)
dma_resv_assert_held(pos->first->bo->base.resv); dma_resv_assert_held(pos->first->bo->base.resv);
dma_resv_assert_held(pos->last->bo->base.resv); dma_resv_assert_held(pos->last->bo->base.resv);
man = ttm_manager_type(pos->first->bo->bdev, TTM_PL_TT); man = ttm_manager_type(pos->first->bo->bdev, i);
list_bulk_move_tail(&man->lru[i], &pos->first->lru, list_bulk_move_tail(&man->lru[j], &pos->first->lru,
&pos->last->lru); &pos->last->lru);
} }
for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
struct ttm_lru_bulk_move_pos *pos = &bulk->vram[i];
struct ttm_resource_manager *man;
if (!pos->first)
continue;
lockdep_assert_held(&pos->first->bo->bdev->lru_lock);
dma_resv_assert_held(pos->first->bo->base.resv);
dma_resv_assert_held(pos->last->bo->base.resv);
man = ttm_manager_type(pos->first->bo->bdev, TTM_PL_VRAM);
list_bulk_move_tail(&man->lru[i], &pos->first->lru,
&pos->last->lru);
} }
} }
EXPORT_SYMBOL(ttm_lru_bulk_move_tail); EXPORT_SYMBOL(ttm_lru_bulk_move_tail);
...@@ -122,15 +108,7 @@ void ttm_resource_move_to_lru_tail(struct ttm_resource *res, ...@@ -122,15 +108,7 @@ void ttm_resource_move_to_lru_tail(struct ttm_resource *res,
if (!bulk) if (!bulk)
return; return;
switch (res->mem_type) { ttm_lru_bulk_move_set_pos(&bulk->pos[res->mem_type][bo->priority], res);
case TTM_PL_TT:
ttm_lru_bulk_move_set_pos(&bulk->tt[bo->priority], res);
break;
case TTM_PL_VRAM:
ttm_lru_bulk_move_set_pos(&bulk->vram[bo->priority], res);
break;
}
} }
/** /**
......
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#include <drm/ttm/ttm_resource.h> #include <drm/ttm/ttm_resource.h>
#include <drm/ttm/ttm_pool.h> #include <drm/ttm/ttm_pool.h>
#define TTM_NUM_MEM_TYPES 8
struct ttm_device; struct ttm_device;
struct ttm_placement; struct ttm_placement;
struct ttm_buffer_object; struct ttm_buffer_object;
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <drm/ttm/ttm_kmap_iter.h> #include <drm/ttm/ttm_kmap_iter.h>
#define TTM_MAX_BO_PRIORITY 4U #define TTM_MAX_BO_PRIORITY 4U
#define TTM_NUM_MEM_TYPES 8
struct ttm_device; struct ttm_device;
struct ttm_resource_manager; struct ttm_resource_manager;
...@@ -222,8 +223,7 @@ struct ttm_lru_bulk_move_pos { ...@@ -222,8 +223,7 @@ struct ttm_lru_bulk_move_pos {
* ttm_lru_bulk_move_init() and ttm_bo_move_to_lru_tail(). * ttm_lru_bulk_move_init() and ttm_bo_move_to_lru_tail().
*/ */
struct ttm_lru_bulk_move { struct ttm_lru_bulk_move {
struct ttm_lru_bulk_move_pos tt[TTM_MAX_BO_PRIORITY]; struct ttm_lru_bulk_move_pos pos[TTM_NUM_MEM_TYPES][TTM_MAX_BO_PRIORITY];
struct ttm_lru_bulk_move_pos vram[TTM_MAX_BO_PRIORITY];
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment