nvk/heap: Use nvk_heap_bo::addr instead of bo->offset
Fixes: e162c2e78e ("nvk: Use VM_BIND for contiguous heaps instead of copying")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27565>
This commit is contained in:
committed by
Marge Bot
parent
83521dd486
commit
728256e994
@@ -160,7 +160,7 @@ nvk_heap_alloc_locked(struct nvk_device *dev, struct nvk_heap *heap,
|
||||
assert(bo_idx == 0);
|
||||
*addr_out = bo_offset;
|
||||
} else {
|
||||
*addr_out = heap->bos[bo_idx].bo->offset + bo_offset;
|
||||
*addr_out = heap->bos[bo_idx].addr + bo_offset;
|
||||
}
|
||||
if (map_out != NULL) {
|
||||
assert(heap->bos[bo_idx].map != NULL);
|
||||
@@ -183,10 +183,10 @@ nvk_heap_free_locked(struct nvk_device *dev, struct nvk_heap *heap,
|
||||
assert(addr + size > addr);
|
||||
|
||||
for (uint32_t bo_idx = 0; bo_idx < heap->bo_count; bo_idx++) {
|
||||
if (addr < heap->bos[bo_idx].bo->offset)
|
||||
if (addr < heap->bos[bo_idx].addr)
|
||||
continue;
|
||||
|
||||
uint64_t bo_offset = addr - heap->bos[bo_idx].bo->offset;
|
||||
uint64_t bo_offset = addr - heap->bos[bo_idx].addr;
|
||||
if (bo_offset >= heap->bos[bo_idx].bo->size)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user