gallium/radeon: handle VRAM_GTT placements as having slow CPU reads
authorMarek Olšák <marek.olsak@amd.com>
Thu, 12 May 2016 11:05:19 +0000 (13:05 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 19 May 2016 10:35:50 +0000 (12:35 +0200)
not sure if we should include GTT WC too

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_buffer_common.c
src/gallium/drivers/radeon/r600_texture.c

index 9e8384d628f13e92f0896746d55b17772dda726e..145cc9f0b9ba0be019b41c96acad83e0f4f00999 100644 (file)
@@ -359,7 +359,7 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
        else if ((usage & PIPE_TRANSFER_READ) &&
                 !(usage & (PIPE_TRANSFER_WRITE |
                            PIPE_TRANSFER_PERSISTENT)) &&
-                rbuffer->domains == RADEON_DOMAIN_VRAM &&
+                rbuffer->domains & RADEON_DOMAIN_VRAM &&
                 r600_can_dma_copy_buffer(rctx, 0, box->x, box->width)) {
                struct r600_resource *staging;
 
index b22fca892d483842a5a79712a6237f66f828d6bc..a00dedcd3ecba58ff2dcb13093665afb55006695 100644 (file)
@@ -1247,7 +1247,7 @@ static void *r600_texture_transfer_map(struct pipe_context *ctx,
        if (rtex->surface.level[0].mode >= RADEON_SURF_MODE_1D) {
                use_staging_texture = TRUE;
        } else if ((usage & PIPE_TRANSFER_READ) &&
-           (rtex->resource.domains == RADEON_DOMAIN_VRAM)) {
+                  rtex->resource.domains & RADEON_DOMAIN_VRAM) {
                /* Untiled buffers in VRAM, which is slow for CPU reads */
                use_staging_texture = TRUE;
        } else if (!(usage & PIPE_TRANSFER_READ) &&