aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_buffer_common.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2014-06-19 10:40:38 +0900
committerMichel Dänzer <[email protected]>2014-07-23 18:55:50 +0900
commit07c65b85eada8dd34019763b6e82ed4257a9b4a6 (patch)
tree0191488e5ee96747cb6e8199d3c31c23f9046803 /src/gallium/drivers/radeon/r600_buffer_common.c
parent37d43ebb28ce8be38f3d9b0805b8b14354ce786d (diff)
r600g/radeonsi: Use write-combined CPU mappings of some BOs in GTT
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_buffer_common.c')
-rw-r--r--src/gallium/drivers/radeon/r600_buffer_common.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
index 0eaa817aee8..4e6b8978efb 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -107,11 +107,14 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
{
struct r600_texture *rtex = (struct r600_texture*)res;
struct pb_buffer *old_buf, *new_buf;
+ enum radeon_bo_flag flags = 0;
switch (res->b.b.usage) {
- case PIPE_USAGE_STAGING:
case PIPE_USAGE_DYNAMIC:
case PIPE_USAGE_STREAM:
+ flags = RADEON_FLAG_GTT_WC;
+ /* fall through */
+ case PIPE_USAGE_STAGING:
/* Transfers are likely to occur more often with these resources. */
res->domains = RADEON_DOMAIN_GTT;
break;
@@ -120,6 +123,7 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
default:
/* Not listing GTT here improves performance in some apps. */
res->domains = RADEON_DOMAIN_VRAM;
+ flags = RADEON_FLAG_GTT_WC;
break;
}
@@ -129,6 +133,7 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
res->b.b.flags & (PIPE_RESOURCE_FLAG_MAP_PERSISTENT |
PIPE_RESOURCE_FLAG_MAP_COHERENT)) {
res->domains = RADEON_DOMAIN_GTT;
+ flags = 0;
}
/* Tiled textures are unmappable. Always put them in VRAM. */
@@ -140,7 +145,7 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
/* Allocate a new resource. */
new_buf = rscreen->ws->buffer_create(rscreen->ws, size, alignment,
use_reusable_pool,
- res->domains);
+ res->domains, flags);
if (!new_buf) {
return false;
}