Commit 058b5e34 authored by Dave Airlie's avatar Dave Airlie
parent cff099e7
...@@ -31,12 +31,6 @@ ...@@ -31,12 +31,6 @@
#include <core/tegra.h> #include <core/tegra.h>
static int
nouveau_manager_fini(struct ttm_mem_type_manager *man)
{
return 0;
}
static void static void
nouveau_manager_del(struct ttm_mem_type_manager *man, struct ttm_mem_reg *reg) nouveau_manager_del(struct ttm_mem_type_manager *man, struct ttm_mem_reg *reg)
{ {
...@@ -70,7 +64,6 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, ...@@ -70,7 +64,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 = {
.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,
}; };
...@@ -94,7 +87,6 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, ...@@ -94,7 +87,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 = {
.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,
}; };
...@@ -127,7 +119,6 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man, ...@@ -127,7 +119,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 = {
.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,
}; };
...@@ -192,6 +183,19 @@ nouveau_ttm_init_vram(struct nouveau_drm *drm) ...@@ -192,6 +183,19 @@ nouveau_ttm_init_vram(struct nouveau_drm *drm)
} }
} }
static void
nouveau_ttm_fini_vram(struct nouveau_drm *drm)
{
struct ttm_mem_type_manager *man = &drm->ttm.bdev.man[TTM_PL_VRAM];
if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
ttm_mem_type_manager_disable(man);
ttm_mem_type_manager_force_list_clean(&drm->ttm.bdev, man);
ttm_mem_type_manager_cleanup(man);
} else
ttm_range_man_fini(&drm->ttm.bdev, man);
}
static int static int
nouveau_ttm_init_gtt(struct nouveau_drm *drm) nouveau_ttm_init_gtt(struct nouveau_drm *drm)
{ {
...@@ -221,6 +225,21 @@ nouveau_ttm_init_gtt(struct nouveau_drm *drm) ...@@ -221,6 +225,21 @@ nouveau_ttm_init_gtt(struct nouveau_drm *drm)
return 0; return 0;
} }
static void
nouveau_ttm_fini_gtt(struct nouveau_drm *drm)
{
struct ttm_mem_type_manager *man = &drm->ttm.bdev.man[TTM_PL_TT];
if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA &&
drm->agp.bridge)
ttm_range_man_fini(&drm->ttm.bdev, man);
else {
ttm_mem_type_manager_disable(man);
ttm_mem_type_manager_force_list_clean(&drm->ttm.bdev, man);
ttm_mem_type_manager_cleanup(man);
}
}
int int
nouveau_ttm_init(struct nouveau_drm *drm) nouveau_ttm_init(struct nouveau_drm *drm)
{ {
...@@ -310,8 +329,8 @@ nouveau_ttm_fini(struct nouveau_drm *drm) ...@@ -310,8 +329,8 @@ nouveau_ttm_fini(struct nouveau_drm *drm)
{ {
struct nvkm_device *device = nvxx_device(&drm->client.device); struct nvkm_device *device = nvxx_device(&drm->client.device);
ttm_bo_clean_mm(&drm->ttm.bdev, TTM_PL_VRAM); nouveau_ttm_fini_vram(drm);
ttm_bo_clean_mm(&drm->ttm.bdev, TTM_PL_TT); nouveau_ttm_fini_gtt(drm);
ttm_bo_device_release(&drm->ttm.bdev); ttm_bo_device_release(&drm->ttm.bdev);
......
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