diff options
| author | Junwei Zhang <[email protected]> | 2018-06-25 05:32:24 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2018-07-10 19:15:58 +0000 |
| commit | bb812f1ea87dd7a4f336242212219268393ed308 (patch) | |
| tree | 2bc46b9bf43e7dd0882c867912e15e2d75cad4f8 /drivers/gpu/drm/amd/amdgpu/amdgpu_test.c | |
| parent | drm/amdgpu: separate gpu address from bo pin (diff) | |
| download | kernel-bb812f1ea87dd7a4f336242212219268393ed308.tar.gz kernel-bb812f1ea87dd7a4f336242212219268393ed308.zip | |
drm/amdgpu: allocate gart memory when it's required (v3)
Instead of calling gart address space on every bo pin,
allocates it on demand
v2: fix error handling
v3: drop the change on amdgpu_amdkfd_gpuvm.c, not needed.
Signed-off-by: Junwei Zhang <[email protected]>
Acked-by: Felix Kuehling <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_test.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_test.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c index 007d70cd69dd..8904e62dca7a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_test.c @@ -103,6 +103,11 @@ static void amdgpu_do_test_moves(struct amdgpu_device *adev) DRM_ERROR("Failed to pin GTT object %d\n", i); goto out_lclean_unres; } + r = amdgpu_ttm_alloc_gart(>t_obj[i]->tbo); + if (r) { + DRM_ERROR("%p bind failed\n", gtt_obj[i]); + goto out_lclean_unpin; + } gart_addr = amdgpu_bo_gpu_offset(gtt_obj[i]); r = amdgpu_bo_kmap(gtt_obj[i], >t_map); |
