summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_gem.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-10-23 15:53:19 +0200
committerAlex Deucher <alexander.deucher@amd.com>2012-10-24 11:41:56 -0400
commit0fe7158c8a61ffdd71789de054fbee257c34d054 (patch)
tree9c8c93dc152b668131916dfa21e5e19f76b6e2e6 /drivers/gpu/drm/radeon/radeon_gem.c
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/radeon/radeon_gem.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_gem.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index dfee7bb03ab0..fe5c1f6b7957 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,
return -ENOMEM;
}
+retry:
r = radeon_bo_create(rdev, size, alignment, kernel, initial_domain, NULL, &robj);
if (r) {
- if (r != -ERESTARTSYS)
+ if (r != -ERESTARTSYS) {
+ if (initial_domain == RADEON_GEM_DOMAIN_VRAM) {
+ initial_domain |= RADEON_GEM_DOMAIN_GTT;
+ goto retry;
+ }
DRM_ERROR("Failed to allocate GEM object (%d, %d, %u, %d)\n",
size, initial_domain, alignment, r);
+ }
return r;
}
*obj = &robj->gem_base;