Mesa (nvc0): nvc0: fix resource unmap after vertex push

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Tue Jan 4 15:19:45 UTC 2011


Module: Mesa
Branch: nvc0
Commit: c024c1d75fdce72fe2de2d6b987b796fc9561115
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c024c1d75fdce72fe2de2d6b987b796fc9561115

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Sun Jan  2 22:39:50 2011 +0100

nvc0: fix resource unmap after vertex push

---

 src/gallium/drivers/nvc0/nvc0_push.c     |   11 +++--------
 src/gallium/drivers/nvc0/nvc0_push2.c    |    4 ++++
 src/gallium/drivers/nvc0/nvc0_resource.h |    3 +--
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/nvc0/nvc0_push.c b/src/gallium/drivers/nvc0/nvc0_push.c
index 779a477..ccbb776 100644
--- a/src/gallium/drivers/nvc0/nvc0_push.c
+++ b/src/gallium/drivers/nvc0/nvc0_push.c
@@ -201,7 +201,6 @@ void
 nvc0_push_vbo(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
 {
    struct push_context ctx;
-   struct pipe_transfer *transfer = NULL;
    unsigned i, index_size;
    unsigned inst = info->instance_count;
 
@@ -267,12 +266,8 @@ nvc0_push_vbo(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
    }
 
    if (info->indexed)
-	   pipe_buffer_unmap(&nvc0->pipe, transfer);
+      nvc0_resource_unmap(nvc0_resource(nvc0->idxbuf.buffer));
 
-   for (i = 0; i < nvc0->num_vtxbufs; ++i) {
-      struct nvc0_resource *res = nvc0_resource(nvc0->vtxbuf[i].buffer);
-
-      if (res->bo)
-         nouveau_bo_unmap(res->bo);
-   }
+   for (i = 0; i < nvc0->num_vtxbufs; ++i)
+      nvc0_resource_unmap(nvc0_resource(nvc0->vtxbuf[i].buffer));
 }
diff --git a/src/gallium/drivers/nvc0/nvc0_push2.c b/src/gallium/drivers/nvc0/nvc0_push2.c
index 1f4ba25..6f51600 100644
--- a/src/gallium/drivers/nvc0/nvc0_push2.c
+++ b/src/gallium/drivers/nvc0/nvc0_push2.c
@@ -1,4 +1,6 @@
 
+#if 0 /* not used, kept for now to compare with util/translate */
+
 #include "pipe/p_context.h"
 #include "pipe/p_state.h"
 #include "util/u_inlines.h"
@@ -327,3 +329,5 @@ nvc0_push_vbo2(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
       prim |= NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT;
    }
 }
+
+#endif
diff --git a/src/gallium/drivers/nvc0/nvc0_resource.h b/src/gallium/drivers/nvc0/nvc0_resource.h
index 0ffb9e8..d33e2f0 100644
--- a/src/gallium/drivers/nvc0/nvc0_resource.h
+++ b/src/gallium/drivers/nvc0/nvc0_resource.h
@@ -102,8 +102,7 @@ nvc0_resource_map_offset(struct nvc0_context *nvc0,
 static INLINE void
 nvc0_resource_unmap(struct nvc0_resource *res)
 {
-   if (res->domain != 0 && 0)
-      nouveau_bo_unmap(res->bo);
+   /* no-op */
 }
 
 #define NVC0_TILE_DIM_SHIFT(m, d) (((m) >> (d * 4)) & 0xf)




More information about the mesa-commit mailing list