diff options
author | Mathias Fröhlich <[email protected]> | 2011-06-12 14:25:26 +0200 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2011-06-13 11:31:55 -0400 |
commit | e1f88016ec51ccf7e07fac4d77ad9077b6b9a1eb (patch) | |
tree | 9466f25503b5a8b6d80ac1a3f2aaa98ca96b76b1 /src/gallium/winsys/r600/drm | |
parent | e2529442e6cc208a4f62ff7dc00d5e2ba7c92624 (diff) |
r600g: Set the domains value also for recycled buffer objects.
Diffstat (limited to 'src/gallium/winsys/r600/drm')
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_bo.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_bo.c b/src/gallium/winsys/r600/drm/r600_bo.c index 8bb216dc7a8..093660f8d01 100644 --- a/src/gallium/winsys/r600/drm/r600_bo.c +++ b/src/gallium/winsys/r600/drm/r600_bo.c @@ -38,11 +38,23 @@ struct r600_bo *r600_bo(struct radeon *radeon, { struct r600_bo *bo; struct radeon_bo *rbo; - uint32_t initial_domain; + uint32_t initial_domain, domains; + /* Staging resources particpate in transfers and blits only + * and are used for uploads and downloads from regular + * resources. We generate them internally for some transfers. + */ + if (usage == PIPE_USAGE_STAGING) + domains = RADEON_GEM_DOMAIN_CPU | RADEON_GEM_DOMAIN_GTT; + else + domains = (RADEON_GEM_DOMAIN_CPU | + RADEON_GEM_DOMAIN_GTT | + RADEON_GEM_DOMAIN_VRAM); + if (binding & (PIPE_BIND_CONSTANT_BUFFER | PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER)) { bo = r600_bomgr_bo_create(radeon->bomgr, size, alignment, *radeon->cfence); if (bo) { + bo->domains = domains; return bo; } } @@ -72,22 +84,12 @@ struct r600_bo *r600_bo(struct radeon *radeon, bo = calloc(1, sizeof(struct r600_bo)); bo->size = size; bo->alignment = alignment; + bo->domains = domains; bo->bo = rbo; if (binding & (PIPE_BIND_CONSTANT_BUFFER | PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER)) { r600_bomgr_bo_init(radeon->bomgr, bo); } - /* Staging resources particpate in transfers and blits only - * and are used for uploads and downloads from regular - * resources. We generate them internally for some transfers. - */ - if (usage == PIPE_USAGE_STAGING) - bo->domains = RADEON_GEM_DOMAIN_CPU | RADEON_GEM_DOMAIN_GTT; - else - bo->domains = (RADEON_GEM_DOMAIN_CPU | - RADEON_GEM_DOMAIN_GTT | - RADEON_GEM_DOMAIN_VRAM); - pipe_reference_init(&bo->reference, 1); return bo; } |