Commit e9172ada authored by Dave Airlie's avatar Dave Airlie
parent a9136ab5
...@@ -31,12 +31,6 @@ ...@@ -31,12 +31,6 @@
#include <core/tegra.h> #include <core/tegra.h>
static int
nouveau_manager_init(struct ttm_mem_type_manager *man, unsigned long psize)
{
return 0;
}
static int static int
nouveau_manager_fini(struct ttm_mem_type_manager *man) nouveau_manager_fini(struct ttm_mem_type_manager *man)
{ {
...@@ -76,7 +70,6 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, ...@@ -76,7 +70,6 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
} }
const struct ttm_mem_type_manager_func nouveau_vram_manager = { const struct ttm_mem_type_manager_func nouveau_vram_manager = {
.init = nouveau_manager_init,
.takedown = nouveau_manager_fini, .takedown = nouveau_manager_fini,
.get_node = nouveau_vram_manager_new, .get_node = nouveau_vram_manager_new,
.put_node = nouveau_manager_del, .put_node = nouveau_manager_del,
...@@ -101,7 +94,6 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, ...@@ -101,7 +94,6 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man,
} }
const struct ttm_mem_type_manager_func nouveau_gart_manager = { const struct ttm_mem_type_manager_func nouveau_gart_manager = {
.init = nouveau_manager_init,
.takedown = nouveau_manager_fini, .takedown = nouveau_manager_fini,
.get_node = nouveau_gart_manager_new, .get_node = nouveau_gart_manager_new,
.put_node = nouveau_manager_del, .put_node = nouveau_manager_del,
...@@ -135,7 +127,6 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man, ...@@ -135,7 +127,6 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man,
} }
const struct ttm_mem_type_manager_func nv04_gart_manager = { const struct ttm_mem_type_manager_func nv04_gart_manager = {
.init = nouveau_manager_init,
.takedown = nouveau_manager_fini, .takedown = nouveau_manager_fini,
.get_node = nv04_gart_manager_new, .get_node = nv04_gart_manager_new,
.put_node = nouveau_manager_del, .put_node = nouveau_manager_del,
...@@ -191,27 +182,21 @@ nouveau_ttm_init_vram(struct nouveau_drm *drm) ...@@ -191,27 +182,21 @@ nouveau_ttm_init_vram(struct nouveau_drm *drm)
man->func = &nouveau_vram_manager; man->func = &nouveau_vram_manager;
man->use_io_reserve_lru = true; man->use_io_reserve_lru = true;
ttm_mem_type_manager_init(&drm->ttm.bdev, man,
drm->gem.vram_available >> PAGE_SHIFT);
ttm_mem_type_manager_set_used(man, true);
return 0;
} else { } else {
man->func = &ttm_bo_manager_func; return ttm_range_man_init(&drm->ttm.bdev, man,
drm->gem.vram_available >> PAGE_SHIFT);
} }
return ttm_bo_init_mm(&drm->ttm.bdev, TTM_PL_VRAM,
drm->gem.vram_available >> PAGE_SHIFT);
} }
static int static int
nouveau_ttm_init_gtt(struct nouveau_drm *drm) nouveau_ttm_init_gtt(struct nouveau_drm *drm)
{ {
struct ttm_mem_type_manager *man = &drm->ttm.bdev.man[TTM_PL_TT]; struct ttm_mem_type_manager *man = &drm->ttm.bdev.man[TTM_PL_TT];
unsigned long size_pages = drm->gem.gart_available >> PAGE_SHIFT;
if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA)
man->func = &nouveau_gart_manager;
else
if (!drm->agp.bridge)
man->func = &nv04_gart_manager;
else
man->func = &ttm_bo_manager_func;
man->use_tt = true; man->use_tt = true;
if (drm->agp.bridge) { if (drm->agp.bridge) {
man->available_caching = TTM_PL_FLAG_UNCACHED | man->available_caching = TTM_PL_FLAG_UNCACHED |
...@@ -222,8 +207,18 @@ nouveau_ttm_init_gtt(struct nouveau_drm *drm) ...@@ -222,8 +207,18 @@ nouveau_ttm_init_gtt(struct nouveau_drm *drm)
man->default_caching = TTM_PL_FLAG_CACHED; man->default_caching = TTM_PL_FLAG_CACHED;
} }
return ttm_bo_init_mm(&drm->ttm.bdev, TTM_PL_TT, if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA)
drm->gem.gart_available >> PAGE_SHIFT); man->func = &nouveau_gart_manager;
else if (!drm->agp.bridge)
man->func = &nv04_gart_manager;
else
return ttm_range_man_init(&drm->ttm.bdev, man,
size_pages);
ttm_mem_type_manager_init(&drm->ttm.bdev, man,
size_pages);
ttm_mem_type_manager_set_used(man, true);
return 0;
} }
int int
......
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