From 2d1c9d5f936d30781eb63f50f27ffab1107b9182 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 22 Jun 2011 12:58:46 -0400 Subject: [PATCH] r600g: fall back to gtt if vram alloc fails Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=38353 Signed-off-by: Alex Deucher --- src/gallium/winsys/r600/drm/r600_bo.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/src/gallium/winsys/r600/drm/r600_bo.c b/src/gallium/winsys/r600/drm/r600_bo.c index 4098a6e..5b862b4 100644 --- a/src/gallium/winsys/r600/drm/r600_bo.c +++ b/src/gallium/winsys/r600/drm/r600_bo.c @@ -74,7 +74,14 @@ struct r600_bo *r600_bo(struct radeon *radeon, } rbo = radeon_bo(radeon, 0, size, alignment, initial_domain); if (rbo == NULL) { - return NULL; + /* if we fail to allocate in vram, try gtt */ + if (initial_domain == RADEON_GEM_DOMAIN_VRAM) { + initial_domain = RADEON_GEM_DOMAIN_GTT; + rbo = radeon_bo(radeon, 0, size, alignment, initial_domain); + if (rbo == NULL) + return NULL; + } else + return NULL; } bo = calloc(1, sizeof(struct r600_bo)); -- 1.7.1.1