* 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);
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;
screen->info.chip_class == VI)
dwords *= 2;
- if (!screen->info.has_virtual_memory)
- dwords += 2;
-
return dwords;
}
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. */