nouveau: fix build
authorBen Skeggs <darktama@beleth.(none)>
Fri, 22 Feb 2008 01:36:48 +0000 (12:36 +1100)
committerBen Skeggs <darktama@beleth.(none)>
Fri, 22 Feb 2008 01:36:48 +0000 (12:36 +1100)
configs/default
src/gallium/drivers/nv40/nv40_miptree.c
src/gallium/drivers/nv40/nv40_surface.c

index 48ddd29282baa17cdc799322724b9942eb083133..af9ff6f426159f6d8a4c5c831782eb9e93667dba 100644 (file)
@@ -70,7 +70,7 @@ PROGRAM_DIRS = demos redbook samples glsl xdemos
 # Gallium directories and 
 GALLIUM_AUXILIARY_DIRS = draw cso_cache pipebuffer tgsi rtasm util
 GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a)
-GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple failover
+GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple nv30 nv40 nv50 failover
 GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
 GALLIUM_WINSYS_DIRS = xlib
 
index 92e6b3a43df709aeac09143f84d6a35fc4a3ddc9..5e1c7ade31b0cff948a2f998c178b743553b6b6d 100644 (file)
@@ -63,6 +63,7 @@ nv40_miptree_create(struct pipe_context *pipe, const struct pipe_texture *pt)
        if (!mt)
                return NULL;
        mt->base = *pt;
+       mt->base.refcount = 1;
        nv40_miptree_layout(mt);
 
        mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
@@ -95,10 +96,47 @@ nv40_miptree_release(struct pipe_context *pipe, struct pipe_texture **pt)
        }
 }
 
+static void
+nv40_miptree_update(struct pipe_context *pipe, struct pipe_texture *mt)
+{
+}
+
+static struct pipe_surface *
+nv40_miptree_surface(struct pipe_context *pipe, struct pipe_texture *pt,
+                     unsigned face, unsigned level, unsigned zslice)
+{
+       struct pipe_winsys *ws = pipe->winsys;
+       struct nv40_miptree *nv40mt = (struct nv40_miptree *)pt;
+       struct pipe_surface *ps;
+
+       ps = ws->surface_alloc(ws);
+       if (!ps)
+               return NULL;
+       pipe_buffer_reference(ws, &ps->buffer, nv40mt->buffer);
+       ps->format = pt->format;
+       ps->cpp = pt->cpp;
+       ps->width = pt->width[level];
+       ps->height = pt->height[level];
+       ps->pitch = nv40mt->level[level].pitch / ps->cpp;
+
+       if (pt->target == PIPE_TEXTURE_CUBE) {
+               ps->offset = nv40mt->level[level].image_offset[face];
+       } else
+       if (pt->target == PIPE_TEXTURE_3D) {
+               ps->offset = nv40mt->level[level].image_offset[zslice];
+       } else {
+               ps->offset = nv40mt->level[level].image_offset[0];
+       }
+
+       return ps;
+}
+
 void
 nv40_init_miptree_functions(struct nv40_context *nv40)
 {
        nv40->pipe.texture_create = nv40_miptree_create;
        nv40->pipe.texture_release = nv40_miptree_release;
+       nv40->pipe.texture_update = nv40_miptree_update;
+       nv40->pipe.get_tex_surface = nv40_miptree_surface;
 }
 
index 9726ab4e4dc9dff6f9cb3c173b9414f33e86f155..df5d7abdbfc8ada879a9d7c16c3af57db1ca56b8 100644 (file)
@@ -73,36 +73,6 @@ nv40_surface_format_supported(struct pipe_context *pipe,
        return FALSE;
 }
 
-static struct pipe_surface *
-nv40_get_tex_surface(struct pipe_context *pipe, struct pipe_texture *pt,
-                     unsigned face, unsigned level, unsigned zslice)
-{
-       struct pipe_winsys *ws = pipe->winsys;
-       struct nv40_miptree *nv40mt = (struct nv40_miptree *)pt;
-       struct pipe_surface *ps;
-
-       ps = ws->surface_alloc(ws);
-       if (!ps)
-               return NULL;
-       pipe_buffer_reference(ws, &ps->buffer, nv40mt->buffer);
-       ps->format = pt->format;
-       ps->cpp = pt->cpp;
-       ps->width = pt->width[level];
-       ps->height = pt->height[level];
-       ps->pitch = nv40mt->level[level].pitch / ps->cpp;
-
-       if (pt->target == PIPE_TEXTURE_CUBE) {
-               ps->offset = nv40mt->level[level].image_offset[face];
-       } else
-       if (pt->target == PIPE_TEXTURE_3D) {
-               ps->offset = nv40mt->level[level].image_offset[zslice];
-       } else {
-               ps->offset = nv40mt->level[level].image_offset[0];
-       }
-
-       return ps;
-}
-
 static void
 nv40_surface_copy(struct pipe_context *pipe, unsigned do_flip,
                  struct pipe_surface *dest, unsigned destx, unsigned desty,
@@ -131,7 +101,6 @@ void
 nv40_init_surface_functions(struct nv40_context *nv40)
 {
        nv40->pipe.is_format_supported = nv40_surface_format_supported;
-       nv40->pipe.get_tex_surface = nv40_get_tex_surface;
        nv40->pipe.surface_copy = nv40_surface_copy;
        nv40->pipe.surface_fill = nv40_surface_fill;
 }