r600g: Fixed unmap condition in radeon_bo_pb_destroy().
authorTilman Sauerbeck <tilman@code-monkey.de>
Fri, 29 Oct 2010 19:34:26 +0000 (21:34 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Tue, 2 Nov 2010 20:52:38 +0000 (21:52 +0100)
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
src/gallium/winsys/r600/drm/radeon_bo_pb.c

index f74b934c374d96a06b4a2b5354aba58ecfdec471..312552f07589717dedda92406043fe1dc14edef3 100644 (file)
@@ -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);
 }