diff options
author | Christian König <christian.koenig@amd.com> | 2017-07-04 10:56:24 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-10-06 17:44:16 -0400 |
commit | d188bfa5532ce5b426681d8530ff1a9683eea0ad (patch) | |
tree | e08c1118cde71094a9f014870e08f0889bf2f615 /drivers/gpu/drm/ttm/ttm_page_alloc.c | |
parent | f9ebec52b5f115a0b06cdabe3036b858bfbb588a (diff) |
drm/ttm: add support for different pool sizes
Correctly handle different page sizes in the memory accounting.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_page_alloc.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_page_alloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 74f465ea914b..e11fd76e06f4 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c | |||
@@ -882,7 +882,8 @@ int ttm_pool_populate(struct ttm_tt *ttm) | |||
882 | return -ENOMEM; | 882 | return -ENOMEM; |
883 | } | 883 | } |
884 | 884 | ||
885 | ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i]); | 885 | ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i], |
886 | PAGE_SIZE); | ||
886 | if (unlikely(ret != 0)) { | 887 | if (unlikely(ret != 0)) { |
887 | ttm_pool_unpopulate(ttm); | 888 | ttm_pool_unpopulate(ttm); |
888 | return -ENOMEM; | 889 | return -ENOMEM; |
@@ -909,7 +910,7 @@ void ttm_pool_unpopulate(struct ttm_tt *ttm) | |||
909 | for (i = 0; i < ttm->num_pages; ++i) { | 910 | for (i = 0; i < ttm->num_pages; ++i) { |
910 | if (ttm->pages[i]) { | 911 | if (ttm->pages[i]) { |
911 | ttm_mem_global_free_page(ttm->glob->mem_glob, | 912 | ttm_mem_global_free_page(ttm->glob->mem_glob, |
912 | ttm->pages[i]); | 913 | ttm->pages[i], PAGE_SIZE); |
913 | ttm_put_pages(&ttm->pages[i], 1, | 914 | ttm_put_pages(&ttm->pages[i], 1, |
914 | ttm->page_flags, | 915 | ttm->page_flags, |
915 | ttm->caching_state); | 916 | ttm->caching_state); |