Mesa (master): cell: update cell driver after gallium reference count changes

Brian Paul brianp at kemper.freedesktop.org
Wed Mar 4 16:34:53 UTC 2009


Module: Mesa
Branch: master
Commit: ca06c0c16d09d58f96736aa095e1a592862a9427
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca06c0c16d09d58f96736aa095e1a592862a9427

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Mar  4 09:34:46 2009 -0700

cell: update cell driver after gallium reference count changes

---

 src/gallium/drivers/cell/ppu/cell_state_shader.c |    4 +---
 src/gallium/drivers/cell/ppu/cell_texture.c      |    5 ++---
 src/gallium/winsys/xlib/xlib_cell.c              |   15 +++++++--------
 3 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c
index bf517ea..6568c78 100644
--- a/src/gallium/drivers/cell/ppu/cell_state_shader.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c
@@ -193,9 +193,7 @@ cell_set_constant_buffer(struct pipe_context *pipe,
    draw_flush(cell->draw);
 
    /* note: reference counting */
-   pipe_buffer_reference(pipe->screen,
-                         &cell->constants[shader].buffer,
-                         buf->buffer);
+   pipe_buffer_reference(&cell->constants[shader].buffer, buf->buffer);
 
    if (shader == PIPE_SHADER_VERTEX)
       cell->dirty |= CELL_NEW_VS_CONSTANTS;
diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c
index bc6afa9..e265944 100644
--- a/src/gallium/drivers/cell/ppu/cell_texture.c
+++ b/src/gallium/drivers/cell/ppu/cell_texture.c
@@ -129,7 +129,7 @@ cell_texture_destroy(struct pipe_texture *pt)
    struct cell_texture *ct = cell_texture(pt);
 
    if (ct->mapped) {
-      pipe_buffer_unmap(screen, ct->buffer);
+      pipe_buffer_unmap(ct->buffer->screen, ct->buffer);
       ct->mapped = NULL;
    }
 
@@ -308,7 +308,7 @@ cell_get_tex_surface(struct pipe_screen *screen,
 
 
 static void 
-cell_tex_surface_destroy(struct pipe_surface *s)
+cell_tex_surface_destroy(struct pipe_surface *surf)
 {
    pipe_texture_reference(&surf->texture, NULL);
    FREE(surf);
@@ -336,7 +336,6 @@ cell_get_tex_transfer(struct pipe_screen *screen,
    ctrans = CALLOC_STRUCT(cell_transfer);
    if (ctrans) {
       struct pipe_transfer *pt = &ctrans->base;
-      pipe_reference_init(&pt->reference, 1);
       pipe_texture_reference(&pt->texture, texture);
       pt->format = texture->format;
       pt->block = texture->block;
diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c
index a5dbdf3..13e609f 100644
--- a/src/gallium/winsys/xlib/xlib_cell.c
+++ b/src/gallium/winsys/xlib/xlib_cell.c
@@ -107,22 +107,21 @@ xm_buffer_unmap(struct pipe_winsys *pws, struct pipe_buffer *buf)
 }
 
 static void
-xm_buffer_destroy(struct pipe_winsys *pws,
+xm_buffer_destroy(/*struct pipe_winsys *pws,*/
                   struct pipe_buffer *buf)
 {
    struct xm_buffer *oldBuf = xm_buffer(buf);
 
-   if (oldBuf->data) {
-      {
+   if (oldBuf) {
+      if (oldBuf->data) {
          if (!oldBuf->userBuffer) {
             align_free(oldBuf->data);
          }
-      }
 
-      oldBuf->data = NULL;
+         oldBuf->data = NULL;
+      }
+      free(oldBuf);
    }
-
-   free(oldBuf);
 }
 
 
@@ -371,7 +370,7 @@ xlib_create_cell_winsys( void )
 
 
 static struct pipe_screen *
-xlib_create_cell_screen( struct pipe_winsys *pws )
+xlib_create_cell_screen( void )
 {
    struct pipe_winsys *winsys;
    struct pipe_screen *screen;




More information about the mesa-commit mailing list