Mesa (gallium-0.2): nv50: remove previous hack to manage tiled surfaces

Ben Skeggs darktama at kemper.freedesktop.org
Mon Jan 12 07:00:06 UTC 2009


Module: Mesa
Branch: gallium-0.2
Commit: f935f352873a69767415210c5dace47d240de0b0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f935f352873a69767415210c5dace47d240de0b0

Author: Ben Skeggs <skeggsb at gmail.com>
Date:   Mon Jan 12 15:19:35 2009 +1000

nv50: remove previous hack to manage tiled surfaces

---

 src/gallium/drivers/nv50/nv50_context.h |    1 -
 src/gallium/drivers/nv50/nv50_surface.c |   33 +------------------------------
 2 files changed, 1 insertions(+), 33 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h
index c1ff606..a1a6b2c 100644
--- a/src/gallium/drivers/nv50/nv50_context.h
+++ b/src/gallium/drivers/nv50/nv50_context.h
@@ -91,7 +91,6 @@ nv50_miptree(struct pipe_texture *pt)
 
 struct nv50_surface {
 	struct pipe_surface base;
-	struct pipe_buffer *untiled;
 };
 
 static INLINE struct nv50_surface *
diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c
index 5bf97d3..3f45a2f 100644
--- a/src/gallium/drivers/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nv50/nv50_surface.c
@@ -63,48 +63,17 @@ static void *
 nv50_surface_map(struct pipe_screen *screen, struct pipe_surface *ps,
 		 unsigned flags )
 {
-	struct nouveau_winsys *nvws = nv50_screen(screen)->nvws;
 	struct pipe_winsys *ws = screen->winsys;
-	struct nv50_surface *s = nv50_surface(ps);
-	struct nv50_surface m = *s;
-	void *map;
 
-	if (!s->untiled) {
-		s->untiled = ws->buffer_create(ws, 0, 0, ps->buffer->size);
-
-		m.base.buffer = s->untiled;
-		nvws->surface_copy(nvws, &m.base, 0, 0, &s->base, 0, 0,
-					 ps->width, ps->height);
-	}
-
-	/* Map original tiled surface to disallow it being validated while
-	 * untiled mirror is mapped.
-	 */
-	ws->buffer_map(ws, ps->buffer, flags);
-
-	map = ws->buffer_map(ws, s->untiled, flags);
-	if (!map)
-		return NULL;
-
-	return map;
+	return ws->buffer_map(ws, ps->buffer, flags);
 }
 
 static void
 nv50_surface_unmap(struct pipe_screen *pscreen, struct pipe_surface *ps)
 {
-	struct nouveau_winsys *nvws = nv50_screen(pscreen)->nvws;
 	struct pipe_winsys *ws = pscreen->winsys;
-	struct nv50_surface *s = nv50_surface(ps);
-	struct nv50_surface m = *s;
 
-	ws->buffer_unmap(ws, s->untiled);
 	ws->buffer_unmap(ws, ps->buffer);
-
-	m.base.buffer = s->untiled;
-	nvws->surface_copy(nvws, &s->base, 0, 0, &m.base, 0, 0,
-				 ps->width, ps->height);
-
-	pipe_buffer_reference(pscreen, &s->untiled, NULL);
 }
 
 void




More information about the mesa-commit mailing list