summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_screen.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-05-27 01:22:22 +1000
committerBen Skeggs <[email protected]>2008-05-27 01:23:31 +1000
commitfa4b2439d4f240a5e573d4ea198b829791d614f4 (patch)
tree702abbb5a9cbe97ab902252720df9d6916ac7af7 /src/gallium/drivers/nv50/nv50_screen.c
parent0f9635d9d522ea712724415599ceb44d53e67819 (diff)
nouveau: very quick port to tex-surface changes.
probably the last match-gallium-upstream merge for a bit, some cleanup+nv50 work coming RSN...
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_screen.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index d069639dc48..29c057a1453 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -117,6 +117,28 @@ nv50_screen_get_paramf(struct pipe_screen *pscreen, int param)
}
}
+static void *
+nv50_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
+ unsigned flags )
+{
+ struct pipe_winsys *ws = screen->winsys;
+ void *map;
+
+ map = ws->buffer_map(ws, surface->buffer, flags);
+ if (!map)
+ return NULL;
+
+ return map + surface->offset;
+}
+
+static void
+nv50_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
+{
+ struct pipe_winsys *ws = screen->winsys;
+
+ ws->buffer_unmap(ws, surface->buffer);
+}
+
static void
nv50_screen_destroy(struct pipe_screen *pscreen)
{
@@ -209,6 +231,9 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
screen->pipe.is_format_supported = nv50_screen_is_format_supported;
+ screen->pipe.surface_map = nv50_surface_map;
+ screen->pipe.surface_unmap = nv50_surface_unmap;
+
nv50_screen_init_miptree_functions(&screen->pipe);
return &screen->pipe;