gallium/radeon: Create hole for waste when allocating from va_offset.

Otherwise, the wasted area could never be used for an allocation again.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Michel Dänzer
2012-08-15 15:48:34 +02:00
committed by Michel Dänzer
parent 1f455ef5bc
commit a60be05284
@@ -246,6 +246,12 @@ static uint64_t radeon_bomgr_find_va(struct radeon_bomgr *mgr, uint64_t size, ui
waste = offset % alignment;
waste = waste ? alignment - waste : 0;
}
if (waste) {
n = CALLOC_STRUCT(radeon_bo_va_hole);
n->size = waste;
n->offset = offset;
list_add(&n->list, &mgr->va_holes);
}
offset += waste;
mgr->va_offset += size + waste;
pipe_mutex_unlock(mgr->bo_va_mutex);