nv10_init_surface_functions(nv10);
nv10_init_state_functions(nv10);
- nv10_init_miptree_functions(nv10);
nv10->draw = draw_create();
assert(nv10->draw);
extern void nv10_init_state_functions(struct nv10_context *nv10);
extern void nv10_init_surface_functions(struct nv10_context *nv10);
-extern void nv10_init_miptree_functions(struct nv10_context *nv10);
extern void nv10_screen_init_miptree_functions(struct pipe_screen *pscreen);
}
static struct pipe_texture *
-nv10_miptree_create(struct pipe_screen *screen, struct pipe_texture *pt)
+nv10_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
{
struct pipe_winsys *ws = screen->winsys;
struct nv10_miptree *mt;
static struct pipe_surface *
nv10_miptree_surface_get(struct pipe_screen *screen, struct pipe_texture *pt,
- unsigned face, unsigned level, unsigned zslice)
+ unsigned face, unsigned level, unsigned zslice,
+ unsigned flags)
{
struct pipe_winsys *ws = screen->winsys;
struct nv10_miptree *nv10mt = (struct nv10_miptree *)pt;
return ps;
}
-void nv10_init_miptree_functions(struct nv10_context *nv10)
+static void
+nv10_miptree_surface_release(struct pipe_screen *screen,
+ struct pipe_surface **surface)
{
- nv10->pipe.texture_update = nv10_miptree_update;
}
void nv10_screen_init_miptree_functions(struct pipe_screen *pscreen)
pscreen->texture_create = nv10_miptree_create;
pscreen->texture_release = nv10_miptree_release;
pscreen->get_tex_surface = nv10_miptree_surface_get;
+ pscreen->tex_surface_release = nv10_miptree_surface_release;
}
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)
{
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;
nv30_init_query_functions(nv30);
nv30_init_surface_functions(nv30);
nv30_init_state_functions(nv30);
- nv30_init_miptree_functions(nv30);
/* Create, configure, and install fallback swtnl path */
nv30->draw = draw_create();
extern void nv30_init_state_functions(struct nv30_context *nv30);
extern void nv30_init_surface_functions(struct nv30_context *nv30);
-extern void nv30_init_miptree_functions(struct nv30_context *nv30);
extern void nv30_init_query_functions(struct nv30_context *nv30);
extern void nv30_screen_init_miptree_functions(struct pipe_screen *pscreen);
}
}
-static void
-nv30_miptree_update(struct pipe_context *pipe, struct pipe_texture *mt,
- uint face, uint levels)
-{
-}
-
static struct pipe_surface *
-nv30_miptree_surface(struct pipe_screen *pscreen, struct pipe_texture *pt,
- unsigned face, unsigned level, unsigned zslice)
+nv30_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
+ unsigned face, unsigned level, unsigned zslice,
+ unsigned flags)
{
struct pipe_winsys *ws = pscreen->winsys;
struct nv30_miptree *nv30mt = (struct nv30_miptree *)pt;
return ps;
}
-void
-nv30_init_miptree_functions(struct nv30_context *nv30)
+static void
+nv30_miptree_surface_del(struct pipe_screen *pscreen,
+ struct pipe_surface **psurface)
{
- nv30->pipe.texture_update = nv30_miptree_update;
}
void
{
pscreen->texture_create = nv30_miptree_create;
pscreen->texture_release = nv30_miptree_release;
- pscreen->get_tex_surface = nv30_miptree_surface;
+ pscreen->get_tex_surface = nv30_miptree_surface_new;
+ pscreen->tex_surface_release = nv30_miptree_surface_del;
}
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)
{
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;
nv40_init_query_functions(nv40);
nv40_init_surface_functions(nv40);
nv40_init_state_functions(nv40);
- nv40_init_miptree_functions(nv40);
/* Create, configure, and install fallback swtnl path */
nv40->draw = draw_create();
extern void nv40_init_state_functions(struct nv40_context *nv40);
extern void nv40_init_surface_functions(struct nv40_context *nv40);
-extern void nv40_init_miptree_functions(struct nv40_context *nv40);
extern void nv40_init_query_functions(struct nv40_context *nv40);
extern void nv40_screen_init_miptree_functions(struct pipe_screen *pscreen);
}
}
-static void
-nv40_miptree_update(struct pipe_context *pipe, struct pipe_texture *mt,
- uint face, uint levels)
-{
-}
-
static struct pipe_surface *
-nv40_miptree_surface(struct pipe_screen *pscreen, struct pipe_texture *pt,
- unsigned face, unsigned level, unsigned zslice)
+nv40_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
+ unsigned face, unsigned level, unsigned zslice,
+ unsigned flags)
{
struct pipe_winsys *ws = pscreen->winsys;
struct nv40_miptree *nv40mt = (struct nv40_miptree *)pt;
return ps;
}
-void
-nv40_init_miptree_functions(struct nv40_context *nv40)
+static void
+nv40_miptree_surface_del(struct pipe_screen *pscreen,
+ struct pipe_surface **psurface)
{
- nv40->pipe.texture_update = nv40_miptree_update;
}
void
{
pscreen->texture_create = nv40_miptree_create;
pscreen->texture_release = nv40_miptree_release;
- pscreen->get_tex_surface = nv40_miptree_surface;
+ pscreen->get_tex_surface = nv40_miptree_surface_new;
+ pscreen->tex_surface_release = nv40_miptree_surface_del;
}
return FALSE;
}
+static void *
+nv40_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
+nv40_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
+{
+ struct pipe_winsys *ws = screen->winsys;
+
+ ws->buffer_unmap(ws, surface->buffer);
+}
+
static void
nv40_screen_destroy(struct pipe_screen *pscreen)
{
screen->pipe.is_format_supported = nv40_screen_surface_format_supported;
+ screen->pipe.surface_map = nv40_surface_map;
+ screen->pipe.surface_unmap = nv40_surface_unmap;
+
nv40_screen_init_miptree_functions(&screen->pipe);
return &screen->pipe;
nv50->pipe.flush = nv50_flush;
- nv50_init_miptree_functions(nv50);
nv50_init_surface_functions(nv50);
nv50_init_state_functions(nv50);
nv50_init_query_functions(nv50);
return (struct nv50_context *)pipe;
}
-extern void nv50_init_miptree_functions(struct nv50_context *nv50);
extern void nv50_init_surface_functions(struct nv50_context *nv50);
extern void nv50_init_state_functions(struct nv50_context *nv50);
extern void nv50_init_query_functions(struct nv50_context *nv50);
}
static struct pipe_surface *
-nv50_miptree_surface(struct pipe_screen *pscreen, struct pipe_texture *pt,
- unsigned face, unsigned level, unsigned zslice)
+nv50_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
+ unsigned face, unsigned level, unsigned zslice,
+ unsigned flags)
{
struct pipe_winsys *ws = pscreen->winsys;
struct nv50_miptree *mt = nv50_miptree(pt);
return ps;
}
-void
-nv50_screen_init_miptree_functions(struct pipe_screen *pscreen)
-{
- pscreen->texture_create = nv50_miptree_create;
- pscreen->texture_release = nv50_miptree_release;
- pscreen->get_tex_surface = nv50_miptree_surface;
-}
-
static void
-nv50_miptree_update(struct pipe_context *pipe, struct pipe_texture *mt,
- uint face, uint levels)
+nv50_miptree_surface_del(struct pipe_screen *pscreen,
+ struct pipe_surface **psurface)
{
}
void
-nv50_init_miptree_functions(struct nv50_context *nv50)
+nv50_screen_init_miptree_functions(struct pipe_screen *pscreen)
{
- nv50->pipe.texture_update = nv50_miptree_update;
+ pscreen->texture_create = nv50_miptree_create;
+ pscreen->texture_release = nv50_miptree_release;
+ pscreen->get_tex_surface = nv50_miptree_surface_new;
+ pscreen->tex_surface_release = nv50_miptree_surface_del;
}
+
}
}
+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)
{
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;