diff options
author | Christian König <christian.koenig@amd.com> | 2017-07-04 16:56:24 +0200 |
---|---|---|
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) | |
download | linux-d188bfa5532ce5b426681d8530ff1a9683eea0ad.tar.gz linux-d188bfa5532ce5b426681d8530ff1a9683eea0ad.tar.bz2 linux-d188bfa5532ce5b426681d8530ff1a9683eea0ad.zip |
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) return -ENOMEM; } - ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i]); + ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i], + PAGE_SIZE); if (unlikely(ret != 0)) { ttm_pool_unpopulate(ttm); return -ENOMEM; @@ -909,7 +910,7 @@ void ttm_pool_unpopulate(struct ttm_tt *ttm) for (i = 0; i < ttm->num_pages; ++i) { if (ttm->pages[i]) { ttm_mem_global_free_page(ttm->glob->mem_glob, - ttm->pages[i]); + ttm->pages[i], PAGE_SIZE); ttm_put_pages(&ttm->pages[i], 1, ttm->page_flags, ttm->caching_state); |