aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
diff options
context:
space:
mode:
authorChunming Zhou <david1.zhou@amd.com>2018-03-29 22:23:48 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-04-03 14:08:44 -0400
commit073997ccd9dd8eb8015f5371ff0ea85a48814bb4 (patch)
treeef95f43d251aa13783aafe5d2d06c8584e50c5d1 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
parent46bce67f62e7daa00ad908c4c17e9750df2acf52 (diff)
Revert "drm/amdgpu: Don't change preferred domian when fallback GTT v5"
This reverts commit bbaf1871ea1d7b7021e350a3e8bb1ec8408c2030. Felix reports this commit causes regression. Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 28c2706e48d7..46b9ea4e6103 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -56,11 +56,23 @@ int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size,
56 alignment = PAGE_SIZE; 56 alignment = PAGE_SIZE;
57 } 57 }
58 58
59retry:
59 r = amdgpu_bo_create(adev, size, alignment, initial_domain, 60 r = amdgpu_bo_create(adev, size, alignment, initial_domain,
60 flags, type, resv, &bo); 61 flags, type, resv, &bo);
61 if (r) { 62 if (r) {
62 DRM_DEBUG("Failed to allocate GEM object (%ld, %d, %u, %d)\n", 63 if (r != -ERESTARTSYS) {
63 size, initial_domain, alignment, r); 64 if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) {
65 flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
66 goto retry;
67 }
68
69 if (initial_domain == AMDGPU_GEM_DOMAIN_VRAM) {
70 initial_domain |= AMDGPU_GEM_DOMAIN_GTT;
71 goto retry;
72 }
73 DRM_DEBUG("Failed to allocate GEM object (%ld, %d, %u, %d)\n",
74 size, initial_domain, alignment, r);
75 }
64 return r; 76 return r;
65 } 77 }
66 *obj = &bo->gem_base; 78 *obj = &bo->gem_base;