Mesa (master): nouveau: fix maps with PIPE_TRANSFER_UNSYNCHRONIZED | PIPE_TRANSFER_DONTBLOCK

Luca Barbieri lb at kemper.freedesktop.org
Mon Aug 9 03:03:18 UTC 2010


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

Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Mon Aug  9 04:56:03 2010 +0200

nouveau: fix maps with PIPE_TRANSFER_UNSYNCHRONIZED | PIPE_TRANSFER_DONTBLOCK

In this case, we were incorrectly prioritizing PIPE_TRANSFER_DONTBLOCK over
PIPE_TRANSFER_UNSYNCHRONIZED.

This can lead to failure in the Mesa VBO draw paths that end up specifying
both, but don't expect map to fail (in particular, the problem manifested as
a leak of buffer objects in teapot with other changes).

---

 src/gallium/drivers/nouveau/nouveau_winsys.h |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h
index df79ca8..c6c93d4 100644
--- a/src/gallium/drivers/nouveau/nouveau_winsys.h
+++ b/src/gallium/drivers/nouveau/nouveau_winsys.h
@@ -24,11 +24,10 @@ nouveau_screen_transfer_flags(unsigned pipe)
 		flags |= NOUVEAU_BO_WR;
 	if (pipe & PIPE_TRANSFER_DISCARD)
 		flags |= NOUVEAU_BO_INVAL;
-	if (pipe & PIPE_TRANSFER_DONTBLOCK)
-		flags |= NOUVEAU_BO_NOWAIT;
-	else
 	if (pipe & PIPE_TRANSFER_UNSYNCHRONIZED)
 		flags |= NOUVEAU_BO_NOSYNC;
+	else if (pipe & PIPE_TRANSFER_DONTBLOCK)
+		flags |= NOUVEAU_BO_NOWAIT;
 
 	return flags;
 }




More information about the mesa-commit mailing list