Commit e89d0d33 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: stop allocating a page array for prime shared BOs

We don't need the page array for prime shared BOs, stop allocating it.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarRoger He <Hongbo.He@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 75a57669
...@@ -315,7 +315,7 @@ int amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset, ...@@ -315,7 +315,7 @@ int amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset,
t = offset / AMDGPU_GPU_PAGE_SIZE; t = offset / AMDGPU_GPU_PAGE_SIZE;
p = t / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); p = t / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE);
for (i = 0; i < pages; i++, p++) for (i = 0; i < pages; i++, p++)
adev->gart.pages[p] = pagelist[i]; adev->gart.pages[p] = pagelist ? pagelist[i] : NULL;
#endif #endif
if (!adev->gart.ptr) if (!adev->gart.ptr)
......
...@@ -995,7 +995,7 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -995,7 +995,7 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev,
return NULL; return NULL;
} }
gtt->ttm.ttm.func = &amdgpu_backend_func; gtt->ttm.ttm.func = &amdgpu_backend_func;
if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags)) { if (ttm_sg_tt_init(&gtt->ttm, bdev, size, page_flags)) {
kfree(gtt); kfree(gtt);
return NULL; return NULL;
} }
...@@ -1021,7 +1021,8 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm, ...@@ -1021,7 +1021,8 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm,
if (slave && ttm->sg) { if (slave && ttm->sg) {
drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages, drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
gtt->ttm.dma_address, ttm->num_pages); gtt->ttm.dma_address,
ttm->num_pages);
ttm->state = tt_unbound; ttm->state = tt_unbound;
return 0; return 0;
} }
......
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