nouveau: fix maps with PIPE_TRANSFER_UNSYNCHRONIZED | PIPE_TRANSFER_DONTBLOCK
authorLuca Barbieri <luca@luca-barbieri.com>
Mon, 9 Aug 2010 02:56:03 +0000 (04:56 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Mon, 9 Aug 2010 03:02:12 +0000 (05:02 +0200)
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

index df79ca89ca1dad29fcad3f8ef2efba5bd2d9ccce..c6c93d40b8f7595398f184477c8a8d689f10d350 100644 (file)
@@ -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;
 }