summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_memory.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-04-20 13:12:28 +1000
committerDave Airlie <airlied@redhat.com>2010-04-20 13:12:28 +1000
commitc2b41276da65481d36311a13d69020d150861c43 (patch)
tree5a67f674b77cfdc47bd386f114fbf5a6bff740c6 /drivers/gpu/drm/ttm/ttm_memory.c
parent97921a5b03d40681b3aed620a5e719710336c6df (diff)
parent2125b8a44d771351fc44719ed291be70b73672ad (diff)
downloadblackbird-obmc-linux-c2b41276da65481d36311a13d69020d150861c43.tar.gz
blackbird-obmc-linux-c2b41276da65481d36311a13d69020d150861c43.zip
Merge branch 'drm-ttm-pool' into drm-core-next
* drm-ttm-pool: drm/ttm: using kmalloc/kfree requires including slab.h drm/ttm: include linux/seq_file.h for seq_printf drm/ttm: Add sysfs interface to control pool allocator. drm/ttm: Use set_pages_array_wc instead of set_memory_wc. arch/x86: Add array variants for setting memory to wc caching. drm/nouveau: Add ttm page pool debugfs file. drm/radeon/kms: Add ttm page pool debugfs file. drm/ttm: Add debugfs output entry to pool allocator. drm/ttm: add pool wc/uc page allocator V3
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_memory.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_memory.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c
index 801b702566e6..e70ddd82dc02 100644
--- a/drivers/gpu/drm/ttm/ttm_memory.c
+++ b/drivers/gpu/drm/ttm/ttm_memory.c
@@ -27,6 +27,7 @@
#include "ttm/ttm_memory.h"
#include "ttm/ttm_module.h"
+#include "ttm/ttm_page_alloc.h"
#include <linux/spinlock.h>
#include <linux/sched.h>
#include <linux/wait.h>
@@ -393,6 +394,7 @@ int ttm_mem_global_init(struct ttm_mem_global *glob)
"Zone %7s: Available graphics memory: %llu kiB.\n",
zone->name, (unsigned long long) zone->max_mem >> 10);
}
+ ttm_page_alloc_init(glob, glob->zone_kernel->max_mem/(2*PAGE_SIZE));
return 0;
out_no_zone:
ttm_mem_global_release(glob);
@@ -405,6 +407,9 @@ void ttm_mem_global_release(struct ttm_mem_global *glob)
unsigned int i;
struct ttm_mem_zone *zone;
+ /* let the page allocator first stop the shrink work. */
+ ttm_page_alloc_fini();
+
flush_workqueue(glob->swap_queue);
destroy_workqueue(glob->swap_queue);
glob->swap_queue = NULL;
@@ -412,7 +417,7 @@ void ttm_mem_global_release(struct ttm_mem_global *glob)
zone = glob->zones[i];
kobject_del(&zone->kobj);
kobject_put(&zone->kobj);
- }
+ }
kobject_del(&glob->kobj);
kobject_put(&glob->kobj);
}
OpenPOWER on IntegriCloud