radeonsi: clear allocator_zeroed_memory with SDMA
authorMarek Olšák <marek.olsak@amd.com>
Tue, 29 Jan 2019 00:49:56 +0000 (19:49 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 6 Feb 2019 16:17:21 +0000 (11:17 -0500)
so that it can be used in parallel IBs.

This also removes the SO_FILLED_SIZE hack.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_buffer.c
src/gallium/drivers/radeonsi/si_compute_blit.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_pipe.h

index 03c11cb70133fc34ae2ea1a5112a7a6ce6d6c16e..bac561de2cb550b439a3efbc451200fdb7534370 100644 (file)
@@ -242,6 +242,10 @@ bool si_alloc_resource(struct si_screen *sscreen,
                        res->gpu_address, res->gpu_address + res->buf->size,
                        res->buf->size);
        }
+
+       if (res->b.b.flags & SI_RESOURCE_FLAG_CLEAR)
+               si_screen_clear_buffer(sscreen, &res->b.b, 0, res->bo_size, 0);
+
        return true;
 }
 
index 1ea0d7517dfd357ae4e954acbe09467322c5de83..f5e9c02dd1086247310aade84087f71839f8288f 100644 (file)
@@ -275,15 +275,8 @@ static void si_pipe_clear_buffer(struct pipe_context *ctx,
                                 const void *clear_value,
                                 int clear_value_size)
 {
-       enum si_coherency coher;
-
-       if (dst->flags & SI_RESOURCE_FLAG_SO_FILLED_SIZE)
-               coher = SI_COHERENCY_CP;
-       else
-               coher = SI_COHERENCY_SHADER;
-
        si_clear_buffer((struct si_context*)ctx, dst, offset, size, (uint32_t*)clear_value,
-                       clear_value_size, coher);
+                       clear_value_size, SI_COHERENCY_SHADER);
 }
 
 void si_copy_buffer(struct si_context *sctx,
index 439b550c4cfb1eb40fed0de087bc20d4e13b4fac..98059ddbf8b44bcbcae68da1c4cecaa6d6beccb9 100644 (file)
@@ -430,9 +430,9 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
        }
 
        sctx->allocator_zeroed_memory =
-                       u_suballocator_create(&sctx->b, sscreen->info.gart_page_size,
-                                             0, PIPE_USAGE_DEFAULT,
-                                             SI_RESOURCE_FLAG_SO_FILLED_SIZE, true);
+               u_suballocator_create(&sctx->b, sscreen->info.gart_page_size,
+                                     0, PIPE_USAGE_DEFAULT,
+                                     SI_RESOURCE_FLAG_CLEAR, false);
        if (!sctx->allocator_zeroed_memory)
                goto fail;
 
index 1af3c5ff9b7ea80692deaf36aa0cd2622141feed..b01d57447526056f2c26df47cfea9ebd3959d6ed 100644 (file)
 #define SI_RESOURCE_FLAG_UNMAPPABLE    (PIPE_RESOURCE_FLAG_DRV_PRIV << 4)
 #define SI_RESOURCE_FLAG_READ_ONLY     (PIPE_RESOURCE_FLAG_DRV_PRIV << 5)
 #define SI_RESOURCE_FLAG_32BIT         (PIPE_RESOURCE_FLAG_DRV_PRIV << 6)
-#define SI_RESOURCE_FLAG_SO_FILLED_SIZE        (PIPE_RESOURCE_FLAG_DRV_PRIV << 7)
+#define SI_RESOURCE_FLAG_CLEAR         (PIPE_RESOURCE_FLAG_DRV_PRIV << 7)
 
 enum si_clear_code
 {