diff options
author | Marek Olšák <[email protected]> | 2011-12-24 08:15:40 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-12-24 21:28:43 +0100 |
commit | 93f4e3cb6c1ca303ee1f5c2a2491a8eff33f2633 (patch) | |
tree | c6515ad448336db16756adba362412b025ce8cde /src/gallium/drivers/r300/r300_texture.c | |
parent | e6e9becd5016df649d3c19a3e81e85bd63b895b7 (diff) |
winsys/radeon: move managing GEM domains back to drivers
This partially reverts commit 363ff844753c46ac9c13866627e096b091ea81f8.
It caused severe performance drops in Nexuiz. Reported by Phoronix.
Tested by me on r300g and by IRC people on r600g.
Diffstat (limited to 'src/gallium/drivers/r300/r300_texture.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_texture.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 2738f582f69..6fc60fb60d6 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -901,6 +901,9 @@ r300_texture_create_object(struct r300_screen *rscreen, tex->tex.microtile = microtile; tex->tex.macrotile[0] = macrotile; tex->tex.stride_in_bytes_override = stride_in_bytes_override; + tex->domain = base->flags & R300_RESOURCE_FLAG_TRANSFER ? + RADEON_DOMAIN_GTT : + RADEON_DOMAIN_VRAM | RADEON_DOMAIN_GTT; tex->buf = buffer; r300_resource_set_properties(&rscreen->screen, &tex->b.b.b, base); @@ -908,7 +911,7 @@ r300_texture_create_object(struct r300_screen *rscreen, /* Create the backing buffer if needed. */ if (!tex->buf) { tex->buf = rws->buffer_create(rws, tex->tex.size_in_bytes, 2048, - base->bind, base->usage); + base->bind, tex->domain); if (!tex->buf) { FREE(tex); @@ -1019,6 +1022,11 @@ struct pipe_surface* r300_create_surface(struct pipe_context * ctx, surface->buf = tex->buf; surface->cs_buf = tex->cs_buf; + /* Prefer VRAM if there are multiple domains to choose from. */ + surface->domain = tex->domain; + if (surface->domain & RADEON_DOMAIN_VRAM) + surface->domain &= ~RADEON_DOMAIN_GTT; + surface->offset = r300_texture_get_offset(tex, level, surf_tmpl->u.tex.first_layer); r300_texture_setup_fb_state(surface); |