Mesa (master): r600g: Fixed unmap condition in radeon_bo_pb_destroy().

Tilman Sauerbeck tilman at kemper.freedesktop.org
Tue Nov 2 21:09:13 UTC 2010


Module: Mesa
Branch: master
Commit: 34e75b0ca80011023c416831283fcce716b980b2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=34e75b0ca80011023c416831283fcce716b980b2

Author: Tilman Sauerbeck <tilman at code-monkey.de>
Date:   Fri Oct 29 21:34:26 2010 +0200

r600g: Fixed unmap condition in radeon_bo_pb_destroy().

Signed-off-by: Tilman Sauerbeck <tilman at code-monkey.de>

---

 src/gallium/winsys/r600/drm/radeon_bo_pb.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gallium/winsys/r600/drm/radeon_bo_pb.c b/src/gallium/winsys/r600/drm/radeon_bo_pb.c
index f74b934..312552f 100644
--- a/src/gallium/winsys/r600/drm/radeon_bo_pb.c
+++ b/src/gallium/winsys/r600/drm/radeon_bo_pb.c
@@ -63,11 +63,13 @@ static void radeon_bo_pb_destroy(struct pb_buffer *_buf)
 {
 	struct radeon_bo_pb *buf = radeon_bo_pb(_buf);
 
-	LIST_DEL(&buf->maplist);
-
-	if (buf->bo->data != NULL) {
+	/* If this buffer is on the list of buffers to unmap,
+	 * do the unmapping now.
+	 */
+	if (!LIST_IS_EMPTY(&buf->maplist))
 		radeon_bo_unmap(buf->mgr->radeon, buf->bo);
-	}
+
+	LIST_DEL(&buf->maplist);
 	radeon_bo_reference(buf->mgr->radeon, &buf->bo, NULL);
 	FREE(buf);
 }




More information about the mesa-commit mailing list