diff options
author | Christian König <christian.koenig@amd.com> | 2018-02-23 10:08:51 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-03-14 15:38:24 -0400 |
commit | e89d0d332b7554f149648d293c2b6c77b79be529 (patch) | |
tree | cff9854138b6f538e3365bfbb450cb9d7df2b2ec /drivers/gpu | |
parent | 75a57669cbc881032c60615a31bfc6bfab4c813c (diff) |
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: Christian König <christian.koenig@amd.com>
Reviewed-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c index 137145dd14a9..dc8d9f3216fa 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | |||
@@ -315,7 +315,7 @@ int amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset, | |||
315 | t = offset / AMDGPU_GPU_PAGE_SIZE; | 315 | t = offset / AMDGPU_GPU_PAGE_SIZE; |
316 | p = t / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); | 316 | p = t / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE); |
317 | for (i = 0; i < pages; i++, p++) | 317 | for (i = 0; i < pages; i++, p++) |
318 | adev->gart.pages[p] = pagelist[i]; | 318 | adev->gart.pages[p] = pagelist ? pagelist[i] : NULL; |
319 | #endif | 319 | #endif |
320 | 320 | ||
321 | if (!adev->gart.ptr) | 321 | if (!adev->gart.ptr) |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index c2fae04d769a..7187457b20fb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
@@ -995,7 +995,7 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev, | |||
995 | return NULL; | 995 | return NULL; |
996 | } | 996 | } |
997 | gtt->ttm.ttm.func = &amdgpu_backend_func; | 997 | gtt->ttm.ttm.func = &amdgpu_backend_func; |
998 | if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags)) { | 998 | if (ttm_sg_tt_init(>t->ttm, bdev, size, page_flags)) { |
999 | kfree(gtt); | 999 | kfree(gtt); |
1000 | return NULL; | 1000 | return NULL; |
1001 | } | 1001 | } |
@@ -1021,7 +1021,8 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm, | |||
1021 | 1021 | ||
1022 | if (slave && ttm->sg) { | 1022 | if (slave && ttm->sg) { |
1023 | drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages, | 1023 | drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages, |
1024 | gtt->ttm.dma_address, ttm->num_pages); | 1024 | gtt->ttm.dma_address, |
1025 | ttm->num_pages); | ||
1025 | ttm->state = tt_unbound; | 1026 | ttm->state = tt_unbound; |
1026 | return 0; | 1027 | return 0; |
1027 | } | 1028 | } |