gallium: Unify reference counting.
authorMichel Dänzer <daenzer@vmware.com>
Wed, 4 Mar 2009 10:58:48 +0000 (11:58 +0100)
committerMichel Dänzer <daenzer@vmware.com>
Wed, 4 Mar 2009 10:58:48 +0000 (11:58 +0100)
commit5e27cd46c04a9e7b5904cc014bffd0f4daae31fe
treea57289f14d69f1977dfaee592af908052d726b8c
parent60041203d5847de8ab71842a6ce5d33d96cc4930
gallium: Unify reference counting.

The core reference counting code is centralized in p_refcnt.h.

This has some consequences related to struct pipe_buffer:

* The screen member of struct pipe_buffer must be initialized, or
  pipe_buffer_reference() will crash trying to destroy a buffer with reference
  count 0. u_simple_screen takes care of this, but I may have missed some of
  the drivers not using it.
* Except for rare exceptions deep in winsys code, buffers must always be
  allocated via pipe_buffer_create() or via screen->*buffer_create() rather
  than via winsys->*buffer_create().
102 files changed:
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_pstipple.c
src/gallium/auxiliary/pipebuffer/pb_buffer.h
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
src/gallium/auxiliary/sct/sct.c
src/gallium/auxiliary/util/u_blit.c
src/gallium/auxiliary/util/u_debug.c
src/gallium/auxiliary/util/u_draw_quad.c
src/gallium/auxiliary/util/u_gen_mipmap.c
src/gallium/auxiliary/util/u_rect.c
src/gallium/auxiliary/util/u_simple_screen.c
src/gallium/auxiliary/util/u_timed_winsys.c
src/gallium/drivers/cell/ppu/cell_fence.c
src/gallium/drivers/cell/ppu/cell_texture.c
src/gallium/drivers/failover/fo_context.c
src/gallium/drivers/i915simple/i915_prim_vbuf.c
src/gallium/drivers/i915simple/i915_screen.c
src/gallium/drivers/i915simple/i915_texture.c
src/gallium/drivers/i965simple/brw_tex_layout.c
src/gallium/drivers/i965simple/brw_wm_surface_state.c
src/gallium/drivers/nouveau/nouveau_stateobj.h
src/gallium/drivers/nv04/nv04_miptree.c
src/gallium/drivers/nv04/nv04_transfer.c
src/gallium/drivers/nv10/nv10_miptree.c
src/gallium/drivers/nv10/nv10_prim_vbuf.c
src/gallium/drivers/nv10/nv10_transfer.c
src/gallium/drivers/nv20/nv20_miptree.c
src/gallium/drivers/nv20/nv20_prim_vbuf.c
src/gallium/drivers/nv20/nv20_transfer.c
src/gallium/drivers/nv30/nv30_fragprog.c
src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv30/nv30_transfer.c
src/gallium/drivers/nv40/nv40_fragprog.c
src/gallium/drivers/nv40/nv40_miptree.c
src/gallium/drivers/nv40/nv40_transfer.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_transfer.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_swtcl_emit.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_state_fs.c
src/gallium/drivers/softpipe/sp_texture.c
src/gallium/drivers/softpipe/sp_tile_cache.c
src/gallium/drivers/trace/tr_screen.c
src/gallium/drivers/trace/tr_state.c
src/gallium/drivers/trace/tr_texture.c
src/gallium/drivers/trace/tr_winsys.c
src/gallium/include/pipe/internal/p_winsys_screen.h
src/gallium/include/pipe/p_inlines.h
src/gallium/include/pipe/p_refcnt.h [new file with mode: 0644]
src/gallium/include/pipe/p_screen.h
src/gallium/include/pipe/p_state.h
src/gallium/state_trackers/dri2/dri_drawable.c
src/gallium/state_trackers/egl/egl_surface.c
src/gallium/state_trackers/g3dvl/vl_basic_csc.c
src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
src/gallium/state_trackers/python/st_device.c
src/gallium/state_trackers/python/st_device.h
src/gallium/state_trackers/python/st_softpipe_winsys.c
src/gallium/state_trackers/xorg/xorg_crtc.c
src/gallium/state_trackers/xorg/xorg_dri2.c
src/gallium/state_trackers/xorg/xorg_exa.c
src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c
src/gallium/winsys/drm/intel/gem/intel_be_device.c
src/gallium/winsys/drm/intel/gem/intel_be_fence.h
src/gallium/winsys/drm/nouveau/common/nouveau_context.c
src/gallium/winsys/drm/nouveau/common/nouveau_context.h
src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c
src/gallium/winsys/drm/radeon/radeon_buffer.c
src/gallium/winsys/drm/radeon/radeon_drm.c
src/gallium/winsys/egl_xlib/sw_winsys.c
src/gallium/winsys/g3dvl/xsp_winsys.c
src/gallium/winsys/gdi/gdi_softpipe_winsys.c
src/gallium/winsys/xlib/xlib_brw_screen.c
src/gallium/winsys/xlib/xlib_cell.c
src/gallium/winsys/xlib/xlib_softpipe.c
src/mesa/state_tracker/st_atom_constbuf.c
src/mesa/state_tracker/st_atom_pixeltransfer.c
src/mesa/state_tracker/st_cb_accum.c
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_bufferobjects.c
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_draw_feedback.c
src/mesa/state_tracker/st_gen_mipmap.c
src/mesa/state_tracker/st_texture.c