diff options
author | Junwei Zhang <Jerry.Zhang@amd.com> | 2018-06-25 01:32:24 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-07-10 15:15:58 -0400 |
commit | bb812f1ea87dd7a4f336242212219268393ed308 (patch) | |
tree | 2bc46b9bf43e7dd0882c867912e15e2d75cad4f8 /drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | |
parent | 7b7c6c81b3a370b46b0c48f4ab7ac3be83237a12 (diff) |
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 <Jerry.Zhang@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_display.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index a80407cf099b..6748cd7fc129 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | |||
@@ -194,6 +194,12 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, | |||
194 | goto unreserve; | 194 | goto unreserve; |
195 | } | 195 | } |
196 | 196 | ||
197 | r = amdgpu_ttm_alloc_gart(&new_abo->tbo); | ||
198 | if (unlikely(r != 0)) { | ||
199 | DRM_ERROR("%p bind failed\n", new_abo); | ||
200 | goto unpin; | ||
201 | } | ||
202 | |||
197 | r = reservation_object_get_fences_rcu(new_abo->tbo.resv, &work->excl, | 203 | r = reservation_object_get_fences_rcu(new_abo->tbo.resv, &work->excl, |
198 | &work->shared_count, | 204 | &work->shared_count, |
199 | &work->shared); | 205 | &work->shared); |