diff options
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_memory.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_memory.c | 7 |
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 @@ | |||
27 | 27 | ||
28 | #include "ttm/ttm_memory.h" | 28 | #include "ttm/ttm_memory.h" |
29 | #include "ttm/ttm_module.h" | 29 | #include "ttm/ttm_module.h" |
30 | #include "ttm/ttm_page_alloc.h" | ||
30 | #include <linux/spinlock.h> | 31 | #include <linux/spinlock.h> |
31 | #include <linux/sched.h> | 32 | #include <linux/sched.h> |
32 | #include <linux/wait.h> | 33 | #include <linux/wait.h> |
@@ -393,6 +394,7 @@ int ttm_mem_global_init(struct ttm_mem_global *glob) | |||
393 | "Zone %7s: Available graphics memory: %llu kiB.\n", | 394 | "Zone %7s: Available graphics memory: %llu kiB.\n", |
394 | zone->name, (unsigned long long) zone->max_mem >> 10); | 395 | zone->name, (unsigned long long) zone->max_mem >> 10); |
395 | } | 396 | } |
397 | ttm_page_alloc_init(glob, glob->zone_kernel->max_mem/(2*PAGE_SIZE)); | ||
396 | return 0; | 398 | return 0; |
397 | out_no_zone: | 399 | out_no_zone: |
398 | ttm_mem_global_release(glob); | 400 | ttm_mem_global_release(glob); |
@@ -405,6 +407,9 @@ void ttm_mem_global_release(struct ttm_mem_global *glob) | |||
405 | unsigned int i; | 407 | unsigned int i; |
406 | struct ttm_mem_zone *zone; | 408 | struct ttm_mem_zone *zone; |
407 | 409 | ||
410 | /* let the page allocator first stop the shrink work. */ | ||
411 | ttm_page_alloc_fini(); | ||
412 | |||
408 | flush_workqueue(glob->swap_queue); | 413 | flush_workqueue(glob->swap_queue); |
409 | destroy_workqueue(glob->swap_queue); | 414 | destroy_workqueue(glob->swap_queue); |
410 | glob->swap_queue = NULL; | 415 | glob->swap_queue = NULL; |
@@ -412,7 +417,7 @@ void ttm_mem_global_release(struct ttm_mem_global *glob) | |||
412 | zone = glob->zones[i]; | 417 | zone = glob->zones[i]; |
413 | kobject_del(&zone->kobj); | 418 | kobject_del(&zone->kobj); |
414 | kobject_put(&zone->kobj); | 419 | kobject_put(&zone->kobj); |
415 | } | 420 | } |
416 | kobject_del(&glob->kobj); | 421 | kobject_del(&glob->kobj); |
417 | kobject_put(&glob->kobj); | 422 | kobject_put(&glob->kobj); |
418 | } | 423 | } |