Revert "radeon: just don't map VRAM buffers at all"
authorLeo Liu <leo.liu@amd.com>
Wed, 2 Apr 2014 13:09:32 +0000 (09:09 -0400)
committerChristian König <christian.koenig@amd.com>
Fri, 4 Apr 2014 14:21:04 +0000 (16:21 +0200)
This reverts commit 96e8b916a7a39a9ba58e92d1ad77b5501de63ac7.
In the case of VCE encoding with raw YUV file, CPU load directly
to VRAM is faster than combination of CPU writing to GTT and
then blit to VRAM with GPU.

Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/radeon/r600_texture.c

index 45a950885349dfaea9be337f762e083570101ef8..3dfddca8b1cecc70628a1a8066dd738e730369c8 100644 (file)
@@ -928,8 +928,8 @@ static void *r600_texture_transfer_map(struct pipe_context *ctx,
        if (rtex->surface.level[level].mode >= RADEON_SURF_MODE_1D)
                use_staging_texture = TRUE;
 
-       /* Untiled buffers in VRAM, which is slow for CPU reads and writes */
-       if (!(usage & PIPE_TRANSFER_MAP_DIRECTLY) &&
+       /* Untiled buffers in VRAM, which is slow for CPU reads */
+       if ((usage & PIPE_TRANSFER_READ) && !(usage & PIPE_TRANSFER_MAP_DIRECTLY) &&
            (rtex->resource.domains == RADEON_DOMAIN_VRAM)) {
                use_staging_texture = TRUE;
        }