From: Michel Dänzer Date: Wed, 15 Aug 2012 13:48:34 +0000 (+0200) Subject: gallium/radeon: Create hole for waste when allocating from va_offset. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a60be05284399202c7a5a7aaf4d1f8f0626aee80;p=mesa.git 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 Reviewed-by: Alex Deucher --- diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index 79355af7995..9bddcd347c3 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -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);