radeonsi: assume has_virtual_memory == true
authorMarek Olšák <marek.olsak@amd.com>
Wed, 21 Feb 2018 22:07:05 +0000 (23:07 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Mar 2018 18:55:48 +0000 (13:55 -0500)
src/gallium/drivers/radeon/r600_buffer_common.c
src/gallium/drivers/radeon/r600_pipe_common.c

index 2106b9b3a5ef964aebc0fb4e38bf63123d6bcbe6..2b4b7bb7f4f835334d439b74f28c5addcc240c4a 100644 (file)
@@ -217,21 +217,16 @@ bool si_alloc_resource(struct si_screen *sscreen,
         * the others are using it. */
        old_buf = res->buf;
        res->buf = new_buf; /* should be atomic */
+       res->gpu_address = sscreen->ws->buffer_get_virtual_address(res->buf);
 
-       if (sscreen->info.has_virtual_memory) {
-               res->gpu_address = sscreen->ws->buffer_get_virtual_address(res->buf);
+       if (res->flags & RADEON_FLAG_32BIT) {
+               uint64_t start = res->gpu_address;
+               uint64_t last = start + res->bo_size - 1;
+               (void)start;
+               (void)last;
 
-               if (res->flags & RADEON_FLAG_32BIT) {
-                       uint64_t start = res->gpu_address;
-                       uint64_t last = start + res->bo_size - 1;
-                       (void)start;
-                       (void)last;
-
-                       assert((start >> 32) == sscreen->info.address32_hi);
-                       assert((last >> 32) == sscreen->info.address32_hi);
-               }
-       } else {
-               res->gpu_address = 0;
+               assert((start >> 32) == sscreen->info.address32_hi);
+               assert((last >> 32) == sscreen->info.address32_hi);
        }
 
        pb_reference(&old_buf, NULL);
@@ -685,12 +680,7 @@ si_buffer_from_user_memory(struct pipe_screen *screen,
                return NULL;
        }
 
-       if (sscreen->info.has_virtual_memory)
-               rbuffer->gpu_address =
-                       ws->buffer_get_virtual_address(rbuffer->buf);
-       else
-               rbuffer->gpu_address = 0;
-
+       rbuffer->gpu_address = ws->buffer_get_virtual_address(rbuffer->buf);
        rbuffer->vram_usage = 0;
        rbuffer->gart_usage = templ->width0;
 
index d46cb64651932386104540658b5bc46ae8a97e27..3496d6e8643d93b9d67f7d33b7b4090045063a48 100644 (file)
@@ -135,9 +135,6 @@ unsigned si_gfx_write_fence_dwords(struct si_screen *screen)
            screen->info.chip_class == VI)
                dwords *= 2;
 
-       if (!screen->info.has_virtual_memory)
-               dwords += 2;
-
        return dwords;
 }
 
@@ -222,18 +219,15 @@ void si_need_dma_space(struct r600_common_context *ctx, unsigned num_dw,
                                              RADEON_USAGE_WRITE)))
                r600_dma_emit_wait_idle(ctx);
 
-       /* If GPUVM is not supported, the CS checker needs 2 entries
-        * in the buffer list per packet, which has to be done manually.
-        */
-       if (ctx->screen->info.has_virtual_memory) {
-               if (dst)
-                       radeon_add_to_buffer_list(ctx, &ctx->dma, dst,
-                                                 RADEON_USAGE_WRITE,
-                                                 RADEON_PRIO_SDMA_BUFFER);
-               if (src)
-                       radeon_add_to_buffer_list(ctx, &ctx->dma, src,
-                                                 RADEON_USAGE_READ,
-                                                 RADEON_PRIO_SDMA_BUFFER);
+       if (dst) {
+               radeon_add_to_buffer_list(ctx, &ctx->dma, dst,
+                                         RADEON_USAGE_WRITE,
+                                         RADEON_PRIO_SDMA_BUFFER);
+       }
+       if (src) {
+               radeon_add_to_buffer_list(ctx, &ctx->dma, src,
+                                         RADEON_USAGE_READ,
+                                         RADEON_PRIO_SDMA_BUFFER);
        }
 
        /* this function is called before all DMA calls, so increment this. */