gallium: give the screen priority when it comes to buffer allocations
authorZack Rusin <zackr@vmware.com>
Fri, 30 Jan 2009 02:43:15 +0000 (21:43 -0500)
committerZack Rusin <zackr@vmware.com>
Fri, 30 Jan 2009 02:43:15 +0000 (21:43 -0500)
allows the driver to overwrite buffer allocation, first step on the way
to making winsys interface internal to the drivers. state trackers and
the code above it will go through the screen

48 files changed:
src/gallium/auxiliary/pipebuffer/pb_winsys.c
src/gallium/auxiliary/util/u_timed_winsys.c
src/gallium/drivers/cell/ppu/cell_draw_arrays.c
src/gallium/drivers/cell/ppu/cell_state_shader.c
src/gallium/drivers/cell/ppu/cell_texture.c
src/gallium/drivers/i915simple/i915_state.c
src/gallium/drivers/i915simple/i915_texture.c
src/gallium/drivers/i965simple/brw_curbe.c
src/gallium/drivers/i965simple/brw_tex_layout.c
src/gallium/drivers/nv04/nv04_miptree.c
src/gallium/drivers/nv04/nv04_screen.c
src/gallium/drivers/nv04/nv04_vbo.c
src/gallium/drivers/nv10/nv10_miptree.c
src/gallium/drivers/nv10/nv10_prim_vbuf.c
src/gallium/drivers/nv10/nv10_screen.c
src/gallium/drivers/nv10/nv10_state.c
src/gallium/drivers/nv10/nv10_vbo.c
src/gallium/drivers/nv20/nv20_miptree.c
src/gallium/drivers/nv20/nv20_prim_vbuf.c
src/gallium/drivers/nv20/nv20_screen.c
src/gallium/drivers/nv20/nv20_state.c
src/gallium/drivers/nv20/nv20_vbo.c
src/gallium/drivers/nv20/nv20_vertprog.c
src/gallium/drivers/nv30/nv30_fragprog.c
src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv30/nv30_screen.c
src/gallium/drivers/nv30/nv30_vbo.c
src/gallium/drivers/nv30/nv30_vertprog.c
src/gallium/drivers/nv40/nv40_draw.c
src/gallium/drivers/nv40/nv40_fragprog.c
src/gallium/drivers/nv40/nv40_miptree.c
src/gallium/drivers/nv40/nv40_screen.c
src/gallium/drivers/nv40/nv40_vbo.c
src/gallium/drivers/nv40/nv40_vertprog.c
src/gallium/drivers/nv50/nv50_miptree.c
src/gallium/drivers/nv50/nv50_program.c
src/gallium/drivers/nv50/nv50_query.c
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nv50/nv50_surface.c
src/gallium/drivers/nv50/nv50_vbo.c
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_draw_arrays.c
src/gallium/drivers/softpipe/sp_state_fs.c
src/gallium/drivers/softpipe/sp_texture.c
src/gallium/drivers/trace/tr_winsys.c
src/gallium/include/pipe/p_inlines.h
src/gallium/include/pipe/p_screen.h
src/gallium/include/pipe/p_winsys.h

index 452835fdad38a15c06b4eb73149198e7a1b79688..2b0c4606cf22ff15359e96530563630acea77187 100644 (file)
@@ -184,8 +184,8 @@ pb_winsys_buffer_destroy(struct pipe_winsys *winsys,
 void 
 pb_init_winsys(struct pipe_winsys *winsys)
 {
-   winsys->user_buffer_create = pb_winsys_user_buffer_create;
-   winsys->buffer_map = pb_winsys_buffer_map;
-   winsys->buffer_unmap = pb_winsys_buffer_unmap;
-   winsys->buffer_destroy = pb_winsys_buffer_destroy;
+   winsys->_user_buffer_create = pb_winsys_user_buffer_create;
+   winsys->_buffer_map = pb_winsys_buffer_map;
+   winsys->_buffer_unmap = pb_winsys_buffer_unmap;
+   winsys->_buffer_destroy = pb_winsys_buffer_destroy;
 }
index dc3c9be5952dacf8ec690176e8c679271a87a416..c5797f5d63402d863f91e6f438ef5e15c1344e2b 100644 (file)
@@ -121,7 +121,8 @@ timed_buffer_create(struct pipe_winsys *winsys,
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
    uint64_t start = time_start();
 
-   struct pipe_buffer *buf = backend->buffer_create( backend, alignment, usage, size );
+   struct pipe_buffer *buf =
+      backend->_buffer_create( backend, alignment, usage, size );
 
    time_finish(winsys, start, 0, __FUNCTION__);
    
@@ -139,7 +140,7 @@ timed_user_buffer_create(struct pipe_winsys *winsys,
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
    uint64_t start = time_start();
 
-   struct pipe_buffer *buf = backend->user_buffer_create( backend, data, bytes );
+   struct pipe_buffer *buf = backend->_user_buffer_create( backend, data, bytes );
 
    time_finish(winsys, start, 1, __FUNCTION__);
    
@@ -155,7 +156,7 @@ timed_buffer_map(struct pipe_winsys *winsys,
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
    uint64_t start = time_start();
 
-   void *map = backend->buffer_map( backend, buf, flags );
+   void *map = backend->_buffer_map( backend, buf, flags );
 
    time_finish(winsys, start, 2, __FUNCTION__);
    
@@ -170,7 +171,7 @@ timed_buffer_unmap(struct pipe_winsys *winsys,
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
    uint64_t start = time_start();
 
-   backend->buffer_unmap( backend, buf );
+   backend->_buffer_unmap( backend, buf );
 
    time_finish(winsys, start, 3, __FUNCTION__);
 }
@@ -183,7 +184,7 @@ timed_buffer_destroy(struct pipe_winsys *winsys,
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
    uint64_t start = time_start();
 
-   backend->buffer_destroy( backend, buf );
+   backend->_buffer_destroy( backend, buf );
 
    time_finish(winsys, start, 4, __FUNCTION__);
 }
@@ -215,7 +216,7 @@ timed_surface_buffer_create(struct pipe_winsys *winsys,
    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
    uint64_t start = time_start();
 
-   struct pipe_buffer *ret = backend->surface_buffer_create( backend, width, height, 
+   struct pipe_buffer *ret = backend->_surface_buffer_create( backend, width, height, 
                                                              format, usage, stride );
 
    time_finish(winsys, start, 7, __FUNCTION__);
@@ -295,14 +296,14 @@ struct pipe_winsys *u_timed_winsys_create( struct pipe_winsys *backend )
 {
    struct timed_winsys *ws = CALLOC_STRUCT(timed_winsys);
    
-   ws->base.user_buffer_create = timed_user_buffer_create;
-   ws->base.buffer_map = timed_buffer_map;
-   ws->base.buffer_unmap = timed_buffer_unmap;
-   ws->base.buffer_destroy = timed_buffer_destroy;
-   ws->base.buffer_create = timed_buffer_create;
+   ws->base._user_buffer_create = timed_user_buffer_create;
+   ws->base._buffer_map = timed_buffer_map;
+   ws->base._buffer_unmap = timed_buffer_unmap;
+   ws->base._buffer_destroy = timed_buffer_destroy;
+   ws->base._buffer_create = timed_buffer_create;
+   ws->base._surface_buffer_create = timed_surface_buffer_create;
    ws->base.flush_frontbuffer = timed_flush_frontbuffer;
    ws->base.get_name = timed_get_name;
-   ws->base.surface_buffer_create = timed_surface_buffer_create;
    ws->base.fence_reference = timed_fence_reference;
    ws->base.fence_signalled = timed_fence_signalled;
    ws->base.fence_finish = timed_fence_finish;
index 880d5353207f73dec899e2add6673c02c504b587..ff3871d933232c8f34765f6300bf307b4e0a0478 100644 (file)
@@ -52,8 +52,8 @@ cell_map_constant_buffers(struct cell_context *sp)
    uint i;
    for (i = 0; i < 2; i++) {
       if (sp->constants[i].size) {
-         sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i].buffer,
-                                                  PIPE_BUFFER_USAGE_CPU_READ);
+         sp->mapped_constants[i] = ws->_buffer_map(ws, sp->constants[i].buffer,
+                                                   PIPE_BUFFER_USAGE_CPU_READ);
          cell_flush_buffer_range(sp, sp->mapped_constants[i], 
                                  sp->constants[i].buffer->size);
       }
@@ -71,7 +71,7 @@ cell_unmap_constant_buffers(struct cell_context *sp)
    uint i;
    for (i = 0; i < 2; i++) {
       if (sp->constants[i].size)
-         ws->buffer_unmap(ws, sp->constants[i].buffer);
+         ws->_buffer_unmap(ws, sp->constants[i].buffer);
       sp->mapped_constants[i] = NULL;
    }
 }
index cda39f8d59262aac99334a390624399c5f27519c..bcbd81922cf436f5b82c07b2cf0afb59e575a331 100644 (file)
@@ -194,9 +194,9 @@ cell_set_constant_buffer(struct pipe_context *pipe,
    draw_flush(cell->draw);
 
    /* note: reference counting */
-   winsys_buffer_reference(ws,
-                        &cell->constants[shader].buffer,
-                        buf->buffer);
+   pipe_buffer_reference(pipe->screen,
+                         &cell->constants[shader].buffer,
+                         buf->buffer);
    cell->constants[shader].size = buf->size;
 
    if (shader == PIPE_SHADER_VERTEX)
index 9f83ab8fa4cfc0f237e94403c723b497aa881456..f1b1a38efcfb33d2bece2181617a93f5f6ecde97 100644 (file)
@@ -112,8 +112,8 @@ cell_texture_create(struct pipe_screen *screen,
 
    cell_texture_layout(ct);
 
-   ct->buffer = ws->buffer_create(ws, 32, PIPE_BUFFER_USAGE_PIXEL,
-                                  ct->buffer_size);
+   ct->buffer = ws->_buffer_create(ws, 32, PIPE_BUFFER_USAGE_PIXEL,
+                                   ct->buffer_size);
 
    if (!ct->buffer) {
       FREE(ct);
@@ -154,7 +154,7 @@ cell_texture_release(struct pipe_screen *screen,
           */
          if (ct->tiled_buffer[i]) {
             ct->tiled_mapped[i] = NULL;
-            winsys_buffer_reference(screen->winsys, &ct->tiled_buffer[i], NULL);
+            pipe_buffer_reference(screen, &ct->tiled_buffer[i], NULL);
          }
       }
 
@@ -324,12 +324,12 @@ cell_twiddle_texture(struct pipe_screen *screen,
             /* allocate buffer for tiled data now */
             struct pipe_winsys *ws = screen->winsys;
             uint bytes = bufWidth * bufHeight * 4 * numFaces;
-            ct->tiled_buffer[level] = ws->buffer_create(ws, 16,
-                                                        PIPE_BUFFER_USAGE_PIXEL,
-                                                        bytes);
+            ct->tiled_buffer[level] = ws->_buffer_create(ws, 16,
+                                                         PIPE_BUFFER_USAGE_PIXEL,
+                                                         bytes);
             /* and map it */
-            ct->tiled_mapped[level] = ws->buffer_map(ws, ct->tiled_buffer[level],
-                                                     PIPE_BUFFER_USAGE_GPU_READ);
+            ct->tiled_mapped[level] = ws->_buffer_map(ws, ct->tiled_buffer[level],
+                                                      PIPE_BUFFER_USAGE_GPU_READ);
          }
          dst = (uint *) ((ubyte *) ct->tiled_mapped[level] + offset);
 
@@ -406,7 +406,7 @@ cell_get_tex_surface(struct pipe_screen *screen,
    if (ps) {
       assert(ps->refcount);
       assert(ps->winsys);
-      winsys_buffer_reference(ws, &ps->buffer, ct->buffer);
+      pipe_buffer_reference(screen, &ps->buffer, ct->buffer);
       ps->format = pt->format;
       ps->block = pt->block;
       ps->width = pt->width[level];
index 19f194c027d4cc7b5cf1ce16f343c7087830297c..b931556b7e16a63102cff6aaf57ef8f2f21ec155 100644 (file)
@@ -536,10 +536,10 @@ static void i915_set_constant_buffer(struct pipe_context *pipe,
    if (buf) {
       void *mapped;
       if (buf->buffer && buf->buffer->size &&
-          (mapped = ws->buffer_map(ws, buf->buffer,
-                                   PIPE_BUFFER_USAGE_CPU_READ))) {
+          (mapped = ws->_buffer_map(ws, buf->buffer,
+                                    PIPE_BUFFER_USAGE_CPU_READ))) {
          memcpy(i915->current.constants[shader], mapped, buf->buffer->size);
-         ws->buffer_unmap(ws, buf->buffer);
+         ws->_buffer_unmap(ws, buf->buffer);
          i915->current.num_user_constants[shader]
             = buf->buffer->size / (4 * sizeof(float));
       }
index 4acc4b021403ca6f4d665b0f54e068dbc9bb30df..7847f2ef86fe390e4b1e29f09ea2d568a8b6d4ef 100644 (file)
@@ -605,18 +605,18 @@ i915_texture_create(struct pipe_screen *screen,
 
    tex_size = tex->stride * tex->total_nblocksy;
 
-   tex->buffer = ws->buffer_create(ws, 64,
-                                  PIPE_BUFFER_USAGE_PIXEL,
-                                  tex_size);
+   tex->buffer = ws->_buffer_create(ws, 64,
+                                    PIPE_BUFFER_USAGE_PIXEL,
+                                    tex_size);
 
    if (!tex->buffer)
       goto fail;
 
 #if 0
-   void *ptr = ws->buffer_map(ws, tex->buffer,
+   void *ptr = ws->_buffer_map(ws, tex->buffer,
       PIPE_BUFFER_USAGE_CPU_WRITE);
    memset(ptr, 0x80, tex_size);
-   ws->buffer_unmap(ws, tex->buffer);
+   ws->_buffer_unmap(ws, tex->buffer);
 #endif
 
    return &tex->base;
index 5e1cce753037dbc0ee3c8f6d490c4c72a3bef56c..4b1f4d3121315a6646bab266085db8953462c2fb 100644 (file)
@@ -256,13 +256,13 @@ static void upload_constant_buffer(struct brw_context *brw)
       /* FIXME: buffer size is num_consts + num_immediates */
       if (brw->vs.prog_data->num_consts) {
          /* map the vertex constant buffer and copy to curbe: */
-         void *data = ws->buffer_map(ws, cbuffer->buffer, 0);
+         void *data = ws->_buffer_map(ws, cbuffer->buffer, 0);
          /* FIXME: this is wrong. the cbuffer->buffer->size currently
           * represents size of consts + immediates. so if we'll
           * have both we'll copy over the end of the buffer
           * with the subsequent memcpy */
          memcpy(&buf[offset], data, cbuffer->buffer->size);
-         ws->buffer_unmap(ws, cbuffer->buffer);
+         ws->_buffer_unmap(ws, cbuffer->buffer);
          offset += cbuffer->buffer->size;
       }
       /*immediates*/
index 12e2e02cfdc168044b64c2767cbcbcc4323285d4..c99eb8e75af4760d5e0458e07ee4d5e9a45b4d11 100644 (file)
@@ -295,10 +295,10 @@ brw_texture_create_screen(struct pipe_screen *screen,
       tex->base.nblocksy[0] = pf_get_nblocksy(&tex->base.block, tex->base.height[0]);
    
       if (brw_miptree_layout(tex))
-        tex->buffer = ws->buffer_create(ws, 64,
-                                         PIPE_BUFFER_USAGE_PIXEL,
-                                         tex->stride *
-                                         tex->total_nblocksy);
+        tex->buffer = ws->_buffer_create(ws, 64,
+                                          PIPE_BUFFER_USAGE_PIXEL,
+                                          tex->stride *
+                                          tex->total_nblocksy);
 
       if (!tex->buffer) {
         FREE(tex);
@@ -322,7 +322,6 @@ brw_texture_release_screen(struct pipe_screen *screen,
        __FUNCTION__, (void *) *pt, (*pt)->refcount - 1);
    */
    if (--(*pt)->refcount <= 0) {
-      struct pipe_winsys *ws = screen->winsys;
       struct brw_texture *tex = (struct brw_texture *)*pt;
       uint i;
 
@@ -330,7 +329,7 @@ brw_texture_release_screen(struct pipe_screen *screen,
       DBG("%s deleting %p\n", __FUNCTION__, (void *) tex);
       */
 
-      winsys_buffer_reference(ws, &tex->buffer, NULL);
+      pipe_buffer_reference(screen, &tex->buffer, NULL);
 
       for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++)
          if (tex->image_offset[i])
@@ -347,7 +346,6 @@ brw_get_tex_surface_screen(struct pipe_screen *screen,
                            struct pipe_texture *pt,
                            unsigned face, unsigned level, unsigned zslice)
 {
-   struct pipe_winsys *ws = screen->winsys;
    struct brw_texture *tex = (struct brw_texture *)pt;
    struct pipe_surface *ps;
    unsigned offset;  /* in bytes */
@@ -369,7 +367,7 @@ brw_get_tex_surface_screen(struct pipe_screen *screen,
    if (ps) {
       ps->refcount = 1;
       pipe_texture_reference(&ps->texture, pt);
-      winsys_buffer_reference(ws, &ps->buffer, tex->buffer);
+      pipe_buffer_reference(screen, &ps->buffer, tex->buffer);
       ps->format = pt->format;
       ps->width = pt->width[level];
       ps->height = pt->height[level];
index 094c38256b417dd676b85ab5ba24cdeb33a57280..32800f97411e8c4af11cb4520e256087977de717 100644 (file)
@@ -58,7 +58,7 @@ nv04_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
 
        nv04_miptree_layout(mt);
 
-       mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
+       mt->buffer = ws->_buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
                                           mt->total_size);
        if (!mt->buffer) {
                FREE(mt);
index 65eacde6b2ee4708e552fbf3320628be2e388f5c..2fa7d35294946210cb68dbace9f1fb98b84239b7 100644 (file)
@@ -117,7 +117,7 @@ nv04_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
        struct pipe_winsys *ws = screen->winsys;
        void *map;
 
-       map = ws->buffer_map(ws, surface->buffer, flags);
+       map = ws->_buffer_map(ws, surface->buffer, flags);
        if (!map)
                return NULL;
 
@@ -129,7 +129,7 @@ nv04_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
 {
        struct pipe_winsys *ws = screen->winsys;
 
-       ws->buffer_unmap(ws, surface->buffer);
+       ws->_buffer_unmap(ws, surface->buffer);
 }
 
 static void
index 91f919d48ec96f2b782942bbef5c27c0ab309ad5..117a73a1e47061d512549f29d0c289cdd5b0064d 100644 (file)
@@ -23,7 +23,7 @@ boolean nv04_draw_elements( struct pipe_context *pipe,
        for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
                if (nv04->vertex_buffer[i].buffer) {
                        void *buf
-                               = pipe->winsys->buffer_map(pipe->winsys,
+                               = pipe->winsys->_buffer_map(pipe->winsys,
                                                nv04->vertex_buffer[i].buffer,
                                                PIPE_BUFFER_USAGE_CPU_READ);
                        draw_set_mapped_vertex_buffer(draw, i, buf);
@@ -32,7 +32,7 @@ boolean nv04_draw_elements( struct pipe_context *pipe,
        /* Map index buffer, if present */
        if (indexBuffer) {
                void *mapped_indexes
-                       = pipe->winsys->buffer_map(pipe->winsys, indexBuffer,
+                       = pipe->winsys->_buffer_map(pipe->winsys, indexBuffer,
                                        PIPE_BUFFER_USAGE_CPU_READ);
                draw_set_mapped_element_buffer(draw, indexSize, mapped_indexes);
        }
@@ -49,12 +49,12 @@ boolean nv04_draw_elements( struct pipe_context *pipe,
         */
        for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
                if (nv04->vertex_buffer[i].buffer) {
-                       pipe->winsys->buffer_unmap(pipe->winsys, nv04->vertex_buffer[i].buffer);
+                       pipe->winsys->_buffer_unmap(pipe->winsys, nv04->vertex_buffer[i].buffer);
                        draw_set_mapped_vertex_buffer(draw, i, NULL);
                }
        }
        if (indexBuffer) {
-               pipe->winsys->buffer_unmap(pipe->winsys, indexBuffer);
+               pipe->winsys->_buffer_unmap(pipe->winsys, indexBuffer);
                draw_set_mapped_element_buffer(draw, 0, NULL);
        }
 
index f8c021261bc9995a0b2aac47bf15c407997a3007..384f89c39184515e645a98610aef09d4ce6b1915 100644 (file)
@@ -65,7 +65,7 @@ nv10_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
 
        nv10_miptree_layout(mt);
 
-       mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
+       mt->buffer = ws->_buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
                                           mt->total_size);
        if (!mt->buffer) {
                FREE(mt);
index e7e81d3dff879af114b9cc4159825a024121a88c..bdffaacf78cd96104b08f78c1bcd8fc9f181b37c 100644 (file)
@@ -111,11 +111,11 @@ nv10_vbuf_render_allocate_vertices( struct vbuf_render *render,
        size_t size = (size_t)vertex_size * (size_t)nr_vertices;
 
        assert(!nv10_render->buffer);
-       nv10_render->buffer = winsys->buffer_create(winsys, 64, PIPE_BUFFER_USAGE_VERTEX, size);
+       nv10_render->buffer = winsys->_buffer_create(winsys, 64, PIPE_BUFFER_USAGE_VERTEX, size);
 
        nv10->dirty |= NV10_NEW_VTXARRAYS;
 
-       return winsys->buffer_map(winsys, 
+       return winsys->_buffer_map(winsys, 
                        nv10_render->buffer, 
                        PIPE_BUFFER_USAGE_CPU_WRITE);
 }
@@ -187,7 +187,7 @@ nv10_vbuf_render_release_vertices( struct vbuf_render *render,
        struct pipe_screen *pscreen = &nv10->screen->pipe;
 
        assert(nv10_render->buffer);
-       winsys->buffer_unmap(winsys, nv10_render->buffer);
+       winsys->_buffer_unmap(winsys, nv10_render->buffer);
        pipe_buffer_reference(pscreen, &nv10_render->buffer, NULL);
 }
 
index 4d9fbd4b5f613d8b58b1812df313d24bbbd16841..333e0b3252fd6156b86400328b046a18d2c7c646 100644 (file)
@@ -122,7 +122,7 @@ nv10_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
        struct pipe_winsys *ws = screen->winsys;
        void *map;
 
-       map = ws->buffer_map(ws, surface->buffer, flags);
+       map = ws->_buffer_map(ws, surface->buffer, flags);
        if (!map)
                return NULL;
 
@@ -134,7 +134,7 @@ nv10_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
 {
        struct pipe_winsys *ws = screen->winsys;
 
-       ws->buffer_unmap(ws, surface->buffer);
+       ws->_buffer_unmap(ws, surface->buffer);
 }
 
 static void
index 119af66dfd054e357184c34602964e1c7f7b9e56..f84d45a730941675eaa050fab4c9263885178775 100644 (file)
@@ -468,12 +468,12 @@ nv10_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
        if (buf) {
                void *mapped;
                if (buf->buffer && buf->buffer->size &&
-                    (mapped = ws->buffer_map(ws, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ)))
+                    (mapped = ws->_buffer_map(ws, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ)))
                {
                        memcpy(nv10->constbuf[shader], mapped, buf->buffer->size);
                        nv10->constbuf_nr[shader] =
                                buf->buffer->size / (4 * sizeof(float));
-                       ws->buffer_unmap(ws, buf->buffer);
+                       ws->_buffer_unmap(ws, buf->buffer);
                }
        }
 }
index d0e788ac0368262e48ad907b76bf8ac38ea8e13a..a6b80e4050763eff1a28c30d72b5bf497d503f02 100644 (file)
@@ -25,7 +25,7 @@ boolean nv10_draw_elements( struct pipe_context *pipe,
        for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
                if (nv10->vtxbuf[i].buffer) {
                        void *buf
-                               = pipe->winsys->buffer_map(pipe->winsys,
+                               = pipe->winsys->_buffer_map(pipe->winsys,
                                                nv10->vtxbuf[i].buffer,
                                                PIPE_BUFFER_USAGE_CPU_READ);
                        draw_set_mapped_vertex_buffer(draw, i, buf);
@@ -34,7 +34,7 @@ boolean nv10_draw_elements( struct pipe_context *pipe,
        /* Map index buffer, if present */
        if (indexBuffer) {
                void *mapped_indexes
-                       = pipe->winsys->buffer_map(pipe->winsys, indexBuffer,
+                       = pipe->winsys->_buffer_map(pipe->winsys, indexBuffer,
                                        PIPE_BUFFER_USAGE_CPU_READ);
                draw_set_mapped_element_buffer(draw, indexSize, mapped_indexes);
        }
@@ -55,12 +55,12 @@ boolean nv10_draw_elements( struct pipe_context *pipe,
         */
        for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
                if (nv10->vtxbuf[i].buffer) {
-                       pipe->winsys->buffer_unmap(pipe->winsys, nv10->vtxbuf[i].buffer);
+                       pipe->winsys->_buffer_unmap(pipe->winsys, nv10->vtxbuf[i].buffer);
                        draw_set_mapped_vertex_buffer(draw, i, NULL);
                }
        }
        if (indexBuffer) {
-               pipe->winsys->buffer_unmap(pipe->winsys, indexBuffer);
+               pipe->winsys->_buffer_unmap(pipe->winsys, indexBuffer);
                draw_set_mapped_element_buffer(draw, 0, NULL);
        }
 
index d2038c391d69e35cb8f6b6294244932f6b456db7..759f29c95158a6db314e351f167c53b600b0d8e5 100644 (file)
@@ -65,7 +65,7 @@ nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
 
        nv20_miptree_layout(mt);
 
-       mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
+       mt->buffer = ws->_buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
                                           mt->total_size);
        if (!mt->buffer) {
                FREE(mt);
index 74540845a87c28576a0c28400140d919def3987f..c4841026b3d2759ce0a2bde33d28bc098cdcfec3 100644 (file)
@@ -113,9 +113,9 @@ static void *
 nv20__allocate_pbuffer(struct nv20_vbuf_render *nv20_render, size_t size)
 {
        struct pipe_winsys *winsys = nv20_render->nv20->pipe.winsys;
-       nv20_render->pbuffer = winsys->buffer_create(winsys, 64,
+       nv20_render->pbuffer = winsys->_buffer_create(winsys, 64,
                                        PIPE_BUFFER_USAGE_VERTEX, size);
-       return winsys->buffer_map(winsys,
+       return winsys->_buffer_map(winsys,
                        nv20_render->pbuffer,
                        PIPE_BUFFER_USAGE_CPU_WRITE);
 }
@@ -334,7 +334,7 @@ nv20_vbuf_render_release_vertices( struct vbuf_render *render,
        struct pipe_screen *pscreen = &nv20->screen->pipe;
 
        if (nv20_render->pbuffer) {
-               winsys->buffer_unmap(winsys, nv20_render->pbuffer);
+               winsys->_buffer_unmap(winsys, nv20_render->pbuffer);
                pipe_buffer_reference(pscreen, &nv20_render->pbuffer, NULL);
        } else if (nv20_render->mbuffer) {
                FREE(nv20_render->mbuffer);
index 2ca6e6b14980e70702170fe2ca18e6b21c154a55..e9adf05a7d22a070595f1871f57166429a65a6ef 100644 (file)
@@ -122,7 +122,7 @@ nv20_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
        struct pipe_winsys *ws = screen->winsys;
        void *map;
 
-       map = ws->buffer_map(ws, surface->buffer, flags);
+       map = ws->_buffer_map(ws, surface->buffer, flags);
        if (!map)
                return NULL;
 
@@ -134,7 +134,7 @@ nv20_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
 {
        struct pipe_winsys *ws = screen->winsys;
 
-       ws->buffer_unmap(ws, surface->buffer);
+       ws->_buffer_unmap(ws, surface->buffer);
 }
 
 static void
index ecec4f49a0c56c85a5ee50ce3aede23f5b4121e7..65060006dac48d602a0680744f6dcea47ae1789e 100644 (file)
@@ -461,12 +461,12 @@ nv20_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
        if (buf) {
                void *mapped;
                if (buf->buffer && buf->buffer->size &&
-                    (mapped = ws->buffer_map(ws, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ)))
+                    (mapped = ws->_buffer_map(ws, buf->buffer, PIPE_BUFFER_USAGE_CPU_READ)))
                {
                        memcpy(nv20->constbuf[shader], mapped, buf->buffer->size);
                        nv20->constbuf_nr[shader] =
                                buf->buffer->size / (4 * sizeof(float));
-                       ws->buffer_unmap(ws, buf->buffer);
+                       ws->_buffer_unmap(ws, buf->buffer);
                }
        }
 }
index 4edc4efebd841f95a5242c0f3078a3eed42aadd4..d6b731790cc62331a31c07fbd6c3b96aad2a58bd 100644 (file)
@@ -25,7 +25,7 @@ boolean nv20_draw_elements( struct pipe_context *pipe,
        for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
                if (nv20->vtxbuf[i].buffer) {
                        void *buf
-                               = pipe->winsys->buffer_map(pipe->winsys,
+                               = pipe->winsys->_buffer_map(pipe->winsys,
                                                nv20->vtxbuf[i].buffer,
                                                PIPE_BUFFER_USAGE_CPU_READ);
                        draw_set_mapped_vertex_buffer(draw, i, buf);
@@ -34,7 +34,7 @@ boolean nv20_draw_elements( struct pipe_context *pipe,
        /* Map index buffer, if present */
        if (indexBuffer) {
                void *mapped_indexes
-                       = pipe->winsys->buffer_map(pipe->winsys, indexBuffer,
+                       = pipe->winsys->_buffer_map(pipe->winsys, indexBuffer,
                                        PIPE_BUFFER_USAGE_CPU_READ);
                draw_set_mapped_element_buffer(draw, indexSize, mapped_indexes);
        }
@@ -55,12 +55,12 @@ boolean nv20_draw_elements( struct pipe_context *pipe,
         */
        for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
                if (nv20->vtxbuf[i].buffer) {
-                       pipe->winsys->buffer_unmap(pipe->winsys, nv20->vtxbuf[i].buffer);
+                       pipe->winsys->_buffer_unmap(pipe->winsys, nv20->vtxbuf[i].buffer);
                        draw_set_mapped_vertex_buffer(draw, i, NULL);
                }
        }
        if (indexBuffer) {
-               pipe->winsys->buffer_unmap(pipe->winsys, indexBuffer);
+               pipe->winsys->_buffer_unmap(pipe->winsys, indexBuffer);
                draw_set_mapped_element_buffer(draw, 0, NULL);
        }
 
index a885fcd7a567702595c890fda5e68d1652902c8b..c4f3d0f14fb8f0a38c0f3f93b1ece836e1703c64 100644 (file)
@@ -749,7 +749,7 @@ nv20_vertprog_validate(struct nv20_context *nv20)
                float *map = NULL;
 
                if (constbuf) {
-                       map = ws->buffer_map(ws, constbuf,
+                       map = ws->_buffer_map(ws, constbuf,
                                             PIPE_BUFFER_USAGE_CPU_READ);
                }
 
@@ -771,7 +771,7 @@ nv20_vertprog_validate(struct nv20_context *nv20)
                }
 
                if (constbuf) {
-                       ws->buffer_unmap(ws, constbuf);
+                       ws->_buffer_unmap(ws, constbuf);
                }
        }
 
index 320ba3f4bf42c0ba20b1f5538fbfa6cdd6aadcf9..f22a06c1a3c31fc2c169686111696ba77e93d551 100644 (file)
@@ -803,7 +803,7 @@ nv30_fragprog_upload(struct nv30_context *nv30,
        uint32_t *map;
        int i;
 
-       map = ws->buffer_map(ws, fp->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
+       map = ws->_buffer_map(ws, fp->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
 
 #if 0
        for (i = 0; i < fp->insn_len; i++) {
@@ -825,7 +825,7 @@ nv30_fragprog_upload(struct nv30_context *nv30,
                }
        }
 
-       ws->buffer_unmap(ws, fp->buffer);
+       ws->_buffer_unmap(ws, fp->buffer);
 }
 
 static boolean
@@ -849,7 +849,7 @@ nv30_fragprog_validate(struct nv30_context *nv30)
                return FALSE;
        }
 
-       fp->buffer = ws->buffer_create(ws, 0x100, 0, fp->insn_len * 4);
+       fp->buffer = ws->_buffer_create(ws, 0x100, 0, fp->insn_len * 4);
        nv30_fragprog_upload(nv30, fp);
 
        so = so_new(8, 1);
@@ -869,7 +869,7 @@ update_constants:
        if (fp->nr_consts) {
                float *map;
                
-               map = ws->buffer_map(ws, constbuf, PIPE_BUFFER_USAGE_CPU_READ);
+               map = ws->_buffer_map(ws, constbuf, PIPE_BUFFER_USAGE_CPU_READ);
                for (i = 0; i < fp->nr_consts; i++) {
                        struct nv30_fragment_program_data *fpd = &fp->consts[i];
                        uint32_t *p = &fp->insn[fpd->offset];
@@ -880,7 +880,7 @@ update_constants:
                        memcpy(p, cb, 4 * sizeof(float));
                        new_consts = TRUE;
                }
-               ws->buffer_unmap(ws, constbuf);
+               ws->_buffer_unmap(ws, constbuf);
 
                if (new_consts)
                        nv30_fragprog_upload(nv30, fp);
index 54fb3585f8ade410510ce633b79a3b96ccf598d7..bf6c4a1c74950940d4a8c45b47d4146aa69b97bd 100644 (file)
@@ -93,7 +93,7 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
 
        nv30_miptree_layout(mt);
 
-       mt->buffer = ws->buffer_create(ws, 256,
+       mt->buffer = ws->_buffer_create(ws, 256,
                                       PIPE_BUFFER_USAGE_PIXEL |
                                       NOUVEAU_BUFFER_USAGE_TEXTURE,
                                       mt->total_size);
@@ -181,7 +181,7 @@ nv30_miptree_surface_del(struct pipe_screen *pscreen,
                return;
 
        pipe_texture_reference(&ps->texture, NULL);
-       pipe_buffer_reference(pscreen->winsys, &ps->buffer, NULL);
+       pipe_buffer_reference(pscreen, &ps->buffer, NULL);
        FREE(ps);
 }
 
index 1fac6d3df831b77379a3a2ce9eec764219ebea53..56b20ae2fd37e416e9cde906b53970f9a3e1225b 100644 (file)
@@ -161,7 +161,7 @@ nv30_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
 
        assert(surface_to_map);
 
-       map = ws->buffer_map(ws, surface_to_map->buffer, flags);
+       map = ws->_buffer_map(ws, surface_to_map->buffer, flags);
        if (!map)
                return NULL;
 
@@ -189,7 +189,7 @@ nv30_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
 
        assert(surface_to_unmap);
 
-       ws->buffer_unmap(ws, surface_to_unmap->buffer);
+       ws->_buffer_unmap(ws, surface_to_unmap->buffer);
 
        if (surface_to_unmap != surface) {
                struct nv30_screen *nvscreen = nv30_screen(screen);
index 2d6d48ac161f3034601e7abb20210e9c33fdf876..cf0468f87904a1d3360a58f6f5ac76e7b978081b 100644 (file)
@@ -116,7 +116,7 @@ nv30_vbo_static_attrib(struct nv30_context *nv30, struct nouveau_stateobj *so,
        if (nv30_vbo_format_to_hw(ve->src_format, &type, &ncomp))
                return FALSE;
 
-       map  = ws->buffer_map(ws, vb->buffer, PIPE_BUFFER_USAGE_CPU_READ);
+       map  = ws->_buffer_map(ws, vb->buffer, PIPE_BUFFER_USAGE_CPU_READ);
        map += vb->buffer_offset + ve->src_offset;
 
        switch (type) {
@@ -148,17 +148,17 @@ nv30_vbo_static_attrib(struct nv30_context *nv30, struct nouveau_stateobj *so,
                        so_data  (so, fui(v[0]));
                        break;
                default:
-                       ws->buffer_unmap(ws, vb->buffer);
+                       ws->_buffer_unmap(ws, vb->buffer);
                        return FALSE;
                }
        }
                break;
        default:
-               ws->buffer_unmap(ws, vb->buffer);
+               ws->_buffer_unmap(ws, vb->buffer);
                return FALSE;
        }
 
-       ws->buffer_unmap(ws, vb->buffer);
+       ws->_buffer_unmap(ws, vb->buffer);
 
        return TRUE;
 }
@@ -371,7 +371,7 @@ nv30_draw_elements_inline(struct pipe_context *pipe,
        struct pipe_winsys *ws = pipe->winsys;
        void *map;
 
-       map = ws->buffer_map(ws, ib, PIPE_BUFFER_USAGE_CPU_READ);
+       map = ws->_buffer_map(ws, ib, PIPE_BUFFER_USAGE_CPU_READ);
        if (!ib) {
                NOUVEAU_ERR("failed mapping ib\n");
                return FALSE;
@@ -392,7 +392,7 @@ nv30_draw_elements_inline(struct pipe_context *pipe,
                break;
        }
 
-       ws->buffer_unmap(ws, ib);
+       ws->_buffer_unmap(ws, ib);
        return TRUE;
 }
 
index 72824559e8befd5c9af6f5869281afd1d3780477..b67dde0808be4a26fd3814275769eefaa07e4d38 100644 (file)
@@ -749,7 +749,7 @@ nv30_vertprog_validate(struct nv30_context *nv30)
                float *map = NULL;
 
                if (constbuf) {
-                       map = ws->buffer_map(ws, constbuf,
+                       map = ws->_buffer_map(ws, constbuf,
                                             PIPE_BUFFER_USAGE_CPU_READ);
                }
 
@@ -771,7 +771,7 @@ nv30_vertprog_validate(struct nv30_context *nv30)
                }
 
                if (constbuf) {
-                       ws->buffer_unmap(ws, constbuf);
+                       ws->_buffer_unmap(ws, constbuf);
                }
        }
 
index 8e56cdc2fe0b9a3ba240cc50d474779479930404..3d5332a80b5e3e336fc5d26b8348f30f805a0bc4 100644 (file)
@@ -241,13 +241,13 @@ nv40_draw_elements_swtnl(struct pipe_context *pipe,
        nv40_state_emit(nv40);
 
        for (i = 0; i < nv40->vtxbuf_nr; i++) {
-               map = ws->buffer_map(ws, nv40->vtxbuf[i].buffer,
-                                    PIPE_BUFFER_USAGE_CPU_READ);
+               map = ws->_buffer_map(ws, nv40->vtxbuf[i].buffer,
+                                      PIPE_BUFFER_USAGE_CPU_READ);
                draw_set_mapped_vertex_buffer(nv40->draw, i, map);
        }
 
        if (idxbuf) {
-               map = ws->buffer_map(ws, idxbuf, PIPE_BUFFER_USAGE_CPU_READ);
+               map = ws->_buffer_map(ws, idxbuf, PIPE_BUFFER_USAGE_CPU_READ);
                draw_set_mapped_element_buffer(nv40->draw, idxbuf_size, map);
        } else {
                draw_set_mapped_element_buffer(nv40->draw, 0, NULL);
@@ -256,7 +256,7 @@ nv40_draw_elements_swtnl(struct pipe_context *pipe,
        if (nv40->constbuf[PIPE_SHADER_VERTEX]) {
                const unsigned nr = nv40->constbuf_nr[PIPE_SHADER_VERTEX];
 
-               map = ws->buffer_map(ws, nv40->constbuf[PIPE_SHADER_VERTEX],
+               map = ws->_buffer_map(ws, nv40->constbuf[PIPE_SHADER_VERTEX],
                                     PIPE_BUFFER_USAGE_CPU_READ);
                draw_set_mapped_constant_buffer(nv40->draw, map, nr);
        }
@@ -264,13 +264,13 @@ nv40_draw_elements_swtnl(struct pipe_context *pipe,
        draw_arrays(nv40->draw, mode, start, count);
 
        for (i = 0; i < nv40->vtxbuf_nr; i++)
-               ws->buffer_unmap(ws, nv40->vtxbuf[i].buffer);
+               ws->_buffer_unmap(ws, nv40->vtxbuf[i].buffer);
 
        if (idxbuf)
-               ws->buffer_unmap(ws, idxbuf);
+               ws->_buffer_unmap(ws, idxbuf);
 
        if (nv40->constbuf[PIPE_SHADER_VERTEX])
-               ws->buffer_unmap(ws, nv40->constbuf[PIPE_SHADER_VERTEX]);
+               ws->_buffer_unmap(ws, nv40->constbuf[PIPE_SHADER_VERTEX]);
 
        draw_flush(nv40->draw);
        pipe->flush(pipe, 0, NULL);
index 91dcbebda0d03723efbb6a4167b91e9a75452cf1..5a127d9c7b6015e1c8822676565b881978491ab6 100644 (file)
@@ -886,7 +886,7 @@ nv40_fragprog_upload(struct nv40_context *nv40,
        uint32_t *map;
        int i;
 
-       map = ws->buffer_map(ws, fp->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
+       map = ws->_buffer_map(ws, fp->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
 
 #if 0
        for (i = 0; i < fp->insn_len; i++) {
@@ -908,7 +908,7 @@ nv40_fragprog_upload(struct nv40_context *nv40,
                }
        }
 
-       ws->buffer_unmap(ws, fp->buffer);
+       ws->_buffer_unmap(ws, fp->buffer);
 }
 
 static boolean
@@ -932,7 +932,7 @@ nv40_fragprog_validate(struct nv40_context *nv40)
                return FALSE;
        }
 
-       fp->buffer = ws->buffer_create(ws, 0x100, 0, fp->insn_len * 4);
+       fp->buffer = ws->_buffer_create(ws, 0x100, 0, fp->insn_len * 4);
        nv40_fragprog_upload(nv40, fp);
 
        so = so_new(4, 1);
@@ -948,7 +948,7 @@ update_constants:
        if (fp->nr_consts) {
                float *map;
                
-               map = ws->buffer_map(ws, constbuf, PIPE_BUFFER_USAGE_CPU_READ);
+               map = ws->_buffer_map(ws, constbuf, PIPE_BUFFER_USAGE_CPU_READ);
                for (i = 0; i < fp->nr_consts; i++) {
                        struct nv40_fragment_program_data *fpd = &fp->consts[i];
                        uint32_t *p = &fp->insn[fpd->offset];
@@ -959,7 +959,7 @@ update_constants:
                        memcpy(p, cb, 4 * sizeof(float));
                        new_consts = TRUE;
                }
-               ws->buffer_unmap(ws, constbuf);
+               ws->_buffer_unmap(ws, constbuf);
 
                if (new_consts)
                        nv40_fragprog_upload(nv40, fp);
index ba912ddcbbf9f4728bf0398d5c5e2bee141e3ee9..6ed0d39edff6f6c7c3847452bdf3c69fbdef1532 100644 (file)
@@ -97,7 +97,7 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
 
        nv40_miptree_layout(mt);
 
-       mt->buffer = ws->buffer_create(ws, 256, buf_usage, mt->total_size);
+       mt->buffer = ws->_buffer_create(ws, 256, buf_usage, mt->total_size);
        if (!mt->buffer) {
                FREE(mt);
                return NULL;
index ab128fecda7bedda6ff919508b6c8055febf2a97..20662fd3ffbdd5def587e497369f38413ba856f3 100644 (file)
@@ -170,7 +170,7 @@ nv40_surface_map(struct pipe_screen *screen, struct pipe_surface *surface,
 
        assert(surface_to_map);
 
-       map = ws->buffer_map(ws, surface_to_map->buffer, flags);
+       map = ws->_buffer_map(ws, surface_to_map->buffer, flags);
        if (!map)
                return NULL;
 
@@ -198,7 +198,7 @@ nv40_surface_unmap(struct pipe_screen *screen, struct pipe_surface *surface)
 
        assert(surface_to_unmap);
 
-       ws->buffer_unmap(ws, surface_to_unmap->buffer);
+       ws->_buffer_unmap(ws, surface_to_unmap->buffer);
 
        if (surface_to_unmap != surface) {
                struct nv40_screen *nvscreen = nv40_screen(screen);
index 8f1834628f7a010dfc234283b1355a97ce5efef2..f20183ddd4dfd3f3c4154a6b29b9d246c3ec6f04 100644 (file)
@@ -116,7 +116,7 @@ nv40_vbo_static_attrib(struct nv40_context *nv40, struct nouveau_stateobj *so,
        if (nv40_vbo_format_to_hw(ve->src_format, &type, &ncomp))
                return FALSE;
 
-       map  = ws->buffer_map(ws, vb->buffer, PIPE_BUFFER_USAGE_CPU_READ);
+       map  = ws->_buffer_map(ws, vb->buffer, PIPE_BUFFER_USAGE_CPU_READ);
        map += vb->buffer_offset + ve->src_offset;
 
        switch (type) {
@@ -148,17 +148,17 @@ nv40_vbo_static_attrib(struct nv40_context *nv40, struct nouveau_stateobj *so,
                        so_data  (so, fui(v[0]));
                        break;
                default:
-                       ws->buffer_unmap(ws, vb->buffer);
+                       ws->_buffer_unmap(ws, vb->buffer);
                        return FALSE;
                }
        }
                break;
        default:
-               ws->buffer_unmap(ws, vb->buffer);
+               ws->_buffer_unmap(ws, vb->buffer);
                return FALSE;
        }
 
-       ws->buffer_unmap(ws, vb->buffer);
+       ws->_buffer_unmap(ws, vb->buffer);
 
        return TRUE;
 }
@@ -370,7 +370,7 @@ nv40_draw_elements_inline(struct pipe_context *pipe,
        struct pipe_winsys *ws = pipe->winsys;
        void *map;
 
-       map = ws->buffer_map(ws, ib, PIPE_BUFFER_USAGE_CPU_READ);
+       map = ws->_buffer_map(ws, ib, PIPE_BUFFER_USAGE_CPU_READ);
        if (!ib) {
                NOUVEAU_ERR("failed mapping ib\n");
                return FALSE;
@@ -391,7 +391,7 @@ nv40_draw_elements_inline(struct pipe_context *pipe,
                break;
        }
 
-       ws->buffer_unmap(ws, ib);
+       ws->_buffer_unmap(ws, ib);
        return TRUE;
 }
 
index 1392fe956f7f6453ca726b5406ee27daa8e4d30d..7a82bb0f5e005ceb806484ff8e6759d192048ae4 100644 (file)
@@ -980,7 +980,7 @@ check_gpu_resources:
                float *map = NULL;
 
                if (constbuf) {
-                       map = ws->buffer_map(ws, constbuf,
+                       map = ws->_buffer_map(ws, constbuf,
                                             PIPE_BUFFER_USAGE_CPU_READ);
                }
 
@@ -1002,7 +1002,7 @@ check_gpu_resources:
                }
 
                if (constbuf)
-                       ws->buffer_unmap(ws, constbuf);
+                       ws->_buffer_unmap(ws, constbuf);
        }
 
        /* Upload vtxprog */
index 7770fcc3f2aaa904f6feb129544317ecd71650a9..3965dad5adebe3436bdc8ef3704d283dca4b3f05 100644 (file)
@@ -88,14 +88,14 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
                        size  = align(size, 64);
                        size *= align(pt->height[l], 8) * pt->block.size;
 
-                       lvl->image[i] = ws->buffer_create(ws, 256, 0, size);
+                       lvl->image[i] = ws->_buffer_create(ws, 256, 0, size);
                        lvl->image_offset[i] = mt->total_size;
 
                        mt->total_size += size;
                }
        }
 
-       mt->buffer = ws->buffer_create(ws, 256, usage, mt->total_size);
+       mt->buffer = ws->_buffer_create(ws, 256, usage, mt->total_size);
        if (!mt->buffer) {
                FREE(mt);
                return NULL;
index 7686f746eb243f6786a626fbd259c56398b88c77..73867cf67578b9f5b20fa1f367052137230fa4f8 100644 (file)
@@ -1581,11 +1581,11 @@ nv50_program_validate_data(struct nv50_context *nv50, struct nv50_program *p)
        }
 
        if (p->param_nr) {
-               float *map = ws->buffer_map(ws, nv50->constbuf[p->type],
+               float *map = ws->_buffer_map(ws, nv50->constbuf[p->type],
                                            PIPE_BUFFER_USAGE_CPU_READ);
                nv50_program_upload_data(nv50, map, p->data->start,
                                         p->param_nr);
-               ws->buffer_unmap(ws, nv50->constbuf[p->type]);
+               ws->_buffer_unmap(ws, nv50->constbuf[p->type]);
        }
 
        if (p->immd_nr) {
@@ -1606,7 +1606,7 @@ nv50_program_validate_code(struct nv50_context *nv50, struct nv50_program *p)
        boolean upload = FALSE;
 
        if (!p->buffer) {
-               p->buffer = ws->buffer_create(ws, 0x100, 0, p->exec_size * 4);
+               p->buffer = ws->_buffer_create(ws, 0x100, 0, p->exec_size * 4);
                upload = TRUE;
        }
 
index b923c820ebafab4f9d8217f1eb340de77e028cf7..b0fb346ba1a21de878d0ae36e0492143bed41a14 100644 (file)
@@ -47,7 +47,7 @@ nv50_query_create(struct pipe_context *pipe, unsigned type)
        assert (q->type == PIPE_QUERY_OCCLUSION_COUNTER);
        q->type = type;
 
-       q->buffer = ws->buffer_create(ws, 256, 0, 16);
+       q->buffer = ws->_buffer_create(ws, 256, 0, 16);
        if (!q->buffer) {
                FREE(q);
                return NULL;
@@ -62,7 +62,7 @@ nv50_query_destroy(struct pipe_context *pipe, struct pipe_query *pq)
        struct nv50_query *q = nv50_query(pq);
 
        if (q) {
-               pipe_buffer_reference(pipe, &q->buffer, NULL);
+               pipe_buffer_reference(pipe->screen, &q->buffer, NULL);
                FREE(q);
        }
 }
@@ -107,11 +107,11 @@ nv50_query_result(struct pipe_context *pipe, struct pipe_query *pq,
         */
 
        if (!q->ready) {
-               uint32_t *map = ws->buffer_map(ws, q->buffer,
+               uint32_t *map = ws->_buffer_map(ws, q->buffer,
                                               PIPE_BUFFER_USAGE_CPU_READ);
                q->result = map[1];
                q->ready = TRUE;
-               ws->buffer_unmap(ws, q->buffer);
+               ws->_buffer_unmap(ws, q->buffer);
        }
 
        *result = q->result;
index ef46233f83985301ef359a5357e0d8e0d0161f27..3abacfc8d544b4de6fc01c106ef84e2a7aeed5b5 100644 (file)
@@ -242,7 +242,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
        so_data  (so, 8);
 
        /* Shared constant buffer */
-       screen->constbuf = ws->buffer_create(ws, 0, 0, 128 * 4 * 4);
+       screen->constbuf = ws->_buffer_create(ws, 0, 0, 128 * 4 * 4);
        if (nvws->res_init(&screen->vp_data_heap, 0, 128)) {
                NOUVEAU_ERR("Error initialising constant buffer\n");
                nv50_screen_destroy(&screen->pipe);
@@ -261,7 +261,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
         * blocks.  At some point we *may* want to go the NVIDIA way of doing
         * things?
         */
-       screen->tic = ws->buffer_create(ws, 0, 0, 32 * 8 * 4);
+       screen->tic = ws->_buffer_create(ws, 0, 0, 32 * 8 * 4);
        so_method(so, screen->tesla, 0x1280, 3);
        so_reloc (so, screen->tic, 0, NOUVEAU_BO_VRAM |
                  NOUVEAU_BO_RD | NOUVEAU_BO_HIGH, 0, 0);
@@ -275,7 +275,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
                  NOUVEAU_BO_RD | NOUVEAU_BO_LOW, 0, 0);
        so_data  (so, 0x00000800);
 
-       screen->tsc = ws->buffer_create(ws, 0, 0, 32 * 8 * 4);
+       screen->tsc = ws->_buffer_create(ws, 0, 0, 32 * 8 * 4);
        so_method(so, screen->tesla, 0x1280, 3);
        so_reloc (so, screen->tsc, 0, NOUVEAU_BO_VRAM |
                  NOUVEAU_BO_RD | NOUVEAU_BO_HIGH, 0, 0);
index 3f45a2fe18644b6af2eba5f784c3a1604fd53e87..743eb6e257834207fc481b799be66caf306d0df6 100644 (file)
@@ -65,7 +65,7 @@ nv50_surface_map(struct pipe_screen *screen, struct pipe_surface *ps,
 {
        struct pipe_winsys *ws = screen->winsys;
 
-       return ws->buffer_map(ws, ps->buffer, flags);
+       return ws->_buffer_map(ws, ps->buffer, flags);
 }
 
 static void
@@ -73,7 +73,7 @@ nv50_surface_unmap(struct pipe_screen *pscreen, struct pipe_surface *ps)
 {
        struct pipe_winsys *ws = pscreen->winsys;
 
-       ws->buffer_unmap(ws, ps->buffer);
+       ws->_buffer_unmap(ws, ps->buffer);
 }
 
 void
index c482a4c241ee0dabfec09ccca66162e3ddbad913..86471c00e03da2616d3f54498563ff48cae9aad1 100644 (file)
@@ -153,7 +153,7 @@ nv50_draw_elements(struct pipe_context *pipe,
 {
        struct nv50_context *nv50 = nv50_context(pipe);
        struct pipe_winsys *ws = pipe->winsys;
-       void *map = ws->buffer_map(ws, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ);
+       void *map = ws->_buffer_map(ws, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ);
 
        nv50_state_validate(nv50);
 
index d8a5631488f9029254ba5933ab5a74552c487149..c2d882a819740e2382884da1da348236958eb6da 100644 (file)
@@ -87,7 +87,7 @@ softpipe_unmap_surfaces(struct softpipe_context *sp)
 static void softpipe_destroy( struct pipe_context *pipe )
 {
    struct softpipe_context *softpipe = softpipe_context( pipe );
-   struct pipe_winsys *ws = pipe->winsys;
+   struct pipe_screen *screen = pipe->screen;
    uint i;
 
    if (softpipe->draw)
@@ -116,7 +116,7 @@ static void softpipe_destroy( struct pipe_context *pipe )
 
    for (i = 0; i < Elements(softpipe->constants); i++) {
       if (softpipe->constants[i].buffer) {
-         winsys_buffer_reference(ws, &softpipe->constants[i].buffer, NULL);
+         pipe_buffer_reference(screen, &softpipe->constants[i].buffer, NULL);
       }
    }
 
index ed3e8f95ae7b3f80ed8248552a6e99f0421e3158..8d58b1ed163aa7f7424c31138c67d6fffd839148 100644 (file)
@@ -50,7 +50,7 @@ softpipe_map_constant_buffers(struct softpipe_context *sp)
    uint i;
    for (i = 0; i < PIPE_SHADER_TYPES; i++) {
       if (sp->constants[i].buffer && sp->constants[i].buffer->size)
-         sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i].buffer,
+         sp->mapped_constants[i] = ws->_buffer_map(ws, sp->constants[i].buffer,
                                                   PIPE_BUFFER_USAGE_CPU_READ);
    }
 
@@ -74,7 +74,7 @@ softpipe_unmap_constant_buffers(struct softpipe_context *sp)
 
    for (i = 0; i < 2; i++) {
       if (sp->constants[i].buffer && sp->constants[i].buffer->size)
-         ws->buffer_unmap(ws, sp->constants[i].buffer);
+         ws->_buffer_unmap(ws, sp->constants[i].buffer);
       sp->mapped_constants[i] = NULL;
    }
 }
index 15815160edf4107a252b22c94dc03497aeea032a..43b134354f32a10b2649952ed2559152e852777c 100644 (file)
@@ -146,13 +146,13 @@ softpipe_set_constant_buffer(struct pipe_context *pipe,
                              const struct pipe_constant_buffer *buf)
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
-   struct pipe_winsys *ws = pipe->winsys;
+   struct pipe_screen *screen = pipe->screen;
 
    assert(shader < PIPE_SHADER_TYPES);
    assert(index == 0);
 
    /* note: reference counting */
-   winsys_buffer_reference(ws,
+   pipe_buffer_reference(screen,
                         &softpipe->constants[shader].buffer,
                         buf ? buf->buffer : NULL);
 
index faf9e871f932939c99606069c1c36227c907a139..078925ca45afb1e0239780ffd885dbbce2ddd3f9 100644 (file)
@@ -87,9 +87,9 @@ softpipe_texture_layout(struct pipe_screen *screen,
       depth = minify(depth);
    }
 
-   spt->buffer = ws->buffer_create(ws, 32,
-                                   PIPE_BUFFER_USAGE_PIXEL,
-                                   buffer_size);
+   spt->buffer = ws->_buffer_create(ws, 32,
+                                    PIPE_BUFFER_USAGE_PIXEL,
+                                    buffer_size);
 
    return spt->buffer != NULL;
 }
@@ -105,12 +105,12 @@ softpipe_displaytarget_layout(struct pipe_screen *screen,
    spt->base.nblocksx[0] = pf_get_nblocksx(&spt->base.block, spt->base.width[0]);  
    spt->base.nblocksy[0] = pf_get_nblocksy(&spt->base.block, spt->base.height[0]);  
 
-   spt->buffer = ws->surface_buffer_create( ws, 
-                                           spt->base.width[0], 
-                                           spt->base.height[0],
-                                           spt->base.format,
-                                           usage,
-                                           &spt->stride[0]);
+   spt->buffer = ws->_surface_buffer_create( ws, 
+                                             spt->base.width[0], 
+                                             spt->base.height[0],
+                                             spt->base.format,
+                                             usage,
+                                             &spt->stride[0]);
 
    return spt->buffer != NULL;
 }
index c4148fe81041d9d793511d60ce081a6e94eec7e3..9a19d4d077afc17db6927bb0527386052b1a4aa1 100644 (file)
@@ -118,7 +118,7 @@ trace_winsys_surface_buffer_create(struct pipe_winsys *_winsys,
    trace_dump_arg(format, format);
    trace_dump_arg(uint, usage);
 
-   result = winsys->surface_buffer_create(winsys,
+   result = winsys->_surface_buffer_create(winsys,
                                           width, height,
                                           format,
                                           usage,
@@ -153,7 +153,7 @@ trace_winsys_buffer_create(struct pipe_winsys *_winsys,
    trace_dump_arg(uint, usage);
    trace_dump_arg(uint, size);
 
-   buffer = winsys->buffer_create(winsys, alignment, usage, size);
+   buffer = winsys->_buffer_create(winsys, alignment, usage, size);
    
    trace_dump_ret(ptr, buffer);
    
@@ -162,10 +162,10 @@ trace_winsys_buffer_create(struct pipe_winsys *_winsys,
    /* Zero the buffer to avoid dumping uninitialized memory */
    if(buffer->usage & PIPE_BUFFER_USAGE_CPU_WRITE) {
       void *map;
-      map = winsys->buffer_map(winsys, buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
+      map = winsys->_buffer_map(winsys, buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
       if(map) {
          memset(map, 0, buffer->size);
-         winsys->buffer_unmap(winsys, buffer);
+         winsys->_buffer_unmap(winsys, buffer);
       }
    }
    
@@ -190,7 +190,7 @@ trace_winsys_user_buffer_create(struct pipe_winsys *_winsys,
    trace_dump_arg_end();
    trace_dump_arg(uint, size);
 
-   result = winsys->user_buffer_create(winsys, data, size);
+   result = winsys->_user_buffer_create(winsys, data, size);
    
    trace_dump_ret(ptr, result);
    
@@ -216,7 +216,7 @@ trace_winsys_user_buffer_update(struct pipe_winsys *_winsys,
    const void *map;
    
    if(buffer && buffer->usage & TRACE_BUFFER_USAGE_USER) {
-      map = winsys->buffer_map(winsys, buffer, PIPE_BUFFER_USAGE_CPU_READ);
+      map = winsys->_buffer_map(winsys, buffer, PIPE_BUFFER_USAGE_CPU_READ);
       if(map) {
          trace_dump_call_begin("pipe_winsys", "buffer_write");
          
@@ -234,7 +234,7 @@ trace_winsys_user_buffer_update(struct pipe_winsys *_winsys,
       
          trace_dump_call_end();
          
-         winsys->buffer_unmap(winsys, buffer);
+         winsys->_buffer_unmap(winsys, buffer);
       }
    }
 }
@@ -249,7 +249,7 @@ trace_winsys_buffer_map(struct pipe_winsys *_winsys,
    struct pipe_winsys *winsys = tr_ws->winsys;
    void *map;
    
-   map = winsys->buffer_map(winsys, buffer, usage);
+   map = winsys->_buffer_map(winsys, buffer, usage);
    if(map) {
       if(usage & PIPE_BUFFER_USAGE_CPU_WRITE) {
          assert(!hash_table_get(tr_ws->buffer_maps, buffer));
@@ -290,7 +290,7 @@ trace_winsys_buffer_unmap(struct pipe_winsys *_winsys,
       hash_table_remove(tr_ws->buffer_maps, buffer);
    }
    
-   winsys->buffer_unmap(winsys, buffer);
+   winsys->_buffer_unmap(winsys, buffer);
 }
 
 
@@ -306,7 +306,7 @@ trace_winsys_buffer_destroy(struct pipe_winsys *_winsys,
    trace_dump_arg(ptr, winsys);
    trace_dump_arg(ptr, buffer);
 
-   winsys->buffer_destroy(winsys, buffer);
+   winsys->_buffer_destroy(winsys, buffer);
    
    trace_dump_call_end();
 }
@@ -420,12 +420,12 @@ trace_winsys_create(struct pipe_winsys *winsys)
    tr_ws->base.destroy = trace_winsys_destroy;
    tr_ws->base.get_name = trace_winsys_get_name;
    tr_ws->base.flush_frontbuffer = trace_winsys_flush_frontbuffer;
-   tr_ws->base.surface_buffer_create = trace_winsys_surface_buffer_create;
-   tr_ws->base.buffer_create = trace_winsys_buffer_create;
-   tr_ws->base.user_buffer_create = trace_winsys_user_buffer_create;
-   tr_ws->base.buffer_map = trace_winsys_buffer_map;
-   tr_ws->base.buffer_unmap = trace_winsys_buffer_unmap;
-   tr_ws->base.buffer_destroy = trace_winsys_buffer_destroy;
+   tr_ws->base._surface_buffer_create = trace_winsys_surface_buffer_create;
+   tr_ws->base._buffer_create = trace_winsys_buffer_create;
+   tr_ws->base._user_buffer_create = trace_winsys_user_buffer_create;
+   tr_ws->base._buffer_map = trace_winsys_buffer_map;
+   tr_ws->base._buffer_unmap = trace_winsys_buffer_unmap;
+   tr_ws->base._buffer_destroy = trace_winsys_buffer_destroy;
    tr_ws->base.fence_reference = trace_winsys_fence_reference;
    tr_ws->base.fence_signalled = trace_winsys_fence_signalled;
    tr_ws->base.fence_finish = trace_winsys_fence_finish;
index 73783926169224d60c9eeb3d9e841411448f837c..da7334bb67a0d84eba1d94f82c377c84f2481bfb 100644 (file)
@@ -89,29 +89,6 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
 }
 
 
-/* XXX: thread safety issues!
- */
-static INLINE void
-winsys_buffer_reference(struct pipe_winsys *winsys,
-                     struct pipe_buffer **ptr,
-                     struct pipe_buffer *buf)
-{
-   if (buf) {
-      assert(buf->refcount);
-      buf->refcount++;
-   }
-
-   if (*ptr) {
-      assert((*ptr)->refcount);
-      if(--(*ptr)->refcount == 0)
-         winsys->buffer_destroy( winsys, *ptr );
-   }
-
-   *ptr = buf;
-}
-
-
-
 /**
  * \sa pipe_surface_reference
  */
@@ -159,13 +136,19 @@ static INLINE struct pipe_buffer *
 pipe_buffer_create( struct pipe_screen *screen,
                     unsigned alignment, unsigned usage, unsigned size )
 {
-   return screen->winsys->buffer_create(screen->winsys, alignment, usage, size);
+   if (screen->buffer_create)
+      return screen->buffer_create(screen, alignment, usage, size);
+   else
+      return screen->winsys->_buffer_create(screen->winsys, alignment, usage, size);
 }
 
 static INLINE struct pipe_buffer *
 pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size )
 {
-   return screen->winsys->user_buffer_create(screen->winsys, ptr, size);
+   if (screen->user_buffer_create)
+      return screen->user_buffer_create(screen, ptr, size);
+   else
+      return screen->winsys->_user_buffer_create(screen->winsys, ptr, size);
 }
 
 static INLINE void *
@@ -173,25 +156,45 @@ pipe_buffer_map(struct pipe_screen *screen,
                 struct pipe_buffer *buf,
                 unsigned usage)
 {
-   return screen->winsys->buffer_map(screen->winsys, buf, usage);
+   if (screen->buffer_map)
+      return screen->buffer_map(screen, buf, usage);
+   else
+      return screen->winsys->_buffer_map(screen->winsys, buf, usage);
 }
 
 static INLINE void
 pipe_buffer_unmap(struct pipe_screen *screen,
                   struct pipe_buffer *buf)
 {
-   screen->winsys->buffer_unmap(screen->winsys, buf);
+   if (screen->buffer_unmap)
+      screen->buffer_unmap(screen, buf);
+   else
+      screen->winsys->_buffer_unmap(screen->winsys, buf);
 }
 
-/* XXX when we're using this everywhere, get rid of
- * winsys_buffer_reference() above.
+/* XXX: thread safety issues!
  */
 static INLINE void
 pipe_buffer_reference(struct pipe_screen *screen,
                      struct pipe_buffer **ptr,
                      struct pipe_buffer *buf)
 {
-   winsys_buffer_reference(screen->winsys, ptr, buf);
+   if (buf) {
+      assert(buf->refcount);
+      buf->refcount++;
+   }
+
+   if (*ptr) {
+      assert((*ptr)->refcount);
+      if(--(*ptr)->refcount == 0) {
+         if (screen->buffer_destroy)
+            screen->buffer_destroy( screen, *ptr );
+         else
+            screen->winsys->_buffer_destroy( screen->winsys, *ptr );
+      }
+   }
+
+   *ptr = buf;
 }
 
 
index 492667c93ac1fff2179af2ef9642ffd07c1cb389..b072484a84cea5a7d9d3c7a04605bc176595dc45 100644 (file)
@@ -128,7 +128,74 @@ struct pipe_screen {
 
    void (*surface_unmap)( struct pipe_screen *,
                           struct pipe_surface *surface );
-   
+
+
+   /**
+    * Buffer management. Buffer attributes are mostly fixed over its lifetime.
+    *
+    * 
+    */
+   struct pipe_buffer *(*buffer_create)( struct pipe_screen *screen,
+                                         unsigned alignment,
+                                         unsigned usage,
+                                         unsigned size );
+
+   /**
+    * Create a buffer that wraps user-space data.
+    *
+    * Effectively this schedules a delayed call to buffer_create
+    * followed by an upload of the data at *some point in the future*,
+    * or perhaps never.  Basically the allocate/upload is delayed
+    * until the buffer is actually passed to hardware.
+    *
+    * The intention is to provide a quick way to turn regular data
+    * into a buffer, and secondly to avoid a copy operation if that
+    * data subsequently turns out to be only accessed by the CPU.
+    *
+    * Common example is OpenGL vertex buffers that are subsequently
+    * processed either by software TNL in the driver or by passing to
+    * hardware.
+    *
+    * XXX: What happens if the delayed call to buffer_create() fails?
+    *
+    * Note that ptr may be accessed at any time upto the time when the
+    * buffer is destroyed, so the data must not be freed before then.
+    */
+   struct pipe_buffer *(*user_buffer_create)(struct pipe_screen *screen,
+                                             void *ptr,
+                                             unsigned bytes);
+
+   /**
+    * Allocate storage for a display target surface.
+    *
+    * Often surfaces which are meant to be blitted to the front screen (i.e.,
+    * display targets) must be allocated with special characteristics, memory
+    * pools, or obtained directly from the windowing system.
+    *
+    * This callback is invoked by the pipe_screenwhen creating a texture marked
+    * with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag  to get the underlying
+    * buffer storage.
+    */
+   struct pipe_buffer *(*surface_buffer_create)(struct pipe_screen *screen,
+                                               unsigned width, unsigned height,
+                                               enum pipe_format format,
+                                               unsigned usage,
+                                               unsigned *stride);
+
+
+   /**
+    * Map the entire data store of a buffer object into the client's address.
+    * flags is bitmask of PIPE_BUFFER_USAGE_CPU_READ/WRITE flags.
+    */
+   void *(*buffer_map)( struct pipe_screen *screen,
+                       struct pipe_buffer *buf,
+                       unsigned usage );
+
+   void (*buffer_unmap)( struct pipe_screen *screen,
+                        struct pipe_buffer *buf );
+
+   void (*buffer_destroy)( struct pipe_screen *screen,
+                          struct pipe_buffer *buf );
 };
 
 
index 3ae83e8105d30b3191f28c6be28a4ab721719230..bda1907cc16ad753885b116fe5d4b1dd858c2dbf 100644 (file)
@@ -90,7 +90,7 @@ struct pipe_winsys
     * alignment indicates the client's alignment requirements, eg for
     * SSE instructions.
     */
-   struct pipe_buffer *(*buffer_create)( struct pipe_winsys *ws, 
+   struct pipe_buffer *(*_buffer_create)( struct pipe_winsys *ws, 
                                          unsigned alignment, 
                                          unsigned usage,
                                          unsigned size );
@@ -116,7 +116,7 @@ struct pipe_winsys
     * Note that ptr may be accessed at any time upto the time when the
     * buffer is destroyed, so the data must not be freed before then.
     */
-   struct pipe_buffer *(*user_buffer_create)(struct pipe_winsys *ws, 
+   struct pipe_buffer *(*_user_buffer_create)(struct pipe_winsys *ws, 
                                                     void *ptr,
                                                     unsigned bytes);
 
@@ -131,7 +131,7 @@ struct pipe_winsys
     * with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag  to get the underlying 
     * buffer storage.
     */
-   struct pipe_buffer *(*surface_buffer_create)(struct pipe_winsys *ws,
+   struct pipe_buffer *(*_surface_buffer_create)(struct pipe_winsys *ws,
                                                unsigned width, unsigned height,
                                                enum pipe_format format,
                                                unsigned usage,
@@ -142,14 +142,14 @@ struct pipe_winsys
     * Map the entire data store of a buffer object into the client's address.
     * flags is bitmask of PIPE_BUFFER_USAGE_CPU_READ/WRITE flags. 
     */
-   void *(*buffer_map)( struct pipe_winsys *ws, 
+   void *(*_buffer_map)( struct pipe_winsys *ws, 
                        struct pipe_buffer *buf,
                        unsigned usage );
    
-   void (*buffer_unmap)( struct pipe_winsys *ws, 
+   void (*_buffer_unmap)( struct pipe_winsys *ws, 
                         struct pipe_buffer *buf );
 
-   void (*buffer_destroy)( struct pipe_winsys *ws,
+   void (*_buffer_destroy)( struct pipe_winsys *ws,
                           struct pipe_buffer *buf );