From a60be05284399202c7a5a7aaf4d1f8f0626aee80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Wed, 15 Aug 2012 15:48:34 +0200 Subject: [PATCH] gallium/radeon: Create hole for waste when allocating from va_offset. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise, the wasted area could never be used for an allocation again. Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher --- src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.30.2