summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-02-22 17:13:51 +0100
committerMarek Olšák <[email protected]>2018-03-07 13:55:47 -0500
commit53db2790c06faa9dd58465b79065f97bc8e0cb62 (patch)
treea1cb9311782d62dc0fa519a1296e18a62a7d4124 /src/gallium/drivers/radeon
parent16856a1ee86f364212674dddf154caa374310a6b (diff)
radeonsi: add/update assertions for 32-bit address space
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r--src/gallium/drivers/radeon/r600_buffer_common.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
index 2d64eed1c10..2106b9b3a5e 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -218,10 +218,21 @@ bool si_alloc_resource(struct si_screen *sscreen,
old_buf = res->buf;
res->buf = new_buf; /* should be atomic */
- if (sscreen->info.has_virtual_memory)
+ if (sscreen->info.has_virtual_memory) {
res->gpu_address = sscreen->ws->buffer_get_virtual_address(res->buf);
- else
+
+ 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;
+ }
pb_reference(&old_buf, NULL);