radeonsi: remove has_cp_dma, has_streamout flags (v2)
authorMarek Olšák <marek.olsak@amd.com>
Tue, 7 Nov 2017 18:19:07 +0000 (19:19 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 14 Nov 2017 14:24:50 +0000 (15:24 +0100)
v2: remove r600_can_dma_copy_buffer

src/gallium/drivers/radeon/r600_buffer_common.c
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeonsi/si_pipe.c

index f0cfd0979a26ea5782468e2e161386f47b015326..770f4e980fd77b8d220978e3caa2bbffbf21dcaa 100644 (file)
@@ -349,17 +349,6 @@ static void *r600_buffer_get_transfer(struct pipe_context *ctx,
        return data;
 }
 
-static bool r600_can_dma_copy_buffer(struct r600_common_context *rctx,
-                                    unsigned dstx, unsigned srcx, unsigned size)
-{
-       bool dword_aligned = !(dstx % 4) && !(srcx % 4) && !(size % 4);
-
-       return rctx->screen->has_cp_dma ||
-              (dword_aligned && (rctx->dma.cs ||
-                                 rctx->screen->has_streamout));
-
-}
-
 static void *r600_buffer_transfer_map(struct pipe_context *ctx,
                                       struct pipe_resource *resource,
                                       unsigned level,
@@ -436,8 +425,7 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
 
        if ((usage & PIPE_TRANSFER_DISCARD_RANGE) &&
            ((!(usage & (PIPE_TRANSFER_UNSYNCHRONIZED |
-                        PIPE_TRANSFER_PERSISTENT)) &&
-             r600_can_dma_copy_buffer(rctx, box->x, 0, box->width)) ||
+                        PIPE_TRANSFER_PERSISTENT))) ||
             (rbuffer->flags & RADEON_FLAG_SPARSE))) {
                assert(usage & PIPE_TRANSFER_WRITE);
 
@@ -473,8 +461,7 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
        else if (((usage & PIPE_TRANSFER_READ) &&
                  !(usage & PIPE_TRANSFER_PERSISTENT) &&
                  (rbuffer->domains & RADEON_DOMAIN_VRAM ||
-                  rbuffer->flags & RADEON_FLAG_GTT_WC) &&
-                 r600_can_dma_copy_buffer(rctx, 0, box->x, box->width)) ||
+                  rbuffer->flags & RADEON_FLAG_GTT_WC)) ||
                 (rbuffer->flags & RADEON_FLAG_SPARSE)) {
                struct r600_resource *staging;
 
index 1219a86d96cb3a5e196df12b487db4ea425c7c2d..adfcc7c8a70a20715966fbe48d3b1750f4f59d95 100644 (file)
@@ -391,8 +391,6 @@ struct r600_common_screen {
        enum chip_class                 chip_class;
        struct radeon_info              info;
        uint64_t                        debug_flags;
-       bool                            has_cp_dma;
-       bool                            has_streamout;
        bool                            has_rbplus;     /* if RB+ registers exist */
        bool                            rbplus_allowed; /* if RB+ is allowed */
 
index 6c4420c1baf5593699a44857986ea6c1987c228d..b3d8ae508bd59aa0d8827b20ff4a60fb9ff90d32 100644 (file)
@@ -1114,9 +1114,6 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
         */
        sscreen->llvm_has_working_vgpr_indexing = sscreen->b.chip_class <= VI;
 
-       sscreen->b.has_cp_dma = true;
-       sscreen->b.has_streamout = true;
-
        /* Some chips have RB+ registers, but don't support RB+. Those must
         * always disable it.
         */