diff options
author | Ben Skeggs <[email protected]> | 2008-05-27 01:22:22 +1000 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2008-05-27 01:23:31 +1000 |
commit | fa4b2439d4f240a5e573d4ea198b829791d614f4 (patch) | |
tree | 702abbb5a9cbe97ab902252720df9d6916ac7af7 /src/gallium/drivers/nv30/nv30_screen.c | |
parent | 0f9635d9d522ea712724415599ceb44d53e67819 (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/nv30/nv30_screen.c')
-rw-r--r-- | src/gallium/drivers/nv30/nv30_screen.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c index bb77776ff15..9c576369891 100644 --- a/src/gallium/drivers/nv30/nv30_screen.c +++ b/src/gallium/drivers/nv30/nv30_screen.c @@ -124,6 +124,28 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen, return FALSE; } +static void * +nv30_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 +nv30_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface) +{ + struct pipe_winsys *ws = screen->winsys; + + ws->buffer_unmap(ws, surface->buffer); +} + static void nv30_screen_destroy(struct pipe_screen *pscreen) { @@ -300,6 +322,9 @@ nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws) screen->pipe.is_format_supported = nv30_screen_surface_format_supported; + screen->pipe.surface_map = nv30_surface_map; + screen->pipe.surface_unmap = nv30_surface_unmap; + nv30_screen_init_miptree_functions(&screen->pipe); return &screen->pipe; |