From 65f0a792e88de58d67503dd8a12b3dfac33d4e0b Mon Sep 17 00:00:00 2001 From: Anthony Waters Date: Wed, 1 Aug 2012 10:55:03 -0400 Subject: [PATCH] Potential fix for rendering errors and va mapping errors on caymen with virtual adddress space enabled it waits until the bo is done before freeing, and frees the va after the bo is freed --- src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index 2626586..a9a3eca 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -320,12 +320,15 @@ static void radeon_bo_destroy(struct pb_buffer *_buf) os_munmap(bo->ptr, bo->base.size); if (mgr->va) { - radeon_bomgr_free_va(mgr, bo->va, bo->va_size); + radeon_bo_wait(bo, RADEON_USAGE_READWRITE); } /* Close object. */ args.handle = bo->handle; drmIoctl(bo->rws->fd, DRM_IOCTL_GEM_CLOSE, &args); + if (mgr->va) { + radeon_bomgr_free_va(mgr, bo->va, bo->va_size); + } pipe_mutex_destroy(bo->map_mutex); FREE(bo); } -- 1.7.8.6