aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-10-23 09:53:19 -0400
committerAlex Deucher <alexander.deucher@amd.com>2012-10-24 11:41:56 -0400
commit0fe7158c8a61ffdd71789de054fbee257c34d054 (patch)
tree9c8c93dc152b668131916dfa21e5e19f76b6e2e6 /drivers/gpu/drm
parent6c0d112f1fb4abba724065daa8ffbc9f0e171dc1 (diff)
drm/radeon: move the retry to gem_object_create
When internal users want VRAM we shouldn't return GART memory instead. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/radeon/radeon_gem.c8
-rw-r--r--drivers/gpu/drm/radeon/radeon_object.c10
2 files changed, 7 insertions, 11 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index dfee7bb03ab..fe5c1f6b795 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -70,11 +70,17 @@ int radeon_gem_object_create(struct radeon_device *rdev, int size,
70 return -ENOMEM; 70 return -ENOMEM;
71 } 71 }
72 72
73retry:
73 r = radeon_bo_create(rdev, size, alignment, kernel, initial_domain, NULL, &robj); 74 r = radeon_bo_create(rdev, size, alignment, kernel, initial_domain, NULL, &robj);
74 if (r) { 75 if (r) {
75 if (r != -ERESTARTSYS) 76 if (r != -ERESTARTSYS) {
77 if (initial_domain == RADEON_GEM_DOMAIN_VRAM) {
78 initial_domain |= RADEON_GEM_DOMAIN_GTT;
79 goto retry;
80 }
76 DRM_ERROR("Failed to allocate GEM object (%d, %d, %u, %d)\n", 81 DRM_ERROR("Failed to allocate GEM object (%d, %d, %u, %d)\n",
77 size, initial_domain, alignment, r); 82 size, initial_domain, alignment, r);
83 }
78 return r; 84 return r;
79 } 85 }
80 *obj = &robj->gem_base; 86 *obj = &robj->gem_base;
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index f404944931f..b91118ccef8 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -123,7 +123,6 @@ int radeon_bo_create(struct radeon_device *rdev,
123 acc_size = ttm_bo_dma_acc_size(&rdev->mman.bdev, size, 123 acc_size = ttm_bo_dma_acc_size(&rdev->mman.bdev, size,
124 sizeof(struct radeon_bo)); 124 sizeof(struct radeon_bo));
125 125
126retry:
127 bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL); 126 bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL);
128 if (bo == NULL) 127 if (bo == NULL)
129 return -ENOMEM; 128 return -ENOMEM;
@@ -145,15 +144,6 @@ retry:
145 acc_size, sg, &radeon_ttm_bo_destroy); 144 acc_size, sg, &radeon_ttm_bo_destroy);
146 up_read(&rdev->pm.mclk_lock); 145 up_read(&rdev->pm.mclk_lock);
147 if (unlikely(r != 0)) { 146 if (unlikely(r != 0)) {
148 if (r != -ERESTARTSYS) {
149 if (domain == RADEON_GEM_DOMAIN_VRAM) {
150 domain |= RADEON_GEM_DOMAIN_GTT;
151 goto retry;
152 }
153 dev_err(rdev->dev,
154 "object_init failed for (%lu, 0x%08X)\n",
155 size, domain);
156 }
157 return r; 147 return r;
158 } 148 }
159 *bo_ptr = bo; 149 *bo_ptr = bo;