nv50: move surface_map/unmap into nv50_surface.c
authorBen Skeggs <skeggsb@gmail.com>
Tue, 17 Jun 2008 13:43:38 +0000 (23:43 +1000)
committerBen Skeggs <skeggsb@gmail.com>
Sun, 29 Jun 2008 05:46:19 +0000 (15:46 +1000)
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nv50/nv50_screen.h
src/gallium/drivers/nv50/nv50_surface.c

index 8affb0f073f5b1c41fe92fe923111aa3009aa23a..18f22c59609209bc8b8da3ef1266a38c12e4fdda 100644 (file)
@@ -118,28 +118,6 @@ 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)
 {
@@ -309,10 +287,8 @@ 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);
+       nv50_surface_init_screen_functions(&screen->pipe);
 
        return &screen->pipe;
 }
index 5acb5003ba4b85ccf16b84e6e9381b57a8f46c24..08d1f450891ff8b3923e8873161901b26584c37a 100644 (file)
@@ -26,4 +26,6 @@ nv50_screen(struct pipe_screen *screen)
        return (struct nv50_screen *)screen;
 }
 
+void nv50_surface_init_screen_functions(struct pipe_screen *);
+
 #endif
index 4e294198b073c5a85bab5c9aecc9b54fad8acfc1..acd7b501ef4f2137505f6354ac32afcc24f573f1 100644 (file)
@@ -57,9 +57,39 @@ nv50_surface_fill(struct pipe_context *pipe, struct pipe_surface *dest,
        nvws->surface_fill(nvws, dest, destx, desty, width, height, value);
 }
 
+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);
+}
+
 void
 nv50_init_surface_functions(struct nv50_context *nv50)
 {
-   nv50->pipe.surface_copy = nv50_surface_copy;
-   nv50->pipe.surface_fill = nv50_surface_fill;
+       nv50->pipe.surface_copy = nv50_surface_copy;
+       nv50->pipe.surface_fill = nv50_surface_fill;
 }
+
+void
+nv50_surface_init_screen_functions(struct pipe_screen *pscreen)
+{
+       pscreen->surface_map = nv50_surface_map;
+       pscreen->surface_unmap = nv50_surface_unmap;
+}
+