summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv10/nv10_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/nv10/nv10_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/nv10/nv10_screen.c')
-rw-r--r--src/gallium/drivers/nv10/nv10_screen.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv10/nv10_screen.c b/src/gallium/drivers/nv10/nv10_screen.c
index 5fe3a030811..67787d8e9ce 100644
--- a/src/gallium/drivers/nv10/nv10_screen.c
+++ b/src/gallium/drivers/nv10/nv10_screen.c
@@ -117,6 +117,28 @@ nv10_screen_is_format_supported(struct pipe_screen *screen,
return FALSE;
}
+static void *
+nv10_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
+nv10_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
+{
+ struct pipe_winsys *ws = screen->winsys;
+
+ ws->buffer_unmap(ws, surface->buffer);
+}
+
static void
nv10_screen_destroy(struct pipe_screen *pscreen)
{
@@ -180,6 +202,9 @@ nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
screen->pipe.is_format_supported = nv10_screen_is_format_supported;
+ screen->pipe.surface_map = nv10_surface_map;
+ screen->pipe.surface_unmap = nv10_surface_unmap;
+
nv10_screen_init_miptree_functions(&screen->pipe);
return &screen->pipe;