radeonsi: also wait for SDMA in the clear_buffer CPU fallback
authorMarek Olšák <marek.olsak@amd.com>
Thu, 29 Dec 2016 18:00:43 +0000 (19:00 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 5 Jan 2017 17:43:23 +0000 (18:43 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_cp_dma.c

index b25598cde6bd169f112ee951f68feaacd4719e19..722ac4d2c23b590b628136e8aa573649ba6b3ea4 100644 (file)
@@ -184,9 +184,8 @@ static void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst,
 
        /* Fallback for unaligned clears. */
        if (offset % 4 != 0 || size % 4 != 0) {
-               uint8_t *map = sctx->b.ws->buffer_map(r600_resource(dst)->buf,
-                                                     sctx->b.gfx.cs,
-                                                     PIPE_TRANSFER_WRITE);
+               uint8_t *map = r600_buffer_map_sync_with_rings(&sctx->b, rdst,
+                                                              PIPE_TRANSFER_WRITE);
                map += offset;
                for (uint64_t i = 0; i < size; i++) {
                        unsigned byte_within_dword = (offset + i) % 4;