From f6cecbb36164b060e194709938f4376a49795b93 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Feb 2010 15:11:18 +0000 Subject: i915: Add missing includes. --- src/gallium/drivers/i915/i915_debug_fp.c | 1 + src/gallium/drivers/i915/i915_state_inlines.h | 1 + 2 files changed, 2 insertions(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/i915/i915_debug_fp.c b/src/gallium/drivers/i915/i915_debug_fp.c index f9c40d8a110..f1ffd27908f 100644 --- a/src/gallium/drivers/i915/i915_debug_fp.c +++ b/src/gallium/drivers/i915/i915_debug_fp.c @@ -29,6 +29,7 @@ #include "i915_reg.h" #include "i915_debug.h" #include "pipe/internal/p_winsys_screen.h" +#include "util/u_debug.h" static void diff --git a/src/gallium/drivers/i915/i915_state_inlines.h b/src/gallium/drivers/i915/i915_state_inlines.h index 378de8f9c48..b589117fbfe 100644 --- a/src/gallium/drivers/i915/i915_state_inlines.h +++ b/src/gallium/drivers/i915/i915_state_inlines.h @@ -30,6 +30,7 @@ #include "pipe/p_compiler.h" #include "pipe/p_defines.h" +#include "util/u_debug.h" #include "i915_reg.h" -- cgit v1.2.3 From 854627387db5c1bf3f69d56a638fab2af0c46010 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Feb 2010 15:11:34 +0000 Subject: llvmpipe: Add missing includes. --- src/gallium/drivers/llvmpipe/lp_bld_logic.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/llvmpipe/lp_bld_logic.c b/src/gallium/drivers/llvmpipe/lp_bld_logic.c index db22a8028a6..15eacb6df48 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_logic.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_logic.c @@ -34,6 +34,7 @@ #include "util/u_cpu_detect.h" +#include "util/u_debug.h" #include "lp_bld_type.h" #include "lp_bld_const.h" -- cgit v1.2.3 From 28486880ca3ec39419ccee0cb1a3bedc9ef7117c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 2 Feb 2010 14:42:17 +0000 Subject: gallium: pipe/p_inlines.h -> util/u_inlines.h --- src/gallium/auxiliary/cso_cache/cso_context.c | 1 + src/gallium/auxiliary/draw/draw_pipe_aaline.c | 1 + src/gallium/auxiliary/draw/draw_pipe_pstipple.c | 1 + src/gallium/auxiliary/pipebuffer/pb_buffer.h | 1 + src/gallium/auxiliary/tgsi/tgsi_text.c | 2 +- src/gallium/auxiliary/util/u_blit.c | 2 +- src/gallium/auxiliary/util/u_blitter.c | 2 +- src/gallium/auxiliary/util/u_debug.c | 2 +- src/gallium/auxiliary/util/u_draw_quad.c | 2 +- src/gallium/auxiliary/util/u_gen_mipmap.c | 2 +- src/gallium/auxiliary/util/u_inlines.h | 301 +++++++++++++++++++++ src/gallium/auxiliary/util/u_surface.c | 1 + src/gallium/auxiliary/util/u_tile.c | 2 +- src/gallium/auxiliary/util/u_upload_mgr.c | 2 +- src/gallium/auxiliary/vl/vl_compositor.c | 2 +- src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c | 2 +- src/gallium/drivers/cell/ppu/cell_clear.c | 2 +- src/gallium/drivers/cell/ppu/cell_draw_arrays.c | 2 +- src/gallium/drivers/cell/ppu/cell_fence.c | 2 +- src/gallium/drivers/cell/ppu/cell_pipe_state.c | 2 +- src/gallium/drivers/cell/ppu/cell_state_emit.c | 2 +- src/gallium/drivers/cell/ppu/cell_state_shader.c | 2 +- src/gallium/drivers/cell/ppu/cell_texture.c | 2 +- src/gallium/drivers/failover/fo_state.c | 2 + src/gallium/drivers/i915/i915_buffer.c | 1 + src/gallium/drivers/i915/i915_context.c | 2 +- src/gallium/drivers/i915/i915_prim_vbuf.c | 2 +- src/gallium/drivers/i915/i915_screen.c | 2 +- src/gallium/drivers/i915/i915_state.c | 2 +- src/gallium/drivers/i915/i915_texture.c | 2 +- src/gallium/drivers/i965/brw_context.c | 1 + src/gallium/drivers/i965/brw_draw.c | 1 + src/gallium/drivers/i965/brw_draw_upload.c | 1 + src/gallium/drivers/i965/brw_pipe_fb.c | 1 + src/gallium/drivers/i965/brw_pipe_sampler.c | 1 + src/gallium/drivers/i965/brw_pipe_shader.c | 1 + src/gallium/drivers/i965/brw_screen.c | 2 +- src/gallium/drivers/i965/brw_screen_buffers.c | 2 +- src/gallium/drivers/i965/brw_winsys.h | 1 + src/gallium/drivers/identity/id_objects.c | 1 + src/gallium/drivers/llvmpipe/lp_buffer.c | 1 + src/gallium/drivers/llvmpipe/lp_context.c | 1 + src/gallium/drivers/llvmpipe/lp_state_fs.c | 1 + src/gallium/drivers/llvmpipe/lp_state_sampler.c | 1 + src/gallium/drivers/llvmpipe/lp_state_surface.c | 2 + src/gallium/drivers/llvmpipe/lp_tex_cache.c | 2 +- src/gallium/drivers/llvmpipe/lp_texture.c | 2 +- src/gallium/drivers/llvmpipe/lp_tile_cache.c | 2 +- src/gallium/drivers/nv04/nv04_miptree.c | 2 +- src/gallium/drivers/nv04/nv04_prim_vbuf.c | 2 +- src/gallium/drivers/nv04/nv04_screen.c | 2 +- src/gallium/drivers/nv04/nv04_state.c | 2 +- src/gallium/drivers/nv04/nv04_surface.c | 2 +- src/gallium/drivers/nv04/nv04_transfer.c | 2 +- src/gallium/drivers/nv04/nv04_vbo.c | 2 +- src/gallium/drivers/nv10/nv10_miptree.c | 2 +- src/gallium/drivers/nv10/nv10_prim_vbuf.c | 2 +- src/gallium/drivers/nv10/nv10_state.c | 2 +- src/gallium/drivers/nv10/nv10_surface.c | 2 +- src/gallium/drivers/nv10/nv10_transfer.c | 2 +- src/gallium/drivers/nv10/nv10_vbo.c | 2 +- src/gallium/drivers/nv20/nv20_miptree.c | 2 +- src/gallium/drivers/nv20/nv20_prim_vbuf.c | 2 +- src/gallium/drivers/nv20/nv20_state.c | 2 +- src/gallium/drivers/nv20/nv20_surface.c | 2 +- src/gallium/drivers/nv20/nv20_transfer.c | 2 +- src/gallium/drivers/nv20/nv20_vbo.c | 2 +- src/gallium/drivers/nv20/nv20_vertprog.c | 2 +- src/gallium/drivers/nv30/nv30_fragprog.c | 2 +- src/gallium/drivers/nv30/nv30_miptree.c | 2 +- src/gallium/drivers/nv30/nv30_state.c | 2 +- src/gallium/drivers/nv30/nv30_surface.c | 2 +- src/gallium/drivers/nv30/nv30_transfer.c | 2 +- src/gallium/drivers/nv30/nv30_vbo.c | 2 +- src/gallium/drivers/nv30/nv30_vertprog.c | 2 +- src/gallium/drivers/nv40/nv40_draw.c | 2 +- src/gallium/drivers/nv40/nv40_fragprog.c | 2 +- src/gallium/drivers/nv40/nv40_miptree.c | 2 +- src/gallium/drivers/nv40/nv40_state.c | 2 +- src/gallium/drivers/nv40/nv40_surface.c | 2 +- src/gallium/drivers/nv40/nv40_transfer.c | 2 +- src/gallium/drivers/nv40/nv40_vbo.c | 2 +- src/gallium/drivers/nv40/nv40_vertprog.c | 2 +- src/gallium/drivers/nv50/nv50_miptree.c | 2 +- src/gallium/drivers/nv50/nv50_program.c | 2 +- src/gallium/drivers/nv50/nv50_query.c | 2 +- src/gallium/drivers/nv50/nv50_state.c | 2 +- src/gallium/drivers/nv50/nv50_surface.c | 2 +- src/gallium/drivers/nv50/nv50_transfer.c | 2 +- src/gallium/drivers/nv50/nv50_vbo.c | 2 +- src/gallium/drivers/r300/r300_context.h | 2 +- src/gallium/drivers/r300/r300_render.c | 2 +- src/gallium/drivers/r300/r300_screen.c | 2 +- src/gallium/drivers/softpipe/sp_context.c | 1 + src/gallium/drivers/softpipe/sp_draw_arrays.c | 2 +- src/gallium/drivers/softpipe/sp_state_fs.c | 1 + src/gallium/drivers/softpipe/sp_state_surface.c | 1 + src/gallium/drivers/softpipe/sp_tex_tile_cache.c | 2 +- src/gallium/drivers/softpipe/sp_texture.c | 2 +- src/gallium/drivers/softpipe/sp_tile_cache.c | 2 +- src/gallium/drivers/softpipe/sp_video_context.c | 2 +- src/gallium/drivers/softpipe/sp_winsys.c | 1 + src/gallium/drivers/svga/svga_context.c | 2 +- src/gallium/drivers/svga/svga_draw.c | 2 +- src/gallium/drivers/svga/svga_draw_arrays.c | 2 +- src/gallium/drivers/svga/svga_draw_elements.c | 2 +- src/gallium/drivers/svga/svga_pipe_blend.c | 2 +- src/gallium/drivers/svga/svga_pipe_constants.c | 2 +- src/gallium/drivers/svga/svga_pipe_depthstencil.c | 2 +- src/gallium/drivers/svga/svga_pipe_draw.c | 2 +- src/gallium/drivers/svga/svga_pipe_fs.c | 2 +- src/gallium/drivers/svga/svga_pipe_misc.c | 2 + src/gallium/drivers/svga/svga_pipe_rasterizer.c | 2 +- src/gallium/drivers/svga/svga_pipe_sampler.c | 2 +- src/gallium/drivers/svga/svga_pipe_vertex.c | 2 +- src/gallium/drivers/svga/svga_pipe_vs.c | 2 +- src/gallium/drivers/svga/svga_screen.c | 2 +- src/gallium/drivers/svga/svga_screen_buffer.c | 2 +- src/gallium/drivers/svga/svga_screen_texture.c | 2 +- src/gallium/drivers/svga/svga_screen_texture.h | 1 + src/gallium/drivers/svga/svga_state_constants.c | 2 +- src/gallium/drivers/svga/svga_state_framebuffer.c | 2 +- src/gallium/drivers/svga/svga_state_fs.c | 2 +- src/gallium/drivers/svga/svga_state_need_swtnl.c | 2 +- src/gallium/drivers/svga/svga_state_rss.c | 2 +- src/gallium/drivers/svga/svga_state_tss.c | 2 +- src/gallium/drivers/svga/svga_state_vdecl.c | 2 +- src/gallium/drivers/svga/svga_state_vs.c | 2 +- src/gallium/drivers/svga/svga_swtnl_backend.c | 2 +- src/gallium/drivers/svga/svga_swtnl_draw.c | 2 +- src/gallium/drivers/svga/svga_swtnl_state.c | 2 +- src/gallium/drivers/trace/tr_buffer.c | 1 + src/gallium/drivers/trace/tr_screen.c | 2 +- src/gallium/drivers/trace/tr_texture.c | 1 + src/gallium/include/pipe/p_inlines.h | 224 --------------- src/gallium/include/pipe/p_refcnt.h | 44 --- src/gallium/include/pipe/p_state.h | 32 --- src/gallium/include/pipe/p_video_state.h | 1 + src/gallium/state_trackers/egl/x11/sw_winsys.c | 2 +- src/gallium/state_trackers/python/gallium.i | 2 +- src/gallium/state_trackers/python/st_device.c | 2 +- .../state_trackers/python/st_llvmpipe_winsys.c | 2 +- src/gallium/state_trackers/python/st_sample.c | 2 +- src/gallium/state_trackers/vega/api_filters.c | 2 +- src/gallium/state_trackers/vega/api_images.c | 2 +- src/gallium/state_trackers/vega/api_masks.c | 2 +- src/gallium/state_trackers/vega/api_path.c | 2 +- src/gallium/state_trackers/vega/image.c | 2 +- src/gallium/state_trackers/vega/mask.c | 2 +- src/gallium/state_trackers/vega/paint.c | 2 +- src/gallium/state_trackers/vega/polygon.c | 2 +- src/gallium/state_trackers/vega/renderer.c | 2 +- src/gallium/state_trackers/vega/shader.c | 2 +- src/gallium/state_trackers/vega/shaders_cache.c | 2 +- src/gallium/state_trackers/vega/st_inlines.h | 2 +- src/gallium/state_trackers/vega/vg_context.c | 2 +- src/gallium/state_trackers/vega/vg_tracker.c | 2 +- src/gallium/state_trackers/xorg/xorg_crtc.c | 2 +- src/gallium/state_trackers/xorg/xorg_dri2.c | 2 +- src/gallium/state_trackers/xorg/xorg_renderer.c | 2 +- src/gallium/winsys/drm/radeon/core/radeon_buffer.h | 2 +- src/gallium/winsys/drm/vmware/core/vmw_buffer.c | 2 +- .../winsys/drm/vmware/core/vmw_screen_dri.c | 2 +- .../winsys/drm/vmware/core/vmw_screen_svga.c | 2 +- src/gallium/winsys/g3dvl/xlib/xsp_winsys.c | 2 +- src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c | 2 +- src/gallium/winsys/gdi/gdi_softpipe_winsys.c | 2 +- src/gallium/winsys/xlib/xlib_brw_context.c | 2 +- src/gallium/winsys/xlib/xlib_cell.c | 2 +- src/gallium/winsys/xlib/xlib_llvmpipe.c | 2 +- src/gallium/winsys/xlib/xlib_softpipe.c | 2 +- src/mesa/es/state_tracker/st_cb_drawtex.c | 2 +- src/mesa/state_tracker/st_atom_constbuf.c | 2 +- src/mesa/state_tracker/st_atom_framebuffer.c | 1 + src/mesa/state_tracker/st_atom_texture.c | 1 + src/mesa/state_tracker/st_cb_accum.c | 2 +- src/mesa/state_tracker/st_cb_bitmap.c | 2 +- src/mesa/state_tracker/st_cb_blit.c | 1 + src/mesa/state_tracker/st_cb_bufferobjects.c | 2 +- src/mesa/state_tracker/st_cb_clear.c | 2 +- src/mesa/state_tracker/st_cb_drawpixels.c | 2 +- src/mesa/state_tracker/st_cb_fbo.c | 1 + src/mesa/state_tracker/st_cb_readpixels.c | 2 +- src/mesa/state_tracker/st_cb_texture.c | 2 +- src/mesa/state_tracker/st_context.c | 1 + src/mesa/state_tracker/st_draw.c | 2 +- src/mesa/state_tracker/st_draw_feedback.c | 2 +- src/mesa/state_tracker/st_framebuffer.c | 1 + src/mesa/state_tracker/st_gen_mipmap.c | 2 +- src/mesa/state_tracker/st_inlines.h | 2 +- src/mesa/state_tracker/st_texture.c | 2 +- 191 files changed, 491 insertions(+), 452 deletions(-) create mode 100644 src/gallium/auxiliary/util/u_inlines.h delete mode 100644 src/gallium/include/pipe/p_inlines.h (limited to 'src/gallium/drivers') diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index dec830ba93e..c638239e80b 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -36,6 +36,7 @@ */ #include "pipe/p_state.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c index 4585dcdb48a..e58129b99d8 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c @@ -35,6 +35,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_shader_tokens.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index 0cc2b718641..f047d8359c4 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -37,6 +37,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_shader_tokens.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h index eb7e84be848..34b1b77df40 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h @@ -46,6 +46,7 @@ #include "pipe/p_compiler.h" #include "util/u_debug.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 96be353e264..f918151daaa 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -29,7 +29,7 @@ #include "util/u_memory.h" #include "util/u_prim.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "tgsi_text.h" #include "tgsi_build.h" #include "tgsi_info.h" diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index eb63bec7b50..f0bc58a558f 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -36,7 +36,7 @@ #include "pipe/p_context.h" #include "util/u_debug.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "pipe/p_state.h" diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index 935e11c5d85..f3b4491d175 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -34,7 +34,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "pipe/p_state.h" diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 9b4e6ca2a73..892ca8fecf1 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -63,7 +63,7 @@ #include "util/u_debug.h" #include "pipe/p_format.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_memory.h" #include "util/u_string.h" diff --git a/src/gallium/auxiliary/util/u_draw_quad.c b/src/gallium/auxiliary/util/u_draw_quad.c index e2e23c3cdd8..14506e84519 100644 --- a/src/gallium/auxiliary/util/u_draw_quad.c +++ b/src/gallium/auxiliary/util/u_draw_quad.c @@ -28,7 +28,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_draw_quad.h" diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 8611231ed70..4e358d3938c 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -37,7 +37,7 @@ #include "pipe/p_context.h" #include "util/u_debug.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "pipe/p_state.h" diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h new file mode 100644 index 00000000000..53f0de42151 --- /dev/null +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -0,0 +1,301 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef U_INLINES_H +#define U_INLINES_H + +#include "pipe/p_context.h" +#include "pipe/p_defines.h" +#include "pipe/p_screen.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + * Reference counting helper functions. + */ + + +static INLINE void +pipe_reference_init(struct pipe_reference *reference, unsigned count) +{ + p_atomic_set(&reference->count, count); +} + +static INLINE boolean +pipe_is_referenced(struct pipe_reference *reference) +{ + return p_atomic_read(&reference->count) != 0; +} + +/** + * Update reference counting. + * The old thing pointed to, if any, will be unreferenced. + * Both 'ptr' and 'reference' may be NULL. + * \return TRUE if the object's refcount hits zero and should be destroyed. + */ +static INLINE boolean +pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference) +{ + boolean destroy = FALSE; + + if(ptr != reference) { + /* bump the reference.count first */ + if (reference) { + assert(pipe_is_referenced(reference)); + p_atomic_inc(&reference->count); + } + + if (ptr) { + assert(pipe_is_referenced(ptr)); + if (p_atomic_dec_zero(&ptr->count)) { + destroy = TRUE; + } + } + } + + return destroy; +} + +static INLINE void +pipe_buffer_reference(struct pipe_buffer **ptr, struct pipe_buffer *buf) +{ + struct pipe_buffer *old_buf = *ptr; + + if (pipe_reference(&(*ptr)->reference, &buf->reference)) + old_buf->screen->buffer_destroy(old_buf); + *ptr = buf; +} + +static INLINE void +pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf) +{ + struct pipe_surface *old_surf = *ptr; + + if (pipe_reference(&(*ptr)->reference, &surf->reference)) + old_surf->texture->screen->tex_surface_destroy(old_surf); + *ptr = surf; +} + +static INLINE void +pipe_texture_reference(struct pipe_texture **ptr, struct pipe_texture *tex) +{ + struct pipe_texture *old_tex = *ptr; + + if (pipe_reference(&(*ptr)->reference, &tex->reference)) + old_tex->screen->texture_destroy(old_tex); + *ptr = tex; +} + + +/* + * Convenience wrappers for screen buffer functions. + */ + +static INLINE struct pipe_buffer * +pipe_buffer_create( struct pipe_screen *screen, + unsigned alignment, unsigned usage, unsigned size ) +{ + return screen->buffer_create(screen, alignment, usage, size); +} + +static INLINE struct pipe_buffer * +pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size ) +{ + return screen->user_buffer_create(screen, ptr, size); +} + +static INLINE void * +pipe_buffer_map(struct pipe_screen *screen, + struct pipe_buffer *buf, + unsigned usage) +{ + if(screen->buffer_map_range) { + unsigned offset = 0; + unsigned length = buf->size; + return screen->buffer_map_range(screen, buf, offset, length, usage); + } + else + return screen->buffer_map(screen, buf, usage); +} + +static INLINE void +pipe_buffer_unmap(struct pipe_screen *screen, + struct pipe_buffer *buf) +{ + screen->buffer_unmap(screen, buf); +} + +static INLINE void * +pipe_buffer_map_range(struct pipe_screen *screen, + struct pipe_buffer *buf, + unsigned offset, + unsigned length, + unsigned usage) +{ + assert(offset < buf->size); + assert(offset + length <= buf->size); + assert(length); + if(screen->buffer_map_range) + return screen->buffer_map_range(screen, buf, offset, length, usage); + else + return screen->buffer_map(screen, buf, usage); +} + +static INLINE void +pipe_buffer_flush_mapped_range(struct pipe_screen *screen, + struct pipe_buffer *buf, + unsigned offset, + unsigned length) +{ + assert(offset < buf->size); + assert(offset + length <= buf->size); + assert(length); + if(screen->buffer_flush_mapped_range) + screen->buffer_flush_mapped_range(screen, buf, offset, length); +} + +static INLINE void +pipe_buffer_write(struct pipe_screen *screen, + struct pipe_buffer *buf, + unsigned offset, unsigned size, + const void *data) +{ + void *map; + + assert(offset < buf->size); + assert(offset + size <= buf->size); + assert(size); + + map = pipe_buffer_map_range(screen, buf, offset, size, + PIPE_BUFFER_USAGE_CPU_WRITE | + PIPE_BUFFER_USAGE_FLUSH_EXPLICIT | + PIPE_BUFFER_USAGE_DISCARD); + assert(map); + if(map) { + memcpy((uint8_t *)map + offset, data, size); + pipe_buffer_flush_mapped_range(screen, buf, offset, size); + pipe_buffer_unmap(screen, buf); + } +} + +/** + * Special case for writing non-overlapping ranges. + * + * We can avoid GPU/CPU synchronization when writing range that has never + * been written before. + */ +static INLINE void +pipe_buffer_write_nooverlap(struct pipe_screen *screen, + struct pipe_buffer *buf, + unsigned offset, unsigned size, + const void *data) +{ + void *map; + + assert(offset < buf->size); + assert(offset + size <= buf->size); + assert(size); + + map = pipe_buffer_map_range(screen, buf, offset, size, + PIPE_BUFFER_USAGE_CPU_WRITE | + PIPE_BUFFER_USAGE_FLUSH_EXPLICIT | + PIPE_BUFFER_USAGE_DISCARD | + PIPE_BUFFER_USAGE_UNSYNCHRONIZED); + assert(map); + if(map) { + memcpy((uint8_t *)map + offset, data, size); + pipe_buffer_flush_mapped_range(screen, buf, offset, size); + pipe_buffer_unmap(screen, buf); + } +} + +static INLINE void +pipe_buffer_read(struct pipe_screen *screen, + struct pipe_buffer *buf, + unsigned offset, unsigned size, + void *data) +{ + void *map; + + assert(offset < buf->size); + assert(offset + size <= buf->size); + assert(size); + + map = pipe_buffer_map_range(screen, buf, offset, size, PIPE_BUFFER_USAGE_CPU_READ); + assert(map); + if(map) { + memcpy(data, (const uint8_t *)map + offset, size); + pipe_buffer_unmap(screen, buf); + } +} + +static INLINE void * +pipe_transfer_map( struct pipe_transfer *transf ) +{ + struct pipe_screen *screen = transf->texture->screen; + return screen->transfer_map(screen, transf); +} + +static INLINE void +pipe_transfer_unmap( struct pipe_transfer *transf ) +{ + struct pipe_screen *screen = transf->texture->screen; + screen->transfer_unmap(screen, transf); +} + +static INLINE void +pipe_transfer_destroy( struct pipe_transfer *transf ) +{ + struct pipe_screen *screen = transf->texture->screen; + screen->tex_transfer_destroy(transf); +} + +static INLINE unsigned +pipe_transfer_buffer_flags( struct pipe_transfer *transf ) +{ + switch (transf->usage & PIPE_TRANSFER_READ_WRITE) { + case PIPE_TRANSFER_READ_WRITE: + return PIPE_BUFFER_USAGE_CPU_READ | PIPE_BUFFER_USAGE_CPU_WRITE; + case PIPE_TRANSFER_READ: + return PIPE_BUFFER_USAGE_CPU_READ; + case PIPE_TRANSFER_WRITE: + return PIPE_BUFFER_USAGE_CPU_WRITE; + default: + debug_assert(0); + return 0; + } +} + +#ifdef __cplusplus +} +#endif + +#endif /* U_INLINES_H */ diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index f828908f0be..6053c111e34 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -35,6 +35,7 @@ #include "pipe/p_screen.h" #include "pipe/p_state.h" #include "pipe/p_defines.h" +#include "util/u_inlines.h" #include "util/u_surface.h" diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index c25e1e52e9d..0051258e22a 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -32,7 +32,7 @@ #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c index 55a65375c81..012b2ae2336 100644 --- a/src/gallium/auxiliary/util/u_upload_mgr.c +++ b/src/gallium/auxiliary/util/u_upload_mgr.c @@ -30,7 +30,7 @@ */ #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_screen.h" #include "util/u_memory.h" #include "util/u_math.h" diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c index a524e2fdfb3..6c5298daabc 100644 --- a/src/gallium/auxiliary/vl/vl_compositor.c +++ b/src/gallium/auxiliary/vl/vl_compositor.c @@ -28,7 +28,7 @@ #include "vl_compositor.h" #include #include -#include +#include #include #include #include diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c index e43187545c5..c2552f40b4e 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c @@ -28,7 +28,7 @@ #include "vl_mpeg12_mc_renderer.h" #include #include -#include +#include #include #include #include diff --git a/src/gallium/drivers/cell/ppu/cell_clear.c b/src/gallium/drivers/cell/ppu/cell_clear.c index 3a3f968a492..246fe210542 100644 --- a/src/gallium/drivers/cell/ppu/cell_clear.c +++ b/src/gallium/drivers/cell/ppu/cell_clear.c @@ -33,7 +33,7 @@ #include #include #include -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_pack_color.h" #include "cell/common.h" diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c index c674d0be633..8b939454eb4 100644 --- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c +++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c @@ -34,7 +34,7 @@ #include "pipe/p_defines.h" #include "pipe/p_context.h" #include "pipe/internal/p_winsys_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "cell_context.h" #include "cell_draw_arrays.h" diff --git a/src/gallium/drivers/cell/ppu/cell_fence.c b/src/gallium/drivers/cell/ppu/cell_fence.c index 13125a9fa30..e10071529a8 100644 --- a/src/gallium/drivers/cell/ppu/cell_fence.c +++ b/src/gallium/drivers/cell/ppu/cell_fence.c @@ -27,7 +27,7 @@ #include #include "util/u_memory.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "cell_context.h" #include "cell_batch.h" #include "cell_fence.h" diff --git a/src/gallium/drivers/cell/ppu/cell_pipe_state.c b/src/gallium/drivers/cell/ppu/cell_pipe_state.c index c18a5d0635e..3259c58687c 100644 --- a/src/gallium/drivers/cell/ppu/cell_pipe_state.c +++ b/src/gallium/drivers/cell/ppu/cell_pipe_state.c @@ -31,7 +31,7 @@ */ #include "util/u_memory.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "draw/draw_context.h" #include "cell_context.h" #include "cell_flush.h" diff --git a/src/gallium/drivers/cell/ppu/cell_state_emit.c b/src/gallium/drivers/cell/ppu/cell_state_emit.c index f1e1dcb9eb0..282f05ba08b 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_emit.c +++ b/src/gallium/drivers/cell/ppu/cell_state_emit.c @@ -25,7 +25,7 @@ * **************************************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_math.h" #include "cell_context.h" diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c index 1b09cf7f7d7..c5adc6a8979 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c @@ -27,7 +27,7 @@ #include "pipe/p_defines.h" #include "util/u_memory.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/internal/p_winsys_screen.h" #include "draw/draw_context.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index 998944f77a3..15bc1eec326 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -33,7 +33,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/internal/p_winsys_screen.h" #include "util/u_format.h" diff --git a/src/gallium/drivers/failover/fo_state.c b/src/gallium/drivers/failover/fo_state.c index d6ec4d13136..c189d1d82cd 100644 --- a/src/gallium/drivers/failover/fo_state.c +++ b/src/gallium/drivers/failover/fo_state.c @@ -28,6 +28,8 @@ /* Authors: Keith Whitwell */ +#include "util/u_inlines.h" + #include "fo_context.h" diff --git a/src/gallium/drivers/i915/i915_buffer.c b/src/gallium/drivers/i915/i915_buffer.c index 669964770d4..0f76a59e93a 100644 --- a/src/gallium/drivers/i915/i915_buffer.c +++ b/src/gallium/drivers/i915/i915_buffer.c @@ -23,6 +23,7 @@ * **************************************************************************/ +#include "util/u_inlines.h" #include "util/u_memory.h" #include "i915_screen.h" #include "i915_buffer.h" diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c index a0c80d02286..f8219c9f299 100644 --- a/src/gallium/drivers/i915/i915_context.c +++ b/src/gallium/drivers/i915/i915_context.c @@ -32,7 +32,7 @@ #include "draw/draw_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "pipe/p_screen.h" diff --git a/src/gallium/drivers/i915/i915_prim_vbuf.c b/src/gallium/drivers/i915/i915_prim_vbuf.c index 6b832140a87..cad4109ee6b 100644 --- a/src/gallium/drivers/i915/i915_prim_vbuf.c +++ b/src/gallium/drivers/i915/i915_prim_vbuf.c @@ -41,7 +41,7 @@ #include "draw/draw_context.h" #include "draw/draw_vbuf.h" #include "util/u_debug.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_memory.h" #include "util/u_fifo.h" diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index 7b8d66b8aa1..e6b560bc212 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -26,7 +26,7 @@ **************************************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_string.h" diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index 23e4d6b9938..beb26e996a4 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -30,7 +30,7 @@ #include "draw/draw_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_memory.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c index 612e5c1cdd5..e101c8683ec 100644 --- a/src/gallium/drivers/i915/i915_texture.c +++ b/src/gallium/drivers/i915/i915_texture.c @@ -33,7 +33,7 @@ #include "pipe/p_state.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/i965/brw_context.c b/src/gallium/drivers/i965/brw_context.c index d60b7b99b6e..7cbda05ac58 100644 --- a/src/gallium/drivers/i965/brw_context.c +++ b/src/gallium/drivers/i965/brw_context.c @@ -31,6 +31,7 @@ #include "pipe/p_context.h" +#include "util/u_inlines.h" #include "util/u_simple_list.h" #include "brw_context.h" diff --git a/src/gallium/drivers/i965/brw_draw.c b/src/gallium/drivers/i965/brw_draw.c index 1b5cd23995b..9bad61ef72e 100644 --- a/src/gallium/drivers/i965/brw_draw.c +++ b/src/gallium/drivers/i965/brw_draw.c @@ -26,6 +26,7 @@ **************************************************************************/ +#include "util/u_inlines.h" #include "util/u_prim.h" #include "util/u_upload_mgr.h" diff --git a/src/gallium/drivers/i965/brw_draw_upload.c b/src/gallium/drivers/i965/brw_draw_upload.c index a27da5f1c17..d59261557b5 100644 --- a/src/gallium/drivers/i965/brw_draw_upload.c +++ b/src/gallium/drivers/i965/brw_draw_upload.c @@ -26,6 +26,7 @@ **************************************************************************/ #include "pipe/p_context.h" +#include "util/u_inlines.h" #include "util/u_upload_mgr.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/i965/brw_pipe_fb.c b/src/gallium/drivers/i965/brw_pipe_fb.c index c1f049272ac..a90b7c73f69 100644 --- a/src/gallium/drivers/i965/brw_pipe_fb.c +++ b/src/gallium/drivers/i965/brw_pipe_fb.c @@ -1,6 +1,7 @@ #include "util/u_math.h" #include "pipe/p_context.h" #include "pipe/p_state.h" +#include "util/u_inlines.h" #include "brw_context.h" diff --git a/src/gallium/drivers/i965/brw_pipe_sampler.c b/src/gallium/drivers/i965/brw_pipe_sampler.c index ef6c1bb3155..6aab5610043 100644 --- a/src/gallium/drivers/i965/brw_pipe_sampler.c +++ b/src/gallium/drivers/i965/brw_pipe_sampler.c @@ -4,6 +4,7 @@ #include "pipe/p_context.h" #include "pipe/p_state.h" +#include "util/u_inlines.h" #include "brw_context.h" #include "brw_defines.h" diff --git a/src/gallium/drivers/i965/brw_pipe_shader.c b/src/gallium/drivers/i965/brw_pipe_shader.c index e389587f3e1..c2b18391103 100644 --- a/src/gallium/drivers/i965/brw_pipe_shader.c +++ b/src/gallium/drivers/i965/brw_pipe_shader.c @@ -29,6 +29,7 @@ * Keith Whitwell */ +#include "util/u_inlines.h" #include "util/u_memory.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c index a8f9892d71d..1d79d84dc65 100644 --- a/src/gallium/drivers/i965/brw_screen.c +++ b/src/gallium/drivers/i965/brw_screen.c @@ -26,7 +26,7 @@ **************************************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_string.h" diff --git a/src/gallium/drivers/i965/brw_screen_buffers.c b/src/gallium/drivers/i965/brw_screen_buffers.c index d8141a3f5b9..0b38885f40c 100644 --- a/src/gallium/drivers/i965/brw_screen_buffers.c +++ b/src/gallium/drivers/i965/brw_screen_buffers.c @@ -4,7 +4,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "brw_screen.h" #include "brw_winsys.h" diff --git a/src/gallium/drivers/i965/brw_winsys.h b/src/gallium/drivers/i965/brw_winsys.h index a242e31218a..1c63f03429e 100644 --- a/src/gallium/drivers/i965/brw_winsys.h +++ b/src/gallium/drivers/i965/brw_winsys.h @@ -29,6 +29,7 @@ #include "pipe/p_compiler.h" #include "pipe/p_defines.h" #include "pipe/p_refcnt.h" +#include "util/u_inlines.h" struct brw_winsys; struct pipe_fence_handle; diff --git a/src/gallium/drivers/identity/id_objects.c b/src/gallium/drivers/identity/id_objects.c index bc9bc7121d5..07aa01818d3 100644 --- a/src/gallium/drivers/identity/id_objects.c +++ b/src/gallium/drivers/identity/id_objects.c @@ -25,6 +25,7 @@ * **************************************************************************/ +#include "util/u_inlines.h" #include "util/u_memory.h" #include "id_public.h" diff --git a/src/gallium/drivers/llvmpipe/lp_buffer.c b/src/gallium/drivers/llvmpipe/lp_buffer.c index 66f1f8e1383..8623778f86d 100644 --- a/src/gallium/drivers/llvmpipe/lp_buffer.c +++ b/src/gallium/drivers/llvmpipe/lp_buffer.c @@ -26,6 +26,7 @@ **************************************************************************/ +#include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c index aaa675aec77..d9adf21b6a6 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.c +++ b/src/gallium/drivers/llvmpipe/lp_context.c @@ -33,6 +33,7 @@ #include "draw/draw_context.h" #include "draw/draw_vbuf.h" #include "pipe/p_defines.h" +#include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_memory.h" #include "lp_clear.h" diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index ddd0740f1b4..f3263cf3770 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -59,6 +59,7 @@ */ #include "pipe/p_defines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_format.h" #include "util/u_debug_dump.h" diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c index d382f9ca87e..bda9c138d52 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c +++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c @@ -29,6 +29,7 @@ * Brian Paul */ +#include "util/u_inlines.h" #include "util/u_memory.h" #include "draw/draw_context.h" diff --git a/src/gallium/drivers/llvmpipe/lp_state_surface.c b/src/gallium/drivers/llvmpipe/lp_state_surface.c index 3b08b0d1d70..0afa49d0b75 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_surface.c +++ b/src/gallium/drivers/llvmpipe/lp_state_surface.c @@ -28,6 +28,8 @@ /* Authors: Keith Whitwell */ +#include "util/u_inlines.h" + #include "lp_context.h" #include "lp_state.h" #include "lp_tile_cache.h" diff --git a/src/gallium/drivers/llvmpipe/lp_tex_cache.c b/src/gallium/drivers/llvmpipe/lp_tex_cache.c index 8094625d74d..e9f7d9002ae 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_cache.c @@ -32,7 +32,7 @@ * Brian Paul */ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_tile.h" #include "util/u_format.h" diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 3701219dcf9..8c20625430c 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -32,7 +32,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c index 971d9333331..196826870db 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c @@ -32,7 +32,7 @@ * Brian Paul */ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_math.h" #include "util/u_tile.h" diff --git a/src/gallium/drivers/nv04/nv04_miptree.c b/src/gallium/drivers/nv04/nv04_miptree.c index e0a6948aeb4..e4c38ac98e2 100644 --- a/src/gallium/drivers/nv04/nv04_miptree.c +++ b/src/gallium/drivers/nv04/nv04_miptree.c @@ -1,6 +1,6 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_math.h" #include "nv04_context.h" diff --git a/src/gallium/drivers/nv04/nv04_prim_vbuf.c b/src/gallium/drivers/nv04/nv04_prim_vbuf.c index 0b795ea2430..dc0c1d04b79 100644 --- a/src/gallium/drivers/nv04/nv04_prim_vbuf.c +++ b/src/gallium/drivers/nv04/nv04_prim_vbuf.c @@ -1,6 +1,6 @@ #include "util/u_debug.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/internal/p_winsys_screen.h" #include "pipe/p_compiler.h" diff --git a/src/gallium/drivers/nv04/nv04_screen.c b/src/gallium/drivers/nv04/nv04_screen.c index 97538964af8..212b47bc3d2 100644 --- a/src/gallium/drivers/nv04/nv04_screen.c +++ b/src/gallium/drivers/nv04/nv04_screen.c @@ -1,5 +1,5 @@ #include "pipe/p_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "nv04_context.h" #include "nv04_screen.h" diff --git a/src/gallium/drivers/nv04/nv04_state.c b/src/gallium/drivers/nv04/nv04_state.c index 1fdb764b532..226aae35659 100644 --- a/src/gallium/drivers/nv04/nv04_state.c +++ b/src/gallium/drivers/nv04/nv04_state.c @@ -2,7 +2,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" #include "pipe/p_shader_tokens.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/nv04/nv04_surface.c b/src/gallium/drivers/nv04/nv04_surface.c index 0387ff4e78b..92840910e65 100644 --- a/src/gallium/drivers/nv04/nv04_surface.c +++ b/src/gallium/drivers/nv04/nv04_surface.c @@ -29,7 +29,7 @@ #include "nv04_context.h" #include "pipe/p_defines.h" #include "pipe/internal/p_winsys_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_tile.h" static void diff --git a/src/gallium/drivers/nv04/nv04_transfer.c b/src/gallium/drivers/nv04/nv04_transfer.c index 2dd2e146a8f..2e151483851 100644 --- a/src/gallium/drivers/nv04/nv04_transfer.c +++ b/src/gallium/drivers/nv04/nv04_transfer.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/src/gallium/drivers/nv04/nv04_vbo.c b/src/gallium/drivers/nv04/nv04_vbo.c index 2db61d89412..606ce65fabd 100644 --- a/src/gallium/drivers/nv04/nv04_vbo.c +++ b/src/gallium/drivers/nv04/nv04_vbo.c @@ -1,7 +1,7 @@ #include "draw/draw_context.h" #include "pipe/p_context.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "nv04_context.h" #include "nv04_state.h" diff --git a/src/gallium/drivers/nv10/nv10_miptree.c b/src/gallium/drivers/nv10/nv10_miptree.c index 908482ad854..55bd6f76b3e 100644 --- a/src/gallium/drivers/nv10/nv10_miptree.c +++ b/src/gallium/drivers/nv10/nv10_miptree.c @@ -1,6 +1,6 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/nv10/nv10_prim_vbuf.c b/src/gallium/drivers/nv10/nv10_prim_vbuf.c index c5dbe43dbc8..0309465ab8d 100644 --- a/src/gallium/drivers/nv10/nv10_prim_vbuf.c +++ b/src/gallium/drivers/nv10/nv10_prim_vbuf.c @@ -39,7 +39,7 @@ #include "util/u_debug.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "nv10_context.h" #include "nv10_state.h" diff --git a/src/gallium/drivers/nv10/nv10_state.c b/src/gallium/drivers/nv10/nv10_state.c index 9aafc604116..11e23b21c5c 100644 --- a/src/gallium/drivers/nv10/nv10_state.c +++ b/src/gallium/drivers/nv10/nv10_state.c @@ -2,7 +2,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" #include "pipe/p_shader_tokens.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/nv10/nv10_surface.c b/src/gallium/drivers/nv10/nv10_surface.c index 5b52246a9ca..acf898917cf 100644 --- a/src/gallium/drivers/nv10/nv10_surface.c +++ b/src/gallium/drivers/nv10/nv10_surface.c @@ -29,7 +29,7 @@ #include "nv10_context.h" #include "pipe/p_defines.h" #include "pipe/internal/p_winsys_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_tile.h" static void diff --git a/src/gallium/drivers/nv10/nv10_transfer.c b/src/gallium/drivers/nv10/nv10_transfer.c index eb04af9782e..e554a587301 100644 --- a/src/gallium/drivers/nv10/nv10_transfer.c +++ b/src/gallium/drivers/nv10/nv10_transfer.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/src/gallium/drivers/nv10/nv10_vbo.c b/src/gallium/drivers/nv10/nv10_vbo.c index da5c93f0814..31b34b5c0a8 100644 --- a/src/gallium/drivers/nv10/nv10_vbo.c +++ b/src/gallium/drivers/nv10/nv10_vbo.c @@ -1,7 +1,7 @@ #include "draw/draw_context.h" #include "pipe/p_context.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "nv10_context.h" #include "nv10_state.h" diff --git a/src/gallium/drivers/nv20/nv20_miptree.c b/src/gallium/drivers/nv20/nv20_miptree.c index 8f7538e7f57..2d3473b0869 100644 --- a/src/gallium/drivers/nv20/nv20_miptree.c +++ b/src/gallium/drivers/nv20/nv20_miptree.c @@ -1,6 +1,6 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/nv20/nv20_prim_vbuf.c b/src/gallium/drivers/nv20/nv20_prim_vbuf.c index 2e145672da1..84faa87095e 100644 --- a/src/gallium/drivers/nv20/nv20_prim_vbuf.c +++ b/src/gallium/drivers/nv20/nv20_prim_vbuf.c @@ -39,7 +39,7 @@ #include "util/u_debug.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/internal/p_winsys_screen.h" #include "nv20_context.h" diff --git a/src/gallium/drivers/nv20/nv20_state.c b/src/gallium/drivers/nv20/nv20_state.c index 83335c790a0..923dc61cfb2 100644 --- a/src/gallium/drivers/nv20/nv20_state.c +++ b/src/gallium/drivers/nv20/nv20_state.c @@ -2,7 +2,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" #include "pipe/p_shader_tokens.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/nv20/nv20_surface.c b/src/gallium/drivers/nv20/nv20_surface.c index 4224bdd6afa..7beb0f0c83d 100644 --- a/src/gallium/drivers/nv20/nv20_surface.c +++ b/src/gallium/drivers/nv20/nv20_surface.c @@ -29,7 +29,7 @@ #include "nv20_context.h" #include "pipe/p_defines.h" #include "pipe/internal/p_winsys_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_tile.h" static void diff --git a/src/gallium/drivers/nv20/nv20_transfer.c b/src/gallium/drivers/nv20/nv20_transfer.c index 699773e8e6f..c91f8b12cc2 100644 --- a/src/gallium/drivers/nv20/nv20_transfer.c +++ b/src/gallium/drivers/nv20/nv20_transfer.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/src/gallium/drivers/nv20/nv20_vbo.c b/src/gallium/drivers/nv20/nv20_vbo.c index 6dc95389013..263f18706a5 100644 --- a/src/gallium/drivers/nv20/nv20_vbo.c +++ b/src/gallium/drivers/nv20/nv20_vbo.c @@ -1,7 +1,7 @@ #include "draw/draw_context.h" #include "pipe/p_context.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "nv20_context.h" #include "nv20_state.h" diff --git a/src/gallium/drivers/nv20/nv20_vertprog.c b/src/gallium/drivers/nv20/nv20_vertprog.c index 7886c2af7e6..7283ed4d005 100644 --- a/src/gallium/drivers/nv20/nv20_vertprog.c +++ b/src/gallium/drivers/nv20/nv20_vertprog.c @@ -1,7 +1,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/nv30/nv30_fragprog.c b/src/gallium/drivers/nv30/nv30_fragprog.c index 2d565cb631b..2c432c6dfa7 100644 --- a/src/gallium/drivers/nv30/nv30_fragprog.c +++ b/src/gallium/drivers/nv30/nv30_fragprog.c @@ -1,7 +1,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "tgsi/tgsi_dump.h" diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index 8fbba38e78f..ea8a610fe69 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -1,6 +1,6 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/nv30/nv30_state.c b/src/gallium/drivers/nv30/nv30_state.c index 1f4c9642705..25532e3a544 100644 --- a/src/gallium/drivers/nv30/nv30_state.c +++ b/src/gallium/drivers/nv30/nv30_state.c @@ -1,6 +1,6 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/nv30/nv30_surface.c b/src/gallium/drivers/nv30/nv30_surface.c index 5e237e13eb5..b72a63ee76a 100644 --- a/src/gallium/drivers/nv30/nv30_surface.c +++ b/src/gallium/drivers/nv30/nv30_surface.c @@ -29,7 +29,7 @@ #include "nv30_context.h" #include "pipe/p_defines.h" #include "pipe/internal/p_winsys_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_tile.h" static void diff --git a/src/gallium/drivers/nv30/nv30_transfer.c b/src/gallium/drivers/nv30/nv30_transfer.c index 65598991c68..554bcbbdd0e 100644 --- a/src/gallium/drivers/nv30/nv30_transfer.c +++ b/src/gallium/drivers/nv30/nv30_transfer.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/src/gallium/drivers/nv30/nv30_vbo.c b/src/gallium/drivers/nv30/nv30_vbo.c index 1c5db03ea24..d50055fdd33 100644 --- a/src/gallium/drivers/nv30/nv30_vbo.c +++ b/src/gallium/drivers/nv30/nv30_vbo.c @@ -1,6 +1,6 @@ #include "pipe/p_context.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "nv30_context.h" #include "nv30_state.h" diff --git a/src/gallium/drivers/nv30/nv30_vertprog.c b/src/gallium/drivers/nv30/nv30_vertprog.c index e77a5be3f23..809be3712da 100644 --- a/src/gallium/drivers/nv30/nv30_vertprog.c +++ b/src/gallium/drivers/nv30/nv30_vertprog.c @@ -1,7 +1,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/nv40/nv40_draw.c b/src/gallium/drivers/nv40/nv40_draw.c index a2fd5f6c02f..60ab49fad1c 100644 --- a/src/gallium/drivers/nv40/nv40_draw.c +++ b/src/gallium/drivers/nv40/nv40_draw.c @@ -1,5 +1,5 @@ #include "pipe/p_shader_tokens.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_pack_color.h" diff --git a/src/gallium/drivers/nv40/nv40_fragprog.c b/src/gallium/drivers/nv40/nv40_fragprog.c index 1237066c398..dc24f9b08a5 100644 --- a/src/gallium/drivers/nv40/nv40_fragprog.c +++ b/src/gallium/drivers/nv40/nv40_fragprog.c @@ -1,7 +1,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c index 89bd155ff49..d62627daa55 100644 --- a/src/gallium/drivers/nv40/nv40_miptree.c +++ b/src/gallium/drivers/nv40/nv40_miptree.c @@ -1,6 +1,6 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/nv40/nv40_state.c b/src/gallium/drivers/nv40/nv40_state.c index 7a63fba18c5..b09c450dc29 100644 --- a/src/gallium/drivers/nv40/nv40_state.c +++ b/src/gallium/drivers/nv40/nv40_state.c @@ -1,6 +1,6 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "draw/draw_context.h" diff --git a/src/gallium/drivers/nv40/nv40_surface.c b/src/gallium/drivers/nv40/nv40_surface.c index a596547974a..02ecfd7bbb7 100644 --- a/src/gallium/drivers/nv40/nv40_surface.c +++ b/src/gallium/drivers/nv40/nv40_surface.c @@ -27,7 +27,7 @@ **************************************************************************/ #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_tile.h" diff --git a/src/gallium/drivers/nv40/nv40_transfer.c b/src/gallium/drivers/nv40/nv40_transfer.c index 791ee6823d3..ee266c6cfb1 100644 --- a/src/gallium/drivers/nv40/nv40_transfer.c +++ b/src/gallium/drivers/nv40/nv40_transfer.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/src/gallium/drivers/nv40/nv40_vbo.c b/src/gallium/drivers/nv40/nv40_vbo.c index a777898f688..d1c76c03cdd 100644 --- a/src/gallium/drivers/nv40/nv40_vbo.c +++ b/src/gallium/drivers/nv40/nv40_vbo.c @@ -1,6 +1,6 @@ #include "pipe/p_context.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "nv40_context.h" #include "nv40_state.h" diff --git a/src/gallium/drivers/nv40/nv40_vertprog.c b/src/gallium/drivers/nv40/nv40_vertprog.c index 8d80fcad38e..b289eef0fc2 100644 --- a/src/gallium/drivers/nv40/nv40_vertprog.c +++ b/src/gallium/drivers/nv40/nv40_vertprog.c @@ -1,7 +1,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index dc8364ced7e..7297c74a83c 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -22,7 +22,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "nv50_context.h" diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index e74a526c626..3653e606ef5 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -23,7 +23,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/nv50/nv50_query.c b/src/gallium/drivers/nv50/nv50_query.c index 9eba4c96115..57b16a355dc 100644 --- a/src/gallium/drivers/nv50/nv50_query.c +++ b/src/gallium/drivers/nv50/nv50_query.c @@ -21,7 +21,7 @@ */ #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "nv50_context.h" diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index da8dc933b03..7eb326adf5b 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -22,7 +22,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 6378132979e..38a9dfdde7a 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -26,7 +26,7 @@ #include "nv50_context.h" #include "pipe/p_defines.h" #include "pipe/internal/p_winsys_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_tile.h" diff --git a/src/gallium/drivers/nv50/nv50_transfer.c b/src/gallium/drivers/nv50/nv50_transfer.c index a2f1db2914c..d08b4d7354c 100644 --- a/src/gallium/drivers/nv50/nv50_transfer.c +++ b/src/gallium/drivers/nv50/nv50_transfer.c @@ -1,6 +1,6 @@ #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index bfb1b34d27a..ca2f8061f32 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -22,7 +22,7 @@ #include "pipe/p_context.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 3f461640a03..ea9b4abfdeb 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -28,7 +28,7 @@ #include "util/u_blitter.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "r300_screen.h" diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 38636dc8e44..cd4971ae136 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -26,7 +26,7 @@ #include "draw/draw_context.h" #include "draw/draw_vbuf.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 4cef9a028af..18eecf7c135 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -20,7 +20,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_memory.h" #include "util/u_simple_screen.h" diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index 53133d28888..b1cfe59bc18 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -35,6 +35,7 @@ #include "pipe/p_defines.h" #include "util/u_math.h" #include "util/u_memory.h" +#include "util/u_inlines.h" #include "sp_clear.h" #include "sp_context.h" #include "sp_flush.h" diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index 2b82427d546..f7e736df849 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -34,7 +34,7 @@ #include "pipe/p_defines.h" #include "pipe/p_context.h" #include "pipe/internal/p_winsys_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_prim.h" #include "sp_context.h" diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c index de3edde9760..c88e2137510 100644 --- a/src/gallium/drivers/softpipe/sp_state_fs.c +++ b/src/gallium/drivers/softpipe/sp_state_fs.c @@ -31,6 +31,7 @@ #include "pipe/p_defines.h" #include "util/u_memory.h" +#include "util/u_inlines.h" #include "draw/draw_context.h" #include "draw/draw_vs.h" #include "tgsi/tgsi_dump.h" diff --git a/src/gallium/drivers/softpipe/sp_state_surface.c b/src/gallium/drivers/softpipe/sp_state_surface.c index 39466782195..2db6faeca46 100644 --- a/src/gallium/drivers/softpipe/sp_state_surface.c +++ b/src/gallium/drivers/softpipe/sp_state_surface.c @@ -35,6 +35,7 @@ #include "draw/draw_context.h" #include "util/u_format.h" +#include "util/u_inlines.h" /** diff --git a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c index 50242d5bd69..a0b95c88846 100644 --- a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c @@ -32,7 +32,7 @@ * Brian Paul */ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_tile.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index a5fff915077..371c4e20251 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -31,7 +31,7 @@ */ #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c index 112a6fe0cf3..1b50bd7ffe5 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c @@ -32,7 +32,7 @@ * Brian Paul */ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_memory.h" #include "util/u_tile.h" diff --git a/src/gallium/drivers/softpipe/sp_video_context.c b/src/gallium/drivers/softpipe/sp_video_context.c index d0723ebe9e0..7a8b132ddcd 100644 --- a/src/gallium/drivers/softpipe/sp_video_context.c +++ b/src/gallium/drivers/softpipe/sp_video_context.c @@ -26,7 +26,7 @@ **************************************************************************/ #include "sp_video_context.h" -#include +#include #include #include "softpipe/sp_winsys.h" #include "softpipe/sp_texture.h" diff --git a/src/gallium/drivers/softpipe/sp_winsys.c b/src/gallium/drivers/softpipe/sp_winsys.c index 38bcd64c6a5..e515d1d838d 100644 --- a/src/gallium/drivers/softpipe/sp_winsys.c +++ b/src/gallium/drivers/softpipe/sp_winsys.c @@ -42,6 +42,7 @@ #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" +#include "util/u_inlines.h" #include "softpipe/sp_winsys.h" diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c index af99c9de37c..e88ef8d8fe3 100644 --- a/src/gallium/drivers/svga/svga_context.c +++ b/src/gallium/drivers/svga/svga_context.c @@ -26,7 +26,7 @@ #include "svga_cmd.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_screen.h" #include "util/u_memory.h" #include "util/u_bitmask.h" diff --git a/src/gallium/drivers/svga/svga_draw.c b/src/gallium/drivers/svga/svga_draw.c index ca73cf9d5a3..f4d2d8992c8 100644 --- a/src/gallium/drivers/svga/svga_draw.c +++ b/src/gallium/drivers/svga/svga_draw.c @@ -24,7 +24,7 @@ **********************************************************/ #include "pipe/p_compiler.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_memory.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/svga/svga_draw_arrays.c b/src/gallium/drivers/svga/svga_draw_arrays.c index 6b6ebc9b585..6192aa96b11 100644 --- a/src/gallium/drivers/svga/svga_draw_arrays.c +++ b/src/gallium/drivers/svga/svga_draw_arrays.c @@ -25,7 +25,7 @@ #include "svga_cmd.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "indices/u_indices.h" #include "svga_hw_reg.h" diff --git a/src/gallium/drivers/svga/svga_draw_elements.c b/src/gallium/drivers/svga/svga_draw_elements.c index 022b444eb91..e8097d82f16 100644 --- a/src/gallium/drivers/svga/svga_draw_elements.c +++ b/src/gallium/drivers/svga/svga_draw_elements.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_upload_mgr.h" #include "indices/u_indices.h" diff --git a/src/gallium/drivers/svga/svga_pipe_blend.c b/src/gallium/drivers/svga/svga_pipe_blend.c index 9df5485f462..9dd6fb068c5 100644 --- a/src/gallium/drivers/svga/svga_pipe_blend.c +++ b/src/gallium/drivers/svga/svga_pipe_blend.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/svga/svga_pipe_constants.c b/src/gallium/drivers/svga/svga_pipe_constants.c index 9022f7c4394..73a0cd6b3a8 100644 --- a/src/gallium/drivers/svga/svga_pipe_constants.c +++ b/src/gallium/drivers/svga/svga_pipe_constants.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/svga/svga_pipe_depthstencil.c b/src/gallium/drivers/svga/svga_pipe_depthstencil.c index 34e60cb341a..12bbd233a58 100644 --- a/src/gallium/drivers/svga/svga_pipe_depthstencil.c +++ b/src/gallium/drivers/svga/svga_pipe_depthstencil.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c index 4e0c499dc3e..f1d23c0e743 100644 --- a/src/gallium/drivers/svga/svga_pipe_draw.c +++ b/src/gallium/drivers/svga/svga_pipe_draw.c @@ -25,7 +25,7 @@ #include "svga_cmd.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_prim.h" #include "util/u_time.h" #include "indices/u_indices.h" diff --git a/src/gallium/drivers/svga/svga_pipe_fs.c b/src/gallium/drivers/svga/svga_pipe_fs.c index 32f07fb2616..2baeb4aa6c3 100644 --- a/src/gallium/drivers/svga/svga_pipe_fs.c +++ b/src/gallium/drivers/svga/svga_pipe_fs.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_memory.h" #include "util/u_bitmask.h" diff --git a/src/gallium/drivers/svga/svga_pipe_misc.c b/src/gallium/drivers/svga/svga_pipe_misc.c index 8cf1f2e083a..49b43bebc29 100644 --- a/src/gallium/drivers/svga/svga_pipe_misc.c +++ b/src/gallium/drivers/svga/svga_pipe_misc.c @@ -25,6 +25,8 @@ #include "svga_cmd.h" +#include "util/u_inlines.h" + #include "svga_context.h" #include "svga_screen_texture.h" diff --git a/src/gallium/drivers/svga/svga_pipe_rasterizer.c b/src/gallium/drivers/svga/svga_pipe_rasterizer.c index 9ea11aad9a9..2f0b54092b6 100644 --- a/src/gallium/drivers/svga/svga_pipe_rasterizer.c +++ b/src/gallium/drivers/svga/svga_pipe_rasterizer.c @@ -24,7 +24,7 @@ **********************************************************/ #include "draw/draw_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c index 161c66dd4ff..b70081343d1 100644 --- a/src/gallium/drivers/svga/svga_pipe_sampler.c +++ b/src/gallium/drivers/svga/svga_pipe_sampler.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/svga/svga_pipe_vertex.c b/src/gallium/drivers/svga/svga_pipe_vertex.c index 724166a3352..ffc0f99565b 100644 --- a/src/gallium/drivers/svga/svga_pipe_vertex.c +++ b/src/gallium/drivers/svga/svga_pipe_vertex.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/svga/svga_pipe_vs.c b/src/gallium/drivers/svga/svga_pipe_vs.c index c4ac5304ac6..de8c919e125 100644 --- a/src/gallium/drivers/svga/svga_pipe_vs.c +++ b/src/gallium/drivers/svga/svga_pipe_vs.c @@ -24,7 +24,7 @@ **********************************************************/ #include "draw/draw_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_memory.h" #include "util/u_bitmask.h" diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index c9db9ac8747..6933d515629 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -24,7 +24,7 @@ **********************************************************/ #include "util/u_memory.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_string.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index 430a6970fde..73f939cd8b9 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -27,7 +27,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_thread.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index 0d69007fd87..2d8705f99bc 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -27,7 +27,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_thread.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/svga/svga_screen_texture.h b/src/gallium/drivers/svga/svga_screen_texture.h index 89ae24219fd..43853d48f88 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.h +++ b/src/gallium/drivers/svga/svga_screen_texture.h @@ -29,6 +29,7 @@ #include "pipe/p_compiler.h" #include "pipe/p_state.h" +#include "util/u_inlines.h" #include "svga_screen_cache.h" struct pipe_context; diff --git a/src/gallium/drivers/svga/svga_state_constants.c b/src/gallium/drivers/svga/svga_state_constants.c index 6b0e511cec1..bb92f818eae 100644 --- a/src/gallium/drivers/svga/svga_state_constants.c +++ b/src/gallium/drivers/svga/svga_state_constants.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "svga_context.h" diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c index eda1aefd67a..b4cafb8f219 100644 --- a/src/gallium/drivers/svga/svga_state_framebuffer.c +++ b/src/gallium/drivers/svga/svga_state_framebuffer.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/svga/svga_state_fs.c b/src/gallium/drivers/svga/svga_state_fs.c index ec2886348b9..adc7120217b 100644 --- a/src/gallium/drivers/svga/svga_state_fs.c +++ b/src/gallium/drivers/svga/svga_state_fs.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" #include "util/u_bitmask.h" diff --git a/src/gallium/drivers/svga/svga_state_need_swtnl.c b/src/gallium/drivers/svga/svga_state_need_swtnl.c index 3c35a8579f7..dd13a89d24d 100644 --- a/src/gallium/drivers/svga/svga_state_need_swtnl.c +++ b/src/gallium/drivers/svga/svga_state_need_swtnl.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_state.h" diff --git a/src/gallium/drivers/svga/svga_state_rss.c b/src/gallium/drivers/svga/svga_state_rss.c index 2f9adaeb561..ff656a7e053 100644 --- a/src/gallium/drivers/svga/svga_state_rss.c +++ b/src/gallium/drivers/svga/svga_state_rss.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/svga/svga_state_tss.c b/src/gallium/drivers/svga/svga_state_tss.c index b3c9687b1a4..17b47859781 100644 --- a/src/gallium/drivers/svga/svga_state_tss.c +++ b/src/gallium/drivers/svga/svga_state_tss.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/svga/svga_state_vdecl.c b/src/gallium/drivers/svga/svga_state_vdecl.c index c534308f503..d1066ce13b0 100644 --- a/src/gallium/drivers/svga/svga_state_vdecl.c +++ b/src/gallium/drivers/svga/svga_state_vdecl.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" #include "util/u_upload_mgr.h" diff --git a/src/gallium/drivers/svga/svga_state_vs.c b/src/gallium/drivers/svga/svga_state_vs.c index e7e6c084321..d7999fe53d2 100644 --- a/src/gallium/drivers/svga/svga_state_vs.c +++ b/src/gallium/drivers/svga/svga_state_vs.c @@ -23,7 +23,7 @@ * **********************************************************/ -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/svga/svga_swtnl_backend.c b/src/gallium/drivers/svga/svga_swtnl_backend.c index aafb3e26b0b..e9d7942fb57 100644 --- a/src/gallium/drivers/svga/svga_swtnl_backend.c +++ b/src/gallium/drivers/svga/svga_swtnl_backend.c @@ -28,7 +28,7 @@ #include "draw/draw_vertex.h" #include "util/u_debug.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c index 5e6e30c7dfb..da15be155c8 100644 --- a/src/gallium/drivers/svga/svga_swtnl_draw.c +++ b/src/gallium/drivers/svga/svga_swtnl_draw.c @@ -25,7 +25,7 @@ #include "draw/draw_context.h" #include "draw/draw_vbuf.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_state.h" #include "svga_context.h" diff --git a/src/gallium/drivers/svga/svga_swtnl_state.c b/src/gallium/drivers/svga/svga_swtnl_state.c index fe03e207fff..35f36a828fd 100644 --- a/src/gallium/drivers/svga/svga_swtnl_state.c +++ b/src/gallium/drivers/svga/svga_swtnl_state.c @@ -25,7 +25,7 @@ #include "draw/draw_context.h" #include "draw/draw_vbuf.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_state.h" #include "svga_context.h" diff --git a/src/gallium/drivers/trace/tr_buffer.c b/src/gallium/drivers/trace/tr_buffer.c index 4f0eff6a5a4..fa2ac068ebc 100644 --- a/src/gallium/drivers/trace/tr_buffer.c +++ b/src/gallium/drivers/trace/tr_buffer.c @@ -26,6 +26,7 @@ **************************************************************************/ +#include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_simple_list.h" diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index 117503aaff6..6cdb4c04a81 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -35,7 +35,7 @@ #include "tr_texture.h" #include "tr_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_format.h" diff --git a/src/gallium/drivers/trace/tr_texture.c b/src/gallium/drivers/trace/tr_texture.c index 1f25fe38d4c..5321d68ec0c 100644 --- a/src/gallium/drivers/trace/tr_texture.c +++ b/src/gallium/drivers/trace/tr_texture.c @@ -25,6 +25,7 @@ * **************************************************************************/ +#include "util/u_inlines.h" #include "util/u_hash_table.h" #include "util/u_memory.h" #include "util/u_simple_list.h" diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h deleted file mode 100644 index 72f5c1dc2a2..00000000000 --- a/src/gallium/include/pipe/p_inlines.h +++ /dev/null @@ -1,224 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#ifndef P_INLINES_H -#define P_INLINES_H - -#include "p_context.h" -#include "p_defines.h" -#include "p_screen.h" - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * Convenience wrappers for screen buffer functions. - */ - -static INLINE struct pipe_buffer * -pipe_buffer_create( struct pipe_screen *screen, - unsigned alignment, unsigned usage, unsigned size ) -{ - return screen->buffer_create(screen, alignment, usage, size); -} - -static INLINE struct pipe_buffer * -pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size ) -{ - return screen->user_buffer_create(screen, ptr, size); -} - -static INLINE void * -pipe_buffer_map(struct pipe_screen *screen, - struct pipe_buffer *buf, - unsigned usage) -{ - if(screen->buffer_map_range) { - unsigned offset = 0; - unsigned length = buf->size; - return screen->buffer_map_range(screen, buf, offset, length, usage); - } - else - return screen->buffer_map(screen, buf, usage); -} - -static INLINE void -pipe_buffer_unmap(struct pipe_screen *screen, - struct pipe_buffer *buf) -{ - screen->buffer_unmap(screen, buf); -} - -static INLINE void * -pipe_buffer_map_range(struct pipe_screen *screen, - struct pipe_buffer *buf, - unsigned offset, - unsigned length, - unsigned usage) -{ - assert(offset < buf->size); - assert(offset + length <= buf->size); - assert(length); - if(screen->buffer_map_range) - return screen->buffer_map_range(screen, buf, offset, length, usage); - else - return screen->buffer_map(screen, buf, usage); -} - -static INLINE void -pipe_buffer_flush_mapped_range(struct pipe_screen *screen, - struct pipe_buffer *buf, - unsigned offset, - unsigned length) -{ - assert(offset < buf->size); - assert(offset + length <= buf->size); - assert(length); - if(screen->buffer_flush_mapped_range) - screen->buffer_flush_mapped_range(screen, buf, offset, length); -} - -static INLINE void -pipe_buffer_write(struct pipe_screen *screen, - struct pipe_buffer *buf, - unsigned offset, unsigned size, - const void *data) -{ - void *map; - - assert(offset < buf->size); - assert(offset + size <= buf->size); - assert(size); - - map = pipe_buffer_map_range(screen, buf, offset, size, - PIPE_BUFFER_USAGE_CPU_WRITE | - PIPE_BUFFER_USAGE_FLUSH_EXPLICIT | - PIPE_BUFFER_USAGE_DISCARD); - assert(map); - if(map) { - memcpy((uint8_t *)map + offset, data, size); - pipe_buffer_flush_mapped_range(screen, buf, offset, size); - pipe_buffer_unmap(screen, buf); - } -} - -/** - * Special case for writing non-overlapping ranges. - * - * We can avoid GPU/CPU synchronization when writing range that has never - * been written before. - */ -static INLINE void -pipe_buffer_write_nooverlap(struct pipe_screen *screen, - struct pipe_buffer *buf, - unsigned offset, unsigned size, - const void *data) -{ - void *map; - - assert(offset < buf->size); - assert(offset + size <= buf->size); - assert(size); - - map = pipe_buffer_map_range(screen, buf, offset, size, - PIPE_BUFFER_USAGE_CPU_WRITE | - PIPE_BUFFER_USAGE_FLUSH_EXPLICIT | - PIPE_BUFFER_USAGE_DISCARD | - PIPE_BUFFER_USAGE_UNSYNCHRONIZED); - assert(map); - if(map) { - memcpy((uint8_t *)map + offset, data, size); - pipe_buffer_flush_mapped_range(screen, buf, offset, size); - pipe_buffer_unmap(screen, buf); - } -} - -static INLINE void -pipe_buffer_read(struct pipe_screen *screen, - struct pipe_buffer *buf, - unsigned offset, unsigned size, - void *data) -{ - void *map; - - assert(offset < buf->size); - assert(offset + size <= buf->size); - assert(size); - - map = pipe_buffer_map_range(screen, buf, offset, size, PIPE_BUFFER_USAGE_CPU_READ); - assert(map); - if(map) { - memcpy(data, (const uint8_t *)map + offset, size); - pipe_buffer_unmap(screen, buf); - } -} - -static INLINE void * -pipe_transfer_map( struct pipe_transfer *transf ) -{ - struct pipe_screen *screen = transf->texture->screen; - return screen->transfer_map(screen, transf); -} - -static INLINE void -pipe_transfer_unmap( struct pipe_transfer *transf ) -{ - struct pipe_screen *screen = transf->texture->screen; - screen->transfer_unmap(screen, transf); -} - -static INLINE void -pipe_transfer_destroy( struct pipe_transfer *transf ) -{ - struct pipe_screen *screen = transf->texture->screen; - screen->tex_transfer_destroy(transf); -} - -static INLINE unsigned -pipe_transfer_buffer_flags( struct pipe_transfer *transf ) -{ - switch (transf->usage & PIPE_TRANSFER_READ_WRITE) { - case PIPE_TRANSFER_READ_WRITE: - return PIPE_BUFFER_USAGE_CPU_READ | PIPE_BUFFER_USAGE_CPU_WRITE; - case PIPE_TRANSFER_READ: - return PIPE_BUFFER_USAGE_CPU_READ; - case PIPE_TRANSFER_WRITE: - return PIPE_BUFFER_USAGE_CPU_WRITE; - default: - debug_assert(0); - return 0; - } -} - -#ifdef __cplusplus -} -#endif - -#endif /* P_INLINES_H */ diff --git a/src/gallium/include/pipe/p_refcnt.h b/src/gallium/include/pipe/p_refcnt.h index 468e8d87f9e..6609f94510a 100644 --- a/src/gallium/include/pipe/p_refcnt.h +++ b/src/gallium/include/pipe/p_refcnt.h @@ -45,50 +45,6 @@ struct pipe_reference }; -static INLINE void -pipe_reference_init(struct pipe_reference *reference, unsigned count) -{ - p_atomic_set(&reference->count, count); -} - - -static INLINE boolean -pipe_is_referenced(struct pipe_reference *reference) -{ - return p_atomic_read(&reference->count) != 0; -} - - -/** - * Update reference counting. - * The old thing pointed to, if any, will be unreferenced. - * Both 'ptr' and 'reference' may be NULL. - * \return TRUE if the object's refcount hits zero and should be destroyed. - */ -static INLINE boolean -pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference) -{ - boolean destroy = FALSE; - - if(ptr != reference) { - /* bump the reference.count first */ - if (reference) { - assert(pipe_is_referenced(reference)); - p_atomic_inc(&reference->count); - } - - if (ptr) { - assert(pipe_is_referenced(ptr)); - if (p_atomic_dec_zero(&ptr->count)) { - destroy = TRUE; - } - } - } - - return destroy; -} - - #ifdef __cplusplus } #endif diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 03cd74efed3..f293df57334 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -383,38 +383,6 @@ struct pipe_vertex_element }; -/* Reference counting helper functions */ -static INLINE void -pipe_buffer_reference(struct pipe_buffer **ptr, struct pipe_buffer *buf) -{ - struct pipe_buffer *old_buf = *ptr; - - if (pipe_reference(&(*ptr)->reference, &buf->reference)) - old_buf->screen->buffer_destroy(old_buf); - *ptr = buf; -} - -static INLINE void -pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf) -{ - struct pipe_surface *old_surf = *ptr; - - if (pipe_reference(&(*ptr)->reference, &surf->reference)) - old_surf->texture->screen->tex_surface_destroy(old_surf); - *ptr = surf; -} - -static INLINE void -pipe_texture_reference(struct pipe_texture **ptr, struct pipe_texture *tex) -{ - struct pipe_texture *old_tex = *ptr; - - if (pipe_reference(&(*ptr)->reference, &tex->reference)) - old_tex->screen->texture_destroy(old_tex); - *ptr = tex; -} - - #ifdef __cplusplus } #endif diff --git a/src/gallium/include/pipe/p_video_state.h b/src/gallium/include/pipe/p_video_state.h index 86293821192..842860f74bd 100644 --- a/src/gallium/include/pipe/p_video_state.h +++ b/src/gallium/include/pipe/p_video_state.h @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/src/gallium/state_trackers/egl/x11/sw_winsys.c b/src/gallium/state_trackers/egl/x11/sw_winsys.c index 6ee3ede38cb..6cf8e5c6c9f 100644 --- a/src/gallium/state_trackers/egl/x11/sw_winsys.c +++ b/src/gallium/state_trackers/egl/x11/sw_winsys.c @@ -37,7 +37,7 @@ #include "pipe/internal/p_winsys_screen.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/state_trackers/python/gallium.i b/src/gallium/state_trackers/python/gallium.i index 68797228459..99e177b0be4 100644 --- a/src/gallium/state_trackers/python/gallium.i +++ b/src/gallium/state_trackers/python/gallium.i @@ -40,9 +40,9 @@ #include "pipe/p_screen.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" #include "pipe/p_shader_tokens.h" #include "cso_cache/cso_context.h" +#include "util/u_inlines.h" #include "util/u_draw_quad.h" #include "util/u_tile.h" #include "util/u_math.h" diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index e41125f6f99..467e20207a3 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -29,7 +29,7 @@ #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_shader_tokens.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "cso_cache/cso_context.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/state_trackers/python/st_llvmpipe_winsys.c b/src/gallium/state_trackers/python/st_llvmpipe_winsys.c index 0096b18c994..c5ee1679f04 100644 --- a/src/gallium/state_trackers/python/st_llvmpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_llvmpipe_winsys.c @@ -36,7 +36,7 @@ #include "pipe/p_format.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_memory.h" #include "llvmpipe/lp_winsys.h" diff --git a/src/gallium/state_trackers/python/st_sample.c b/src/gallium/state_trackers/python/st_sample.c index 96377414211..32a6551a87a 100644 --- a/src/gallium/state_trackers/python/st_sample.c +++ b/src/gallium/state_trackers/python/st_sample.c @@ -29,7 +29,7 @@ #include "pipe/p_compiler.h" #include "pipe/p_format.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_tile.h" #include "util/u_math.h" diff --git a/src/gallium/state_trackers/vega/api_filters.c b/src/gallium/state_trackers/vega/api_filters.c index cf4a11bb142..20c72c1ff54 100644 --- a/src/gallium/state_trackers/vega/api_filters.c +++ b/src/gallium/state_trackers/vega/api_filters.c @@ -34,7 +34,7 @@ #include "pipe/p_context.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_screen.h" #include "pipe/p_shader_tokens.h" diff --git a/src/gallium/state_trackers/vega/api_images.c b/src/gallium/state_trackers/vega/api_images.c index c437553bc23..015241498ed 100644 --- a/src/gallium/state_trackers/vega/api_images.c +++ b/src/gallium/state_trackers/vega/api_images.c @@ -35,7 +35,7 @@ #include "pipe/p_context.h" #include "pipe/p_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_blit.h" #include "util/u_tile.h" #include "util/u_memory.h" diff --git a/src/gallium/state_trackers/vega/api_masks.c b/src/gallium/state_trackers/vega/api_masks.c index e6070c7353b..9c123a4cf95 100644 --- a/src/gallium/state_trackers/vega/api_masks.c +++ b/src/gallium/state_trackers/vega/api_masks.c @@ -31,7 +31,7 @@ #include "vg_context.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_pack_color.h" #include "util/u_draw_quad.h" diff --git a/src/gallium/state_trackers/vega/api_path.c b/src/gallium/state_trackers/vega/api_path.c index 15ac1900f4b..58ebb3b60ea 100644 --- a/src/gallium/state_trackers/vega/api_path.c +++ b/src/gallium/state_trackers/vega/api_path.c @@ -32,7 +32,7 @@ #include "paint.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_draw_quad.h" VGPath vgCreatePath(VGint pathFormat, diff --git a/src/gallium/state_trackers/vega/image.c b/src/gallium/state_trackers/vega/image.c index 1112ad9839d..2e10965be4f 100644 --- a/src/gallium/state_trackers/vega/image.c +++ b/src/gallium/state_trackers/vega/image.c @@ -37,7 +37,7 @@ #include "pipe/p_context.h" #include "pipe/p_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_blit.h" #include "util/u_format.h" #include "util/u_tile.h" diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c index ba8ecef1d2d..467b95b7519 100644 --- a/src/gallium/state_trackers/vega/mask.c +++ b/src/gallium/state_trackers/vega/mask.c @@ -35,7 +35,7 @@ #include "pipe/p_context.h" #include "pipe/p_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_memory.h" diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c index d8f6299b2db..3405d635f0c 100644 --- a/src/gallium/state_trackers/vega/paint.c +++ b/src/gallium/state_trackers/vega/paint.c @@ -32,7 +32,7 @@ #include "st_inlines.h" #include "pipe/p_compiler.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_memory.h" diff --git a/src/gallium/state_trackers/vega/polygon.c b/src/gallium/state_trackers/vega/polygon.c index f5352ee84e5..f56ea0c8b44 100644 --- a/src/gallium/state_trackers/vega/polygon.c +++ b/src/gallium/state_trackers/vega/polygon.c @@ -37,7 +37,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_screen.h" #include "util/u_draw_quad.h" diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c index 47e18dc1e23..05620efa9c0 100644 --- a/src/gallium/state_trackers/vega/renderer.c +++ b/src/gallium/state_trackers/vega/renderer.c @@ -30,7 +30,7 @@ #include "pipe/p_context.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_screen.h" #include "pipe/p_shader_tokens.h" diff --git a/src/gallium/state_trackers/vega/shader.c b/src/gallium/state_trackers/vega/shader.c index 8e59d53dc7a..0e71a507bff 100644 --- a/src/gallium/state_trackers/vega/shader.c +++ b/src/gallium/state_trackers/vega/shader.c @@ -35,7 +35,7 @@ #include "pipe/p_context.h" #include "pipe/p_screen.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #define MAX_CONSTANTS 20 diff --git a/src/gallium/state_trackers/vega/shaders_cache.c b/src/gallium/state_trackers/vega/shaders_cache.c index f620075d0bc..593e60fc63a 100644 --- a/src/gallium/state_trackers/vega/shaders_cache.c +++ b/src/gallium/state_trackers/vega/shaders_cache.c @@ -30,7 +30,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_screen.h" #include "pipe/p_shader_tokens.h" diff --git a/src/gallium/state_trackers/vega/st_inlines.h b/src/gallium/state_trackers/vega/st_inlines.h index 610755e0636..419151c3aee 100644 --- a/src/gallium/state_trackers/vega/st_inlines.h +++ b/src/gallium/state_trackers/vega/st_inlines.h @@ -38,7 +38,7 @@ #include "pipe/p_context.h" #include "pipe/p_screen.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_state.h" static INLINE struct pipe_transfer * diff --git a/src/gallium/state_trackers/vega/vg_context.c b/src/gallium/state_trackers/vega/vg_context.c index 64207d97bac..426bf9bc62b 100644 --- a/src/gallium/state_trackers/vega/vg_context.c +++ b/src/gallium/state_trackers/vega/vg_context.c @@ -34,7 +34,7 @@ #include "st_inlines.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "cso_cache/cso_context.h" diff --git a/src/gallium/state_trackers/vega/vg_tracker.c b/src/gallium/state_trackers/vega/vg_tracker.c index 617c174eb6a..a94dfb160c9 100644 --- a/src/gallium/state_trackers/vega/vg_tracker.c +++ b/src/gallium/state_trackers/vega/vg_tracker.c @@ -29,7 +29,7 @@ #include "mask.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_screen.h" #include "util/u_format.h" #include "util/u_memory.h" diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index 2395d549752..221ce772af9 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -49,7 +49,7 @@ #include #endif -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_rect.h" #ifdef HAVE_LIBKMS diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index 59588f0ff75..7457fe1c6d6 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -38,7 +38,7 @@ #include "dri2.h" #include "pipe/p_state.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c index a3c3993ab81..83b0d31e38d 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.c +++ b/src/gallium/state_trackers/xorg/xorg_renderer.c @@ -9,7 +9,7 @@ #include "util/u_memory.h" #include "util/u_rect.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h index de71cb2f42d..9379021911a 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h @@ -34,7 +34,7 @@ #include "pipe/internal/p_winsys_screen.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipebuffer/pb_buffer.h" diff --git a/src/gallium/winsys/drm/vmware/core/vmw_buffer.c b/src/gallium/winsys/drm/vmware/core/vmw_buffer.c index b812fb59d39..eca174a6c56 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_buffer.c +++ b/src/gallium/winsys/drm/vmware/core/vmw_buffer.c @@ -41,7 +41,7 @@ #include "svga_cmd.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "pipebuffer/pb_buffer.h" #include "pipebuffer/pb_bufmgr.h" diff --git a/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c b/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c index d9abde30793..454e9a5236d 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c +++ b/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c @@ -25,7 +25,7 @@ #include "pipe/p_compiler.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_memory.h" #include "vmw_screen.h" diff --git a/src/gallium/winsys/drm/vmware/core/vmw_screen_svga.c b/src/gallium/winsys/drm/vmware/core/vmw_screen_svga.c index d7d008859b3..2b4e80f0039 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_screen_svga.c +++ b/src/gallium/winsys/drm/vmware/core/vmw_screen_svga.c @@ -36,7 +36,7 @@ #include "svga_cmd.h" #include "svga3d_caps.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_memory.h" #include "pipebuffer/pb_buffer.h" diff --git a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c index f15bcd37b50..6a7e8c9b592 100644 --- a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c +++ b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c index 7d076be3a31..33c83210eb3 100644 --- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c @@ -38,7 +38,7 @@ #include "pipe/p_format.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c index 2ad794c3f0f..4db9776280b 100644 --- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c @@ -41,7 +41,7 @@ #include "pipe/internal/p_winsys_screen.h" #include "pipe/p_format.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/winsys/xlib/xlib_brw_context.c b/src/gallium/winsys/xlib/xlib_brw_context.c index fc9addd09e3..5558654d7b7 100644 --- a/src/gallium/winsys/xlib/xlib_brw_context.c +++ b/src/gallium/winsys/xlib/xlib_brw_context.c @@ -37,7 +37,7 @@ /* #include "xmesaP.h" */ #include "pipe/internal/p_winsys_screen.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_memory.h" #include "i965simple/brw_winsys.h" diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c index 47ae0519a4b..8dc18efbf3d 100644 --- a/src/gallium/winsys/xlib/xlib_cell.c +++ b/src/gallium/winsys/xlib/xlib_cell.c @@ -44,7 +44,7 @@ #include "pipe/internal/p_winsys_screen.h" #include "pipe/p_format.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/winsys/xlib/xlib_llvmpipe.c b/src/gallium/winsys/xlib/xlib_llvmpipe.c index 2a434b5fd21..cdf92d8b5e3 100644 --- a/src/gallium/winsys/xlib/xlib_llvmpipe.c +++ b/src/gallium/winsys/xlib/xlib_llvmpipe.c @@ -43,7 +43,7 @@ #include "pipe/internal/p_winsys_screen.h" #include "pipe/p_format.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c index bf78aca6869..87a1325ca4d 100644 --- a/src/gallium/winsys/xlib/xlib_softpipe.c +++ b/src/gallium/winsys/xlib/xlib_softpipe.c @@ -41,7 +41,7 @@ #include "pipe/internal/p_winsys_screen.h" #include "pipe/p_format.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/mesa/es/state_tracker/st_cb_drawtex.c b/src/mesa/es/state_tracker/st_cb_drawtex.c index 3b98b9c40b3..0a5cba9d927 100644 --- a/src/mesa/es/state_tracker/st_cb_drawtex.c +++ b/src/mesa/es/state_tracker/st_cb_drawtex.c @@ -31,7 +31,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "util/u_tile.h" #include "util/u_draw_quad.h" diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index d70cf877e84..d975cd66f7d 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -37,7 +37,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "st_debug.h" #include "st_context.h" diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 8d045f2c6c0..fba7bfe2cea 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -40,6 +40,7 @@ #include "cso_cache/cso_context.h" #include "util/u_rect.h" #include "util/u_math.h" +#include "util/u_inlines.h" diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index 0b68447d212..57b71c1e7b0 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -39,6 +39,7 @@ #include "st_texture.h" #include "st_cb_texture.h" #include "pipe/p_context.h" +#include "util/u_inlines.h" #include "cso_cache/cso_context.h" diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index 798081ec899..1be72e729e4 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -43,7 +43,7 @@ #include "st_inlines.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_tile.h" diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index d1b35f796ec..c70bbc880c0 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -47,7 +47,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_draw_quad.h" #include "util/u_simple_shaders.h" #include "shader/prog_instruction.h" diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index 65aa2a28ac2..41696916484 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -41,6 +41,7 @@ #include "st_cb_fbo.h" #include "util/u_blit.h" +#include "util/u_inlines.h" #include "cso_cache/cso_context.h" diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 0102d8a6f7d..3ff589034ae 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -42,7 +42,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" /** diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 94693d91f39..0c7bcb85973 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -47,7 +47,7 @@ #include "st_inlines.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_state.h" #include "pipe/p_defines.h" #include "util/u_format.h" diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 7afdc31ede9..9b1d2103f17 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -53,7 +53,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "tgsi/tgsi_ureg.h" #include "util/u_tile.h" #include "util/u_draw_quad.h" diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index f7350ef1e3c..9f2fe7420d4 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -50,6 +50,7 @@ #include "util/u_format.h" #include "util/u_rect.h" +#include "util/u_inlines.h" /** diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 8eb825a6a41..6b1fdf3ecd0 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -40,7 +40,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_tile.h" #include "st_debug.h" diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index cee2452eafe..7c5664be1d8 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -57,7 +57,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_shader_tokens.h" #include "util/u_tile.h" #include "util/u_blit.h" diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index a62ff248ce5..8f6a0c2423b 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -63,6 +63,7 @@ #include "st_gen_mipmap.h" #include "st_program.h" #include "pipe/p_context.h" +#include "util/u_inlines.h" #include "draw/draw_context.h" #include "cso_cache/cso_context.h" diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 381c68474d6..e1dcb154c1b 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -55,7 +55,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" static GLuint double_types[4] = { diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index cdaee2a353e..75ad1a97cf2 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -39,7 +39,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "draw/draw_private.h" #include "draw/draw_context.h" diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index 835142e3d41..ed9c0ff5b76 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -35,6 +35,7 @@ #include "st_cb_fbo.h" #include "st_public.h" #include "pipe/p_defines.h" +#include "util/u_inlines.h" struct st_framebuffer * diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index 3823a59d37a..f67d7b4cb5c 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -36,7 +36,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_gen_mipmap.h" #include "util/u_math.h" diff --git a/src/mesa/state_tracker/st_inlines.h b/src/mesa/state_tracker/st_inlines.h index dccc46f12d7..e105870bc75 100644 --- a/src/mesa/state_tracker/st_inlines.h +++ b/src/mesa/state_tracker/st_inlines.h @@ -36,7 +36,7 @@ #include "pipe/p_context.h" #include "pipe/p_screen.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "pipe/p_state.h" #include "st_context.h" diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index b210ac91873..5a45c4358a9 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -41,7 +41,7 @@ #include "pipe/p_state.h" #include "pipe/p_context.h" #include "pipe/p_defines.h" -#include "pipe/p_inlines.h" +#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_rect.h" #include "util/u_math.h" -- cgit v1.2.3 From 38f6f23fcf37247fd709d1c612d08bfa9b124e69 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 2 Feb 2010 14:43:48 +0000 Subject: gallium: Make pipe_atomic a regular int32_t. --- src/gallium/auxiliary/draw/draw_pipe.c | 1 + src/gallium/auxiliary/tgsi/tgsi_ureg.c | 1 + src/gallium/auxiliary/tgsi/tgsi_ureg.h | 1 + src/gallium/auxiliary/util/u_inlines.h | 3 + src/gallium/auxiliary/util/u_simple_shaders.c | 1 + src/gallium/drivers/i965/brw_winsys.h | 1 - src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c | 1 + .../drivers/llvmpipe/lp_bld_blend_logicop.c | 1 + src/gallium/drivers/llvmpipe/lp_bld_blend_soa.c | 1 + src/gallium/drivers/trace/tr_dump_state.c | 2 +- src/gallium/include/pipe/p_atomic.h | 121 ++++++++------------- src/gallium/include/pipe/p_refcnt.h | 52 --------- src/gallium/include/pipe/p_state.h | 7 +- src/gallium/include/pipe/p_video_state.h | 2 +- src/gallium/winsys/drm/intel/gem/intel_drm_fence.c | 2 +- src/gallium/winsys/drm/vmware/core/vmw_surface.h | 4 +- 16 files changed, 67 insertions(+), 134 deletions(-) delete mode 100644 src/gallium/include/pipe/p_refcnt.h (limited to 'src/gallium/drivers') diff --git a/src/gallium/auxiliary/draw/draw_pipe.c b/src/gallium/auxiliary/draw/draw_pipe.c index 11d6485dcf0..83dc1a35f4c 100644 --- a/src/gallium/auxiliary/draw/draw_pipe.c +++ b/src/gallium/auxiliary/draw/draw_pipe.c @@ -32,6 +32,7 @@ #include "draw/draw_private.h" #include "draw/draw_pipe.h" +#include "util/u_debug.h" diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index 0ae46785bbe..60a1cb1af4f 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -33,6 +33,7 @@ #include "tgsi/tgsi_info.h" #include "tgsi/tgsi_dump.h" #include "tgsi/tgsi_sanity.h" +#include "util/u_debug.h" #include "util/u_memory.h" #include "util/u_math.h" diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h index e25f35c6dc3..6198ca34642 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h @@ -30,6 +30,7 @@ #include "pipe/p_compiler.h" #include "pipe/p_shader_tokens.h" +#include "util/u_debug.h" #ifdef __cplusplus extern "C" { diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 53f0de42151..72a4d6d5083 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -30,7 +30,10 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" +#include "pipe/p_state.h" #include "pipe/p_screen.h" +#include "util/u_debug.h" +#include "pipe/p_atomic.h" #ifdef __cplusplus diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c index b751e29ab62..019dda767d0 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.c +++ b/src/gallium/auxiliary/util/u_simple_shaders.c @@ -38,6 +38,7 @@ #include "pipe/p_context.h" #include "pipe/p_shader_tokens.h" #include "util/u_simple_shaders.h" +#include "util/u_debug.h" #include "tgsi/tgsi_ureg.h" diff --git a/src/gallium/drivers/i965/brw_winsys.h b/src/gallium/drivers/i965/brw_winsys.h index 1c63f03429e..8841de2611e 100644 --- a/src/gallium/drivers/i965/brw_winsys.h +++ b/src/gallium/drivers/i965/brw_winsys.h @@ -28,7 +28,6 @@ #include "pipe/p_compiler.h" #include "pipe/p_defines.h" -#include "pipe/p_refcnt.h" #include "util/u_inlines.h" struct brw_winsys; diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c index ad1dbbc9b19..0215bb72ac6 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c @@ -44,6 +44,7 @@ #include "pipe/p_state.h" +#include "util/u_debug.h" #include "lp_bld_type.h" #include "lp_bld_const.h" diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c b/src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c index 88321f62a2c..1eac0a5c891 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_blend_logicop.c @@ -35,6 +35,7 @@ #include "pipe/p_state.h" +#include "util/u_debug.h" #include "lp_bld_blend.h" diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_blend_soa.c index a73d1158e79..6d5a45db7a3 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_blend_soa.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_blend_soa.c @@ -69,6 +69,7 @@ #include "pipe/p_state.h" +#include "util/u_debug.h" #include "lp_bld_type.h" #include "lp_bld_arit.h" diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index dbca5de0a52..c7364e2bd1d 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -49,7 +49,7 @@ static void trace_dump_reference(const struct pipe_reference *reference) return; trace_dump_struct_begin("pipe_reference"); - trace_dump_member(int, &reference->count, count); + trace_dump_member(int, reference, count); trace_dump_struct_end(); } diff --git a/src/gallium/include/pipe/p_atomic.h b/src/gallium/include/pipe/p_atomic.h index a4b769d0bf5..c0a0ac0edb3 100644 --- a/src/gallium/include/pipe/p_atomic.h +++ b/src/gallium/include/pipe/p_atomic.h @@ -44,41 +44,37 @@ extern "C" { #define PIPE_ATOMIC "GCC x86 assembly" -struct pipe_atomic { - int32_t count; -}; - -#define p_atomic_set(_v, _i) ((_v)->count = (_i)) -#define p_atomic_read(_v) ((_v)->count) +#define p_atomic_set(_v, _i) (*(_v) = (_i)) +#define p_atomic_read(_v) (*(_v)) static INLINE boolean -p_atomic_dec_zero(struct pipe_atomic *v) +p_atomic_dec_zero(int32_t *v) { unsigned char c; - __asm__ __volatile__("lock; decl %0; sete %1":"+m"(v->count), "=qm"(c) + __asm__ __volatile__("lock; decl %0; sete %1":"+m"(*v), "=qm"(c) ::"memory"); return c != 0; } static INLINE void -p_atomic_inc(struct pipe_atomic *v) +p_atomic_inc(int32_t *v) { - __asm__ __volatile__("lock; incl %0":"+m"(v->count)); + __asm__ __volatile__("lock; incl %0":"+m"(*v)); } static INLINE void -p_atomic_dec(struct pipe_atomic *v) +p_atomic_dec(int32_t *v) { - __asm__ __volatile__("lock; decl %0":"+m"(v->count)); + __asm__ __volatile__("lock; decl %0":"+m"(*v)); } static INLINE int32_t -p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t _new) +p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) { - return __sync_val_compare_and_swap(&v->count, old, _new); + return __sync_val_compare_and_swap(v, old, _new); } #endif @@ -90,36 +86,32 @@ p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t _new) #define PIPE_ATOMIC "GCC Sync Intrinsics" -struct pipe_atomic { - int32_t count; -}; - -#define p_atomic_set(_v, _i) ((_v)->count = (_i)) -#define p_atomic_read(_v) ((_v)->count) +#define p_atomic_set(_v, _i) (*(_v) = (_i)) +#define p_atomic_read(_v) (*(_v)) static INLINE boolean -p_atomic_dec_zero(struct pipe_atomic *v) +p_atomic_dec_zero(int32_t *v) { - return (__sync_sub_and_fetch(&v->count, 1) == 0); + return (__sync_sub_and_fetch(v, 1) == 0); } static INLINE void -p_atomic_inc(struct pipe_atomic *v) +p_atomic_inc(int32_t *v) { - (void) __sync_add_and_fetch(&v->count, 1); + (void) __sync_add_and_fetch(v, 1); } static INLINE void -p_atomic_dec(struct pipe_atomic *v) +p_atomic_dec(int32_t *v) { - (void) __sync_sub_and_fetch(&v->count, 1); + (void) __sync_sub_and_fetch(v, 1); } static INLINE int32_t -p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t _new) +p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) { - return __sync_val_compare_and_swap(&v->count, old, _new); + return __sync_val_compare_and_swap(v, old, _new); } #endif @@ -132,17 +124,12 @@ p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t _new) #define PIPE_ATOMIC "Unlocked" -struct pipe_atomic -{ - int32_t count; -}; - -#define p_atomic_set(_v, _i) ((_v)->count = (_i)) -#define p_atomic_read(_v) ((_v)->count) -#define p_atomic_dec_zero(_v) ((boolean) --(_v)->count) -#define p_atomic_inc(_v) ((void) (_v)->count++) -#define p_atomic_dec(_v) ((void) (_v)->count--) -#define p_atomic_cmpxchg(_v, old, _new) ((_v)->count == old ? (_v)->count = (_new) : (_v)->count) +#define p_atomic_set(_v, _i) (*(_v) = (_i)) +#define p_atomic_read(_v) (*(_v)) +#define p_atomic_dec_zero(_v) ((boolean) --(*(_v))) +#define p_atomic_inc(_v) ((void) (*(_v))++) +#define p_atomic_dec(_v) ((void) (*(_v))--) +#define p_atomic_cmpxchg(_v, old, _new) (*(_v) == old ? *(_v) = (_new) : *(_v)) #endif @@ -153,22 +140,16 @@ struct pipe_atomic #define PIPE_ATOMIC "MSVC x86 assembly" -struct pipe_atomic -{ - int32_t count; -}; - -#define p_atomic_set(_v, _i) ((_v)->count = (_i)) -#define p_atomic_read(_v) ((_v)->count) +#define p_atomic_set(_v, _i) (*(_v) = (_i)) +#define p_atomic_read(_v) (*(_v)) static INLINE boolean -p_atomic_dec_zero(struct pipe_atomic *v) +p_atomic_dec_zero(int32_t *v) { - int32_t *pcount = &v->count; unsigned char c; __asm { - mov eax, [pcount] + mov eax, [v] lock dec dword ptr [eax] sete byte ptr [c] } @@ -177,35 +158,30 @@ p_atomic_dec_zero(struct pipe_atomic *v) } static INLINE void -p_atomic_inc(struct pipe_atomic *v) +p_atomic_inc(int32_t *v) { - int32_t *pcount = &v->count; - __asm { - mov eax, [pcount] + mov eax, [v] lock inc dword ptr [eax] } } static INLINE void -p_atomic_dec(struct pipe_atomic *v) +p_atomic_dec(int32_t *v) { - int32_t *pcount = &v->count; - __asm { - mov eax, [pcount] + mov eax, [v] lock dec dword ptr [eax] } } static INLINE int32_t -p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t _new) +p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) { - int32_t *pcount = &v->count; int32_t orig; __asm { - mov ecx, [pcount] + mov ecx, [v] mov eax, [old] mov edx, [_new] lock cmpxchg [ecx], edx @@ -221,42 +197,37 @@ p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t _new) #define PIPE_ATOMIC "MSVC Intrinsics" -struct pipe_atomic -{ - int32_t count; -}; - #include #pragma intrinsic(_InterlockedIncrement) #pragma intrinsic(_InterlockedDecrement) #pragma intrinsic(_InterlockedCompareExchange) -#define p_atomic_set(_v, _i) ((_v)->count = (_i)) -#define p_atomic_read(_v) ((_v)->count) +#define p_atomic_set(_v, _i) (*(_v) = (_i)) +#define p_atomic_read(_v) (*(_v)) static INLINE boolean -p_atomic_dec_zero(struct pipe_atomic *v) +p_atomic_dec_zero(int32_t *v) { - return _InterlockedDecrement(&v->count) == 0; + return _InterlockedDecrement(v) == 0; } static INLINE void -p_atomic_inc(struct pipe_atomic *v) +p_atomic_inc(int32_t *v) { - _InterlockedIncrement(&v->count); + _InterlockedIncrement(v); } static INLINE void -p_atomic_dec(struct pipe_atomic *v) +p_atomic_dec(int32_t *v) { - _InterlockedDecrement(&v->count); + _InterlockedDecrement(v); } static INLINE int32_t -p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t _new) +p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) { - return _InterlockedCompareExchange(&v->count, _new, old); + return _InterlockedCompareExchange(v, _new, old); } #endif diff --git a/src/gallium/include/pipe/p_refcnt.h b/src/gallium/include/pipe/p_refcnt.h deleted file mode 100644 index 6609f94510a..00000000000 --- a/src/gallium/include/pipe/p_refcnt.h +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 VMware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#ifndef P_REFCNT_H -#define P_REFCNT_H - - -#include "p_defines.h" -#include "p_atomic.h" -#include "util/u_debug.h" /* FIXME: remove this */ - - -#ifdef __cplusplus -extern "C" { -#endif - - -struct pipe_reference -{ - struct pipe_atomic count; -}; - - -#ifdef __cplusplus -} -#endif - -#endif /* P_REFCNT_H */ diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index f293df57334..9ae096ee3cf 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -43,7 +43,6 @@ #include "p_compiler.h" #include "p_defines.h" #include "p_format.h" -#include "p_refcnt.h" #include "p_screen.h" @@ -66,6 +65,12 @@ extern "C" { #define PIPE_MAX_TEXTURE_LEVELS 16 +struct pipe_reference +{ + int32_t count; /* atomic */ +}; + + /** * The driver will certainly subclass this to include actual memory * management information. diff --git a/src/gallium/include/pipe/p_video_state.h b/src/gallium/include/pipe/p_video_state.h index 842860f74bd..77e22d0a566 100644 --- a/src/gallium/include/pipe/p_video_state.h +++ b/src/gallium/include/pipe/p_video_state.h @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include diff --git a/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c b/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c index e8b58742ab7..e7622766b82 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c +++ b/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c @@ -1,7 +1,7 @@ #include "intel_drm_winsys.h" #include "util/u_memory.h" -#include "pipe/p_refcnt.h" +#include "pipe/p_atomic.h" /** * Because gem does not have fence's we have to create our own fences. diff --git a/src/gallium/winsys/drm/vmware/core/vmw_surface.h b/src/gallium/winsys/drm/vmware/core/vmw_surface.h index 340cc1532e0..718c38767b3 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_surface.h +++ b/src/gallium/winsys/drm/vmware/core/vmw_surface.h @@ -37,7 +37,7 @@ #include "pipe/p_compiler.h" #include "pipe/p_atomic.h" -#include "pipe/p_refcnt.h" +#include "pipe/p_atomic.h" #define VMW_MAX_PRESENTS 3 @@ -45,7 +45,7 @@ struct vmw_svga_winsys_surface { - struct pipe_atomic validated; + int32_t validated; /* atomic */ struct pipe_reference refcnt; struct vmw_winsys_screen *screen; -- cgit v1.2.3 From 2aaca1df9df6980ec88180c8866c8987b31db91a Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 2 Feb 2010 15:18:01 +0000 Subject: gallium: Move p_thread.h and p_atomic.h out of gallium interfaces. Into os/os_thread.h and util/u_atomic.h respectively. --- src/gallium/auxiliary/draw/draw_pt_util.c | 1 + src/gallium/auxiliary/os/os_thread.h | 279 +++++++++++++++++++++ .../auxiliary/pipebuffer/pb_buffer_fenced.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c | 2 +- src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 2 +- src/gallium/auxiliary/rtasm/rtasm_execmem.c | 4 +- src/gallium/auxiliary/util/u_atomic.h | 247 ++++++++++++++++++ src/gallium/auxiliary/util/u_inlines.h | 2 +- src/gallium/auxiliary/util/u_ringbuffer.c | 2 +- src/gallium/drivers/svga/svga_screen.h | 2 +- src/gallium/drivers/svga/svga_screen_buffer.c | 2 +- src/gallium/drivers/svga/svga_screen_cache.h | 2 +- src/gallium/drivers/svga/svga_screen_texture.c | 2 +- src/gallium/drivers/trace/tr_dump.c | 2 +- src/gallium/drivers/trace/tr_screen.h | 2 +- src/gallium/include/pipe/p_atomic.h | 247 ------------------ src/gallium/include/pipe/p_thread.h | 279 --------------------- src/gallium/state_trackers/glx/xlib/xm_api.h | 2 +- src/gallium/state_trackers/wgl/stw_device.h | 2 +- src/gallium/state_trackers/wgl/stw_framebuffer.h | 2 +- src/gallium/winsys/drm/intel/gem/intel_drm_fence.c | 2 +- src/gallium/winsys/drm/vmware/core/vmw_surface.h | 4 +- 25 files changed, 549 insertions(+), 548 deletions(-) create mode 100644 src/gallium/auxiliary/os/os_thread.h create mode 100644 src/gallium/auxiliary/util/u_atomic.h delete mode 100644 src/gallium/include/pipe/p_atomic.h delete mode 100644 src/gallium/include/pipe/p_thread.h (limited to 'src/gallium/drivers') diff --git a/src/gallium/auxiliary/draw/draw_pt_util.c b/src/gallium/auxiliary/draw/draw_pt_util.c index 17c3b8cec26..3236d38e6ab 100644 --- a/src/gallium/auxiliary/draw/draw_pt_util.c +++ b/src/gallium/auxiliary/draw/draw_pt_util.c @@ -33,6 +33,7 @@ #include "draw/draw_context.h" #include "draw/draw_private.h" #include "draw/draw_pt.h" +#include "util/u_debug.h" void draw_pt_split_prim(unsigned prim, unsigned *first, unsigned *incr) { diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h new file mode 100644 index 00000000000..63108605d3a --- /dev/null +++ b/src/gallium/auxiliary/os/os_thread.h @@ -0,0 +1,279 @@ +/************************************************************************** + * + * Copyright 1999-2006 Brian Paul + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + +/** + * @file + * + * Thread, mutex, condition var and thread-specific data functions. + */ + + +#ifndef OS_THREAD_H_ +#define OS_THREAD_H_ + + +#include "pipe/p_compiler.h" +#include "util/u_debug.h" /* for assert */ + + +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) + +#include /* POSIX threads headers */ +#include /* for perror() */ + +#define PIPE_THREAD_HAVE_CONDVAR + +typedef pthread_t pipe_thread; + +#define PIPE_THREAD_ROUTINE( name, param ) \ + void *name( void *param ) + +static INLINE pipe_thread pipe_thread_create( void *(* routine)( void *), void *param ) +{ + pipe_thread thread; + if (pthread_create( &thread, NULL, routine, param )) + return 0; + return thread; +} + +static INLINE int pipe_thread_wait( pipe_thread thread ) +{ + return pthread_join( thread, NULL ); +} + +static INLINE int pipe_thread_destroy( pipe_thread thread ) +{ + return pthread_detach( thread ); +} + +typedef pthread_mutex_t pipe_mutex; +typedef pthread_cond_t pipe_condvar; + +#define pipe_static_mutex(mutex) \ + static pipe_mutex mutex = PTHREAD_MUTEX_INITIALIZER + +#define pipe_mutex_init(mutex) \ + (void) pthread_mutex_init(&(mutex), NULL) + +#define pipe_mutex_destroy(mutex) \ + pthread_mutex_destroy(&(mutex)) + +#define pipe_mutex_lock(mutex) \ + (void) pthread_mutex_lock(&(mutex)) + +#define pipe_mutex_unlock(mutex) \ + (void) pthread_mutex_unlock(&(mutex)) + +#define pipe_static_condvar(mutex) \ + static pipe_condvar mutex = PTHREAD_COND_INITIALIZER + +#define pipe_condvar_init(cond) \ + pthread_cond_init(&(cond), NULL) + +#define pipe_condvar_destroy(cond) \ + pthread_cond_destroy(&(cond)) + +#define pipe_condvar_wait(cond, mutex) \ + pthread_cond_wait(&(cond), &(mutex)) + +#define pipe_condvar_signal(cond) \ + pthread_cond_signal(&(cond)) + +#define pipe_condvar_broadcast(cond) \ + pthread_cond_broadcast(&(cond)) + + +#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) + +#include + +typedef HANDLE pipe_thread; + +#define PIPE_THREAD_ROUTINE( name, param ) \ + void * WINAPI name( void *param ) + +static INLINE pipe_thread pipe_thread_create( void *(WINAPI * routine)( void *), void *param ) +{ + DWORD id; + return CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE) routine, param, 0, &id ); +} + +static INLINE int pipe_thread_wait( pipe_thread thread ) +{ + if (WaitForSingleObject( thread, INFINITE ) == WAIT_OBJECT_0) + return 0; + return -1; +} + +static INLINE int pipe_thread_destroy( pipe_thread thread ) +{ + if (CloseHandle( thread )) + return 0; + return -1; +} + +typedef CRITICAL_SECTION pipe_mutex; + +#define pipe_static_mutex(mutex) \ + /*static*/ pipe_mutex mutex = {0,0,0,0,0,0} + +#define pipe_mutex_init(mutex) \ + InitializeCriticalSection(&mutex) + +#define pipe_mutex_destroy(mutex) \ + DeleteCriticalSection(&mutex) + +#define pipe_mutex_lock(mutex) \ + EnterCriticalSection(&mutex) + +#define pipe_mutex_unlock(mutex) \ + LeaveCriticalSection(&mutex) + +/* XXX: dummy definitions, make it compile */ + +typedef unsigned pipe_condvar; + +#define pipe_condvar_init(condvar) \ + (void) condvar + +#define pipe_condvar_broadcast(condvar) \ + (void) condvar + +#else + +/** Dummy definitions */ + +typedef unsigned pipe_thread; +typedef unsigned pipe_mutex; +typedef unsigned pipe_condvar; + +#define pipe_static_mutex(mutex) \ + static pipe_mutex mutex = 0 + +#define pipe_mutex_init(mutex) \ + (void) mutex + +#define pipe_mutex_destroy(mutex) \ + (void) mutex + +#define pipe_mutex_lock(mutex) \ + (void) mutex + +#define pipe_mutex_unlock(mutex) \ + (void) mutex + +#define pipe_static_condvar(condvar) \ + static unsigned condvar = 0 + +#define pipe_condvar_init(condvar) \ + (void) condvar + +#define pipe_condvar_destroy(condvar) \ + (void) condvar + +#define pipe_condvar_wait(condvar, mutex) \ + (void) condvar + +#define pipe_condvar_signal(condvar) \ + (void) condvar + +#define pipe_condvar_broadcast(condvar) \ + (void) condvar + + +#endif /* PIPE_OS_? */ + + + +/* + * Thread-specific data. + */ + +typedef struct { +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) + pthread_key_t key; +#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) + DWORD key; +#endif + int initMagic; +} pipe_tsd; + + +#define PIPE_TSD_INIT_MAGIC 0xff8adc98 + + +static INLINE void +pipe_tsd_init(pipe_tsd *tsd) +{ +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) + if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) { + perror("pthread_key_create(): failed to allocate key for thread specific data"); + exit(-1); + } +#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) + assert(0); +#endif + tsd->initMagic = PIPE_TSD_INIT_MAGIC; +} + +static INLINE void * +pipe_tsd_get(pipe_tsd *tsd) +{ + if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) { + pipe_tsd_init(tsd); + } +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) + return pthread_getspecific(tsd->key); +#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) + assert(0); + return NULL; +#else + assert(0); + return NULL; +#endif +} + +static INLINE void +pipe_tsd_set(pipe_tsd *tsd, void *value) +{ + if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) { + pipe_tsd_init(tsd); + } +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) + if (pthread_setspecific(tsd->key, value) != 0) { + perror("pthread_set_specific() failed"); + exit(-1); + } +#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) + assert(0); +#else + assert(0); +#endif +} + + + +#endif /* OS_THREAD_H_ */ diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index ba087ac0f34..95eb5f65635 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -44,7 +44,7 @@ #include "pipe/p_compiler.h" #include "pipe/p_defines.h" #include "util/u_debug.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_memory.h" #include "util/u_double_list.h" diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 7b34c8e3578..c1498318dfb 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -36,7 +36,7 @@ #include "pipe/p_compiler.h" #include "util/u_debug.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_memory.h" #include "util/u_double_list.h" #include "util/u_time.h" diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c index 8f74180a111..93f8960641f 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c @@ -35,7 +35,7 @@ #include "pipe/p_compiler.h" #include "util/u_debug.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_math.h" #include "util/u_memory.h" #include "util/u_double_list.h" diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c index 6400fc5b0a3..63195715d68 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c @@ -35,7 +35,7 @@ #include "pipe/p_defines.h" #include "util/u_debug.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_memory.h" #include "util/u_double_list.h" #include "util/u_mm.h" diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c index 7fd65ed2261..fea234ae8c7 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c @@ -37,7 +37,7 @@ #include "pipe/p_compiler.h" #include "util/u_debug.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "pipe/p_defines.h" #include "util/u_memory.h" #include "util/u_double_list.h" diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c index d21910d0bf0..c445cb578b0 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c @@ -38,7 +38,7 @@ #include "pipe/p_compiler.h" #include "util/u_debug.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "pipe/p_defines.h" #include "util/u_memory.h" #include "util/u_double_list.h" diff --git a/src/gallium/auxiliary/rtasm/rtasm_execmem.c b/src/gallium/auxiliary/rtasm/rtasm_execmem.c index ffed768f979..65d5ce795be 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_execmem.c +++ b/src/gallium/auxiliary/rtasm/rtasm_execmem.c @@ -32,7 +32,7 @@ #include "pipe/p_compiler.h" #include "util/u_debug.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_memory.h" #include "rtasm_execmem.h" @@ -58,7 +58,7 @@ #include #include -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_mm.h" #define EXEC_HEAP_SIZE (10*1024*1024) diff --git a/src/gallium/auxiliary/util/u_atomic.h b/src/gallium/auxiliary/util/u_atomic.h new file mode 100644 index 00000000000..1c042c3ede9 --- /dev/null +++ b/src/gallium/auxiliary/util/u_atomic.h @@ -0,0 +1,247 @@ +/** + * Many similar implementations exist. See for example libwsbm + * or the linux kernel include/atomic.h + * + * No copyright claimed on this file. + * + */ + +#ifndef U_ATOMIC_H +#define U_ATOMIC_H + +#include "pipe/p_compiler.h" +#include "pipe/p_defines.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Favor OS-provided implementations. + * + * Where no OS-provided implementation is available, fall back to + * locally coded assembly, compiler intrinsic or ultimately a + * mutex-based implementation. + */ +#if (defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) || \ + defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)) +#define PIPE_ATOMIC_OS_UNLOCKED +#elif defined(PIPE_CC_MSVC) +#define PIPE_ATOMIC_MSVC_INTRINSIC +#elif (defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)) +#define PIPE_ATOMIC_ASM_MSVC_X86 +#elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)) +#define PIPE_ATOMIC_ASM_GCC_X86 +#elif defined(PIPE_CC_GCC) +#define PIPE_ATOMIC_GCC_INTRINSIC +#else +#error "Unsupported platform" +#endif + + + +#if defined(PIPE_ATOMIC_ASM_GCC_X86) + +#define PIPE_ATOMIC "GCC x86 assembly" + +#define p_atomic_set(_v, _i) (*(_v) = (_i)) +#define p_atomic_read(_v) (*(_v)) + + +static INLINE boolean +p_atomic_dec_zero(int32_t *v) +{ + unsigned char c; + + __asm__ __volatile__("lock; decl %0; sete %1":"+m"(*v), "=qm"(c) + ::"memory"); + + return c != 0; +} + +static INLINE void +p_atomic_inc(int32_t *v) +{ + __asm__ __volatile__("lock; incl %0":"+m"(*v)); +} + +static INLINE void +p_atomic_dec(int32_t *v) +{ + __asm__ __volatile__("lock; decl %0":"+m"(*v)); +} + +static INLINE int32_t +p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) +{ + return __sync_val_compare_and_swap(v, old, _new); +} +#endif + + + +/* Implementation using GCC-provided synchronization intrinsics + */ +#if defined(PIPE_ATOMIC_GCC_INTRINSIC) + +#define PIPE_ATOMIC "GCC Sync Intrinsics" + +#define p_atomic_set(_v, _i) (*(_v) = (_i)) +#define p_atomic_read(_v) (*(_v)) + + +static INLINE boolean +p_atomic_dec_zero(int32_t *v) +{ + return (__sync_sub_and_fetch(v, 1) == 0); +} + +static INLINE void +p_atomic_inc(int32_t *v) +{ + (void) __sync_add_and_fetch(v, 1); +} + +static INLINE void +p_atomic_dec(int32_t *v) +{ + (void) __sync_sub_and_fetch(v, 1); +} + +static INLINE int32_t +p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) +{ + return __sync_val_compare_and_swap(v, old, _new); +} +#endif + + + +/* Unlocked version for single threaded environments, such as some + * windows kernel modules. + */ +#if defined(PIPE_ATOMIC_OS_UNLOCKED) + +#define PIPE_ATOMIC "Unlocked" + +#define p_atomic_set(_v, _i) (*(_v) = (_i)) +#define p_atomic_read(_v) (*(_v)) +#define p_atomic_dec_zero(_v) ((boolean) --(*(_v))) +#define p_atomic_inc(_v) ((void) (*(_v))++) +#define p_atomic_dec(_v) ((void) (*(_v))--) +#define p_atomic_cmpxchg(_v, old, _new) (*(_v) == old ? *(_v) = (_new) : *(_v)) + +#endif + + +/* Locally coded assembly for MSVC on x86: + */ +#if defined(PIPE_ATOMIC_ASM_MSVC_X86) + +#define PIPE_ATOMIC "MSVC x86 assembly" + +#define p_atomic_set(_v, _i) (*(_v) = (_i)) +#define p_atomic_read(_v) (*(_v)) + +static INLINE boolean +p_atomic_dec_zero(int32_t *v) +{ + unsigned char c; + + __asm { + mov eax, [v] + lock dec dword ptr [eax] + sete byte ptr [c] + } + + return c != 0; +} + +static INLINE void +p_atomic_inc(int32_t *v) +{ + __asm { + mov eax, [v] + lock inc dword ptr [eax] + } +} + +static INLINE void +p_atomic_dec(int32_t *v) +{ + __asm { + mov eax, [v] + lock dec dword ptr [eax] + } +} + +static INLINE int32_t +p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) +{ + int32_t orig; + + __asm { + mov ecx, [v] + mov eax, [old] + mov edx, [_new] + lock cmpxchg [ecx], edx + mov [orig], eax + } + + return orig; +} +#endif + + +#if defined(PIPE_ATOMIC_MSVC_INTRINSIC) + +#define PIPE_ATOMIC "MSVC Intrinsics" + +#include + +#pragma intrinsic(_InterlockedIncrement) +#pragma intrinsic(_InterlockedDecrement) +#pragma intrinsic(_InterlockedCompareExchange) + +#define p_atomic_set(_v, _i) (*(_v) = (_i)) +#define p_atomic_read(_v) (*(_v)) + +static INLINE boolean +p_atomic_dec_zero(int32_t *v) +{ + return _InterlockedDecrement(v) == 0; +} + +static INLINE void +p_atomic_inc(int32_t *v) +{ + _InterlockedIncrement(v); +} + +static INLINE void +p_atomic_dec(int32_t *v) +{ + _InterlockedDecrement(v); +} + +static INLINE int32_t +p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) +{ + return _InterlockedCompareExchange(v, _new, old); +} + +#endif + + + +#ifndef PIPE_ATOMIC +#error "No pipe_atomic implementation selected" +#endif + + + +#ifdef __cplusplus +} +#endif + +#endif /* U_ATOMIC_H */ diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index 72a4d6d5083..e95d58ea863 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -33,7 +33,7 @@ #include "pipe/p_state.h" #include "pipe/p_screen.h" #include "util/u_debug.h" -#include "pipe/p_atomic.h" +#include "util/u_atomic.h" #ifdef __cplusplus diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c b/src/gallium/auxiliary/util/u_ringbuffer.c index 3f43a19e018..95d45ebb71f 100644 --- a/src/gallium/auxiliary/util/u_ringbuffer.c +++ b/src/gallium/auxiliary/util/u_ringbuffer.c @@ -1,5 +1,5 @@ -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "pipe/p_defines.h" #include "util/u_ringbuffer.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/svga/svga_screen.h b/src/gallium/drivers/svga/svga_screen.h index a009b607200..9dc229b0a87 100644 --- a/src/gallium/drivers/svga/svga_screen.h +++ b/src/gallium/drivers/svga/svga_screen.h @@ -28,7 +28,7 @@ #include "pipe/p_screen.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_double_list.h" diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index 73f939cd8b9..c9e9bef5406 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -28,7 +28,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/svga/svga_screen_cache.h b/src/gallium/drivers/svga/svga_screen_cache.h index f5aa740d408..62156e3f522 100644 --- a/src/gallium/drivers/svga/svga_screen_cache.h +++ b/src/gallium/drivers/svga/svga_screen_cache.h @@ -31,7 +31,7 @@ #include "svga_reg.h" #include "svga3d_reg.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_double_list.h" diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index 2d8705f99bc..ad7bb652787 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -28,7 +28,7 @@ #include "pipe/p_state.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c index 0f45e211a32..7105a69e33f 100644 --- a/src/gallium/drivers/trace/tr_dump.c +++ b/src/gallium/drivers/trace/tr_dump.c @@ -45,7 +45,7 @@ #endif #include "pipe/p_compiler.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_debug.h" #include "util/u_memory.h" #include "util/u_string.h" diff --git a/src/gallium/drivers/trace/tr_screen.h b/src/gallium/drivers/trace/tr_screen.h index dba8cd7c653..fe5a0fa1909 100644 --- a/src/gallium/drivers/trace/tr_screen.h +++ b/src/gallium/drivers/trace/tr_screen.h @@ -30,7 +30,7 @@ #include "pipe/p_screen.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #ifdef __cplusplus diff --git a/src/gallium/include/pipe/p_atomic.h b/src/gallium/include/pipe/p_atomic.h deleted file mode 100644 index c0a0ac0edb3..00000000000 --- a/src/gallium/include/pipe/p_atomic.h +++ /dev/null @@ -1,247 +0,0 @@ -/** - * Many similar implementations exist. See for example libwsbm - * or the linux kernel include/atomic.h - * - * No copyright claimed on this file. - * - */ - -#ifndef P_ATOMIC_H -#define P_ATOMIC_H - -#include "p_compiler.h" -#include "p_defines.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Favor OS-provided implementations. - * - * Where no OS-provided implementation is available, fall back to - * locally coded assembly, compiler intrinsic or ultimately a - * mutex-based implementation. - */ -#if (defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) || \ - defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)) -#define PIPE_ATOMIC_OS_UNLOCKED -#elif defined(PIPE_CC_MSVC) -#define PIPE_ATOMIC_MSVC_INTRINSIC -#elif (defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86)) -#define PIPE_ATOMIC_ASM_MSVC_X86 -#elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)) -#define PIPE_ATOMIC_ASM_GCC_X86 -#elif defined(PIPE_CC_GCC) -#define PIPE_ATOMIC_GCC_INTRINSIC -#else -#error "Unsupported platform" -#endif - - - -#if defined(PIPE_ATOMIC_ASM_GCC_X86) - -#define PIPE_ATOMIC "GCC x86 assembly" - -#define p_atomic_set(_v, _i) (*(_v) = (_i)) -#define p_atomic_read(_v) (*(_v)) - - -static INLINE boolean -p_atomic_dec_zero(int32_t *v) -{ - unsigned char c; - - __asm__ __volatile__("lock; decl %0; sete %1":"+m"(*v), "=qm"(c) - ::"memory"); - - return c != 0; -} - -static INLINE void -p_atomic_inc(int32_t *v) -{ - __asm__ __volatile__("lock; incl %0":"+m"(*v)); -} - -static INLINE void -p_atomic_dec(int32_t *v) -{ - __asm__ __volatile__("lock; decl %0":"+m"(*v)); -} - -static INLINE int32_t -p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) -{ - return __sync_val_compare_and_swap(v, old, _new); -} -#endif - - - -/* Implementation using GCC-provided synchronization intrinsics - */ -#if defined(PIPE_ATOMIC_GCC_INTRINSIC) - -#define PIPE_ATOMIC "GCC Sync Intrinsics" - -#define p_atomic_set(_v, _i) (*(_v) = (_i)) -#define p_atomic_read(_v) (*(_v)) - - -static INLINE boolean -p_atomic_dec_zero(int32_t *v) -{ - return (__sync_sub_and_fetch(v, 1) == 0); -} - -static INLINE void -p_atomic_inc(int32_t *v) -{ - (void) __sync_add_and_fetch(v, 1); -} - -static INLINE void -p_atomic_dec(int32_t *v) -{ - (void) __sync_sub_and_fetch(v, 1); -} - -static INLINE int32_t -p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) -{ - return __sync_val_compare_and_swap(v, old, _new); -} -#endif - - - -/* Unlocked version for single threaded environments, such as some - * windows kernel modules. - */ -#if defined(PIPE_ATOMIC_OS_UNLOCKED) - -#define PIPE_ATOMIC "Unlocked" - -#define p_atomic_set(_v, _i) (*(_v) = (_i)) -#define p_atomic_read(_v) (*(_v)) -#define p_atomic_dec_zero(_v) ((boolean) --(*(_v))) -#define p_atomic_inc(_v) ((void) (*(_v))++) -#define p_atomic_dec(_v) ((void) (*(_v))--) -#define p_atomic_cmpxchg(_v, old, _new) (*(_v) == old ? *(_v) = (_new) : *(_v)) - -#endif - - -/* Locally coded assembly for MSVC on x86: - */ -#if defined(PIPE_ATOMIC_ASM_MSVC_X86) - -#define PIPE_ATOMIC "MSVC x86 assembly" - -#define p_atomic_set(_v, _i) (*(_v) = (_i)) -#define p_atomic_read(_v) (*(_v)) - -static INLINE boolean -p_atomic_dec_zero(int32_t *v) -{ - unsigned char c; - - __asm { - mov eax, [v] - lock dec dword ptr [eax] - sete byte ptr [c] - } - - return c != 0; -} - -static INLINE void -p_atomic_inc(int32_t *v) -{ - __asm { - mov eax, [v] - lock inc dword ptr [eax] - } -} - -static INLINE void -p_atomic_dec(int32_t *v) -{ - __asm { - mov eax, [v] - lock dec dword ptr [eax] - } -} - -static INLINE int32_t -p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) -{ - int32_t orig; - - __asm { - mov ecx, [v] - mov eax, [old] - mov edx, [_new] - lock cmpxchg [ecx], edx - mov [orig], eax - } - - return orig; -} -#endif - - -#if defined(PIPE_ATOMIC_MSVC_INTRINSIC) - -#define PIPE_ATOMIC "MSVC Intrinsics" - -#include - -#pragma intrinsic(_InterlockedIncrement) -#pragma intrinsic(_InterlockedDecrement) -#pragma intrinsic(_InterlockedCompareExchange) - -#define p_atomic_set(_v, _i) (*(_v) = (_i)) -#define p_atomic_read(_v) (*(_v)) - -static INLINE boolean -p_atomic_dec_zero(int32_t *v) -{ - return _InterlockedDecrement(v) == 0; -} - -static INLINE void -p_atomic_inc(int32_t *v) -{ - _InterlockedIncrement(v); -} - -static INLINE void -p_atomic_dec(int32_t *v) -{ - _InterlockedDecrement(v); -} - -static INLINE int32_t -p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new) -{ - return _InterlockedCompareExchange(v, _new, old); -} - -#endif - - - -#ifndef PIPE_ATOMIC -#error "No pipe_atomic implementation selected" -#endif - - - -#ifdef __cplusplus -} -#endif - -#endif /* P_ATOMIC_H */ diff --git a/src/gallium/include/pipe/p_thread.h b/src/gallium/include/pipe/p_thread.h deleted file mode 100644 index 25e41482325..00000000000 --- a/src/gallium/include/pipe/p_thread.h +++ /dev/null @@ -1,279 +0,0 @@ -/************************************************************************** - * - * Copyright 1999-2006 Brian Paul - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -/** - * @file - * - * Thread, mutex, condition var and thread-specific data functions. - */ - - -#ifndef _P_THREAD2_H_ -#define _P_THREAD2_H_ - - -#include "pipe/p_compiler.h" -#include "util/u_debug.h" /* for assert */ - - -#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) - -#include /* POSIX threads headers */ -#include /* for perror() */ - -#define PIPE_THREAD_HAVE_CONDVAR - -typedef pthread_t pipe_thread; - -#define PIPE_THREAD_ROUTINE( name, param ) \ - void *name( void *param ) - -static INLINE pipe_thread pipe_thread_create( void *(* routine)( void *), void *param ) -{ - pipe_thread thread; - if (pthread_create( &thread, NULL, routine, param )) - return 0; - return thread; -} - -static INLINE int pipe_thread_wait( pipe_thread thread ) -{ - return pthread_join( thread, NULL ); -} - -static INLINE int pipe_thread_destroy( pipe_thread thread ) -{ - return pthread_detach( thread ); -} - -typedef pthread_mutex_t pipe_mutex; -typedef pthread_cond_t pipe_condvar; - -#define pipe_static_mutex(mutex) \ - static pipe_mutex mutex = PTHREAD_MUTEX_INITIALIZER - -#define pipe_mutex_init(mutex) \ - (void) pthread_mutex_init(&(mutex), NULL) - -#define pipe_mutex_destroy(mutex) \ - pthread_mutex_destroy(&(mutex)) - -#define pipe_mutex_lock(mutex) \ - (void) pthread_mutex_lock(&(mutex)) - -#define pipe_mutex_unlock(mutex) \ - (void) pthread_mutex_unlock(&(mutex)) - -#define pipe_static_condvar(mutex) \ - static pipe_condvar mutex = PTHREAD_COND_INITIALIZER - -#define pipe_condvar_init(cond) \ - pthread_cond_init(&(cond), NULL) - -#define pipe_condvar_destroy(cond) \ - pthread_cond_destroy(&(cond)) - -#define pipe_condvar_wait(cond, mutex) \ - pthread_cond_wait(&(cond), &(mutex)) - -#define pipe_condvar_signal(cond) \ - pthread_cond_signal(&(cond)) - -#define pipe_condvar_broadcast(cond) \ - pthread_cond_broadcast(&(cond)) - - -#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) - -#include - -typedef HANDLE pipe_thread; - -#define PIPE_THREAD_ROUTINE( name, param ) \ - void * WINAPI name( void *param ) - -static INLINE pipe_thread pipe_thread_create( void *(WINAPI * routine)( void *), void *param ) -{ - DWORD id; - return CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE) routine, param, 0, &id ); -} - -static INLINE int pipe_thread_wait( pipe_thread thread ) -{ - if (WaitForSingleObject( thread, INFINITE ) == WAIT_OBJECT_0) - return 0; - return -1; -} - -static INLINE int pipe_thread_destroy( pipe_thread thread ) -{ - if (CloseHandle( thread )) - return 0; - return -1; -} - -typedef CRITICAL_SECTION pipe_mutex; - -#define pipe_static_mutex(mutex) \ - /*static*/ pipe_mutex mutex = {0,0,0,0,0,0} - -#define pipe_mutex_init(mutex) \ - InitializeCriticalSection(&mutex) - -#define pipe_mutex_destroy(mutex) \ - DeleteCriticalSection(&mutex) - -#define pipe_mutex_lock(mutex) \ - EnterCriticalSection(&mutex) - -#define pipe_mutex_unlock(mutex) \ - LeaveCriticalSection(&mutex) - -/* XXX: dummy definitions, make it compile */ - -typedef unsigned pipe_condvar; - -#define pipe_condvar_init(condvar) \ - (void) condvar - -#define pipe_condvar_broadcast(condvar) \ - (void) condvar - -#else - -/** Dummy definitions */ - -typedef unsigned pipe_thread; -typedef unsigned pipe_mutex; -typedef unsigned pipe_condvar; - -#define pipe_static_mutex(mutex) \ - static pipe_mutex mutex = 0 - -#define pipe_mutex_init(mutex) \ - (void) mutex - -#define pipe_mutex_destroy(mutex) \ - (void) mutex - -#define pipe_mutex_lock(mutex) \ - (void) mutex - -#define pipe_mutex_unlock(mutex) \ - (void) mutex - -#define pipe_static_condvar(condvar) \ - static unsigned condvar = 0 - -#define pipe_condvar_init(condvar) \ - (void) condvar - -#define pipe_condvar_destroy(condvar) \ - (void) condvar - -#define pipe_condvar_wait(condvar, mutex) \ - (void) condvar - -#define pipe_condvar_signal(condvar) \ - (void) condvar - -#define pipe_condvar_broadcast(condvar) \ - (void) condvar - - -#endif /* PIPE_OS_? */ - - - -/* - * Thread-specific data. - */ - -typedef struct { -#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) - pthread_key_t key; -#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) - DWORD key; -#endif - int initMagic; -} pipe_tsd; - - -#define PIPE_TSD_INIT_MAGIC 0xff8adc98 - - -static INLINE void -pipe_tsd_init(pipe_tsd *tsd) -{ -#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) - if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) { - perror("pthread_key_create(): failed to allocate key for thread specific data"); - exit(-1); - } -#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) - assert(0); -#endif - tsd->initMagic = PIPE_TSD_INIT_MAGIC; -} - -static INLINE void * -pipe_tsd_get(pipe_tsd *tsd) -{ - if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) { - pipe_tsd_init(tsd); - } -#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) - return pthread_getspecific(tsd->key); -#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) - assert(0); - return NULL; -#else - assert(0); - return NULL; -#endif -} - -static INLINE void -pipe_tsd_set(pipe_tsd *tsd, void *value) -{ - if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) { - pipe_tsd_init(tsd); - } -#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU) - if (pthread_setspecific(tsd->key, value) != 0) { - perror("pthread_set_specific() failed"); - exit(-1); - } -#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) - assert(0); -#else - assert(0); -#endif -} - - - -#endif /* _P_THREAD2_H_ */ diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.h b/src/gallium/state_trackers/glx/xlib/xm_api.h index d24971ca1c7..63a329cbe05 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.h +++ b/src/gallium/state_trackers/glx/xlib/xm_api.h @@ -60,7 +60,7 @@ and create a window, you must do the following to use the X/Mesa interface: #include "main/mtypes.h" #include "state_tracker/st_context.h" #include "state_tracker/st_public.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" # include diff --git a/src/gallium/state_trackers/wgl/stw_device.h b/src/gallium/state_trackers/wgl/stw_device.h index 0bf3b0da825..a83841f6b7d 100644 --- a/src/gallium/state_trackers/wgl/stw_device.h +++ b/src/gallium/state_trackers/wgl/stw_device.h @@ -30,7 +30,7 @@ #include "pipe/p_compiler.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" #include "util/u_handle_table.h" #include "stw_icd.h" #include "stw_pixelformat.h" diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.h b/src/gallium/state_trackers/wgl/stw_framebuffer.h index b80d168a7ce..08cc4973bce 100644 --- a/src/gallium/state_trackers/wgl/stw_framebuffer.h +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.h @@ -32,7 +32,7 @@ #include "main/mtypes.h" -#include "pipe/p_thread.h" +#include "os/os_thread.h" struct pipe_surface; struct stw_pixelformat_info; diff --git a/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c b/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c index e7622766b82..677046b848f 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c +++ b/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c @@ -1,7 +1,7 @@ #include "intel_drm_winsys.h" #include "util/u_memory.h" -#include "pipe/p_atomic.h" +#include "util/u_atomic.h" /** * Because gem does not have fence's we have to create our own fences. diff --git a/src/gallium/winsys/drm/vmware/core/vmw_surface.h b/src/gallium/winsys/drm/vmware/core/vmw_surface.h index 718c38767b3..b843c4dc7d4 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_surface.h +++ b/src/gallium/winsys/drm/vmware/core/vmw_surface.h @@ -36,8 +36,8 @@ #include "pipe/p_compiler.h" -#include "pipe/p_atomic.h" -#include "pipe/p_atomic.h" +#include "util/u_atomic.h" +#include "util/u_atomic.h" #define VMW_MAX_PRESENTS 3 -- cgit v1.2.3 From 25357696c3f253d44e83798e2a7e7f1f60c5adc5 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 2 Feb 2010 16:09:56 +0000 Subject: gallium: Move deprecated pipe/internal/p_winsys_screen.h inside util/u_simple_screen.h --- src/gallium/auxiliary/util/u_simple_screen.c | 2 +- src/gallium/auxiliary/util/u_simple_screen.h | 139 ++++++++++++++- src/gallium/auxiliary/util/u_timed_winsys.c | 2 +- src/gallium/drivers/cell/ppu/cell_context.c | 2 +- src/gallium/drivers/cell/ppu/cell_draw_arrays.c | 2 +- src/gallium/drivers/cell/ppu/cell_screen.c | 2 +- src/gallium/drivers/cell/ppu/cell_state_shader.c | 2 +- src/gallium/drivers/cell/ppu/cell_texture.c | 2 +- src/gallium/drivers/cell/ppu/cell_vertex_shader.c | 2 +- src/gallium/drivers/failover/fo_context.c | 2 +- src/gallium/drivers/i915/i915_debug.h | 2 +- src/gallium/drivers/i915/i915_debug_fp.c | 2 +- src/gallium/drivers/nouveau/nouveau_winsys.h | 2 +- src/gallium/drivers/nv04/nv04_context.c | 2 +- src/gallium/drivers/nv04/nv04_prim_vbuf.c | 2 +- src/gallium/drivers/nv04/nv04_surface.c | 2 +- src/gallium/drivers/nv10/nv10_context.c | 2 +- src/gallium/drivers/nv10/nv10_surface.c | 2 +- src/gallium/drivers/nv20/nv20_context.c | 2 +- src/gallium/drivers/nv20/nv20_prim_vbuf.c | 2 +- src/gallium/drivers/nv20/nv20_surface.c | 2 +- src/gallium/drivers/nv30/nv30_context.c | 2 +- src/gallium/drivers/nv30/nv30_surface.c | 2 +- src/gallium/drivers/nv40/nv40_context.c | 2 +- src/gallium/drivers/nv50/nv50_context.c | 2 +- src/gallium/drivers/nv50/nv50_surface.c | 2 +- src/gallium/drivers/r300/r300_winsys.h | 2 +- src/gallium/drivers/softpipe/sp_draw_arrays.c | 2 +- src/gallium/drivers/softpipe/sp_screen.c | 2 +- src/gallium/drivers/softpipe/sp_winsys.c | 2 +- .../include/pipe/internal/p_winsys_screen.h | 190 --------------------- src/gallium/state_trackers/egl/x11/native_ximage.c | 2 +- src/gallium/state_trackers/egl/x11/sw_winsys.c | 2 +- .../winsys/drm/nouveau/drm/nouveau_drm_api.h | 2 +- src/gallium/winsys/drm/radeon/core/radeon_buffer.h | 2 +- src/gallium/winsys/drm/radeon/core/radeon_winsys.h | 2 +- src/gallium/winsys/g3dvl/xlib/xsp_winsys.c | 2 +- src/gallium/winsys/gdi/gdi_softpipe_winsys.c | 2 +- src/gallium/winsys/xlib/xlib_brw_context.c | 2 +- src/gallium/winsys/xlib/xlib_cell.c | 2 +- src/gallium/winsys/xlib/xlib_llvmpipe.c | 2 +- src/gallium/winsys/xlib/xlib_softpipe.c | 2 +- 42 files changed, 178 insertions(+), 231 deletions(-) delete mode 100644 src/gallium/include/pipe/internal/p_winsys_screen.h (limited to 'src/gallium/drivers') diff --git a/src/gallium/auxiliary/util/u_simple_screen.c b/src/gallium/auxiliary/util/u_simple_screen.c index 52382990155..53f3c16dbcc 100644 --- a/src/gallium/auxiliary/util/u_simple_screen.c +++ b/src/gallium/auxiliary/util/u_simple_screen.c @@ -29,7 +29,7 @@ #include "pipe/p_screen.h" #include "pipe/p_state.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" static struct pipe_buffer * diff --git a/src/gallium/auxiliary/util/u_simple_screen.h b/src/gallium/auxiliary/util/u_simple_screen.h index 6612a8a7c09..bb3f5ba102f 100644 --- a/src/gallium/auxiliary/util/u_simple_screen.h +++ b/src/gallium/auxiliary/util/u_simple_screen.h @@ -28,8 +28,145 @@ #ifndef U_SIMPLE_SCREEN_H #define U_SIMPLE_SCREEN_H +#include "pipe/p_format.h" + struct pipe_screen; -struct pipe_winsys; +struct pipe_fence_handle; +struct pipe_surface; +struct pipe_buffer; + +/** + * Gallium3D drivers are (meant to be!) independent of both GL and the + * window system. The window system provides a buffer manager and a + * set of additional hooks for things like command buffer submission, + * etc. + * + * There clearly has to be some agreement between the window system + * driver and the hardware driver about the format of command buffers, + * etc. + */ +struct pipe_winsys +{ + void (*destroy)( struct pipe_winsys *ws ); + + /** Returns name of this winsys interface */ + const char *(*get_name)( struct pipe_winsys *ws ); + + /** + * Do any special operations to ensure buffer size is correct + */ + void (*update_buffer)( struct pipe_winsys *ws, + void *context_private ); + /** + * Do any special operations to ensure frontbuffer contents are + * displayed, eg copy fake frontbuffer. + */ + void (*flush_frontbuffer)( struct pipe_winsys *ws, + struct pipe_surface *surf, + void *context_private ); + + + /** + * Buffer management. Buffer attributes are mostly fixed over its lifetime. + * + * Remember that gallium gets to choose the interface it needs, and the + * window systems must then implement that interface (rather than the + * other way around...). + * + * usage is a bitmask of PIPE_BUFFER_USAGE_PIXEL/VERTEX/INDEX/CONSTANT. This + * usage argument is only an optimization hint, not a guarantee, therefore + * proper behavior must be observed in all circumstances. + * + * alignment indicates the client's alignment requirements, eg for + * SSE instructions. + */ + struct pipe_buffer *(*buffer_create)( struct pipe_winsys *ws, + 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_winsys *ws, + 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_winsys *ws, + unsigned width, unsigned height, + enum pipe_format format, + unsigned usage, + unsigned tex_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_winsys *ws, + struct pipe_buffer *buf, + unsigned usage ); + + void (*buffer_unmap)( struct pipe_winsys *ws, + struct pipe_buffer *buf ); + + void (*buffer_destroy)( struct pipe_buffer *buf ); + + + /** Set ptr = fence, with reference counting */ + void (*fence_reference)( struct pipe_winsys *ws, + struct pipe_fence_handle **ptr, + struct pipe_fence_handle *fence ); + + /** + * Checks whether the fence has been signalled. + * \param flags driver-specific meaning + * \return zero on success. + */ + int (*fence_signalled)( struct pipe_winsys *ws, + struct pipe_fence_handle *fence, + unsigned flag ); + + /** + * Wait for the fence to finish. + * \param flags driver-specific meaning + * \return zero on success. + */ + int (*fence_finish)( struct pipe_winsys *ws, + struct pipe_fence_handle *fence, + unsigned flag ); + +}; /** * The following function initializes a simple passthrough screen. diff --git a/src/gallium/auxiliary/util/u_timed_winsys.c b/src/gallium/auxiliary/util/u_timed_winsys.c index 178acdca4df..59bdcd2c451 100644 --- a/src/gallium/auxiliary/util/u_timed_winsys.c +++ b/src/gallium/auxiliary/util/u_timed_winsys.c @@ -30,7 +30,7 @@ */ #include "pipe/p_state.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "u_timed_winsys.h" #include "util/u_memory.h" #include "util/u_time.h" diff --git a/src/gallium/drivers/cell/ppu/cell_context.c b/src/gallium/drivers/cell/ppu/cell_context.c index ebb7a7acc44..30aa04482e3 100644 --- a/src/gallium/drivers/cell/ppu/cell_context.c +++ b/src/gallium/drivers/cell/ppu/cell_context.c @@ -36,7 +36,7 @@ #include "pipe/p_defines.h" #include "pipe/p_format.h" #include "util/u_memory.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_screen.h" #include "draw/draw_context.h" diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c index 8b939454eb4..bffd0fac6fe 100644 --- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c +++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c @@ -33,7 +33,7 @@ #include "pipe/p_defines.h" #include "pipe/p_context.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "cell_context.h" diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index 37b04396b3e..c329c6682dd 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -28,7 +28,7 @@ #include "util/u_memory.h" #include "util/u_simple_screen.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_defines.h" #include "pipe/p_screen.h" diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c index c5adc6a8979..9b2f86fdfba 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c @@ -28,7 +28,7 @@ #include "pipe/p_defines.h" #include "util/u_memory.h" #include "util/u_inlines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "draw/draw_context.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index 15bc1eec326..fad290dfa0e 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -34,7 +34,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/cell/ppu/cell_vertex_shader.c b/src/gallium/drivers/cell/ppu/cell_vertex_shader.c index 403cf6d50fc..cf8cd411598 100644 --- a/src/gallium/drivers/cell/ppu/cell_vertex_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_vertex_shader.c @@ -31,7 +31,7 @@ #include "pipe/p_defines.h" #include "pipe/p_context.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_math.h" #include "cell_context.h" diff --git a/src/gallium/drivers/failover/fo_context.c b/src/gallium/drivers/failover/fo_context.c index 46e4338d98a..2ccc5d3e605 100644 --- a/src/gallium/drivers/failover/fo_context.c +++ b/src/gallium/drivers/failover/fo_context.c @@ -27,7 +27,7 @@ #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_memory.h" #include "pipe/p_context.h" diff --git a/src/gallium/drivers/i915/i915_debug.h b/src/gallium/drivers/i915/i915_debug.h index dd9b86e17b5..8f7484797de 100644 --- a/src/gallium/drivers/i915/i915_debug.h +++ b/src/gallium/drivers/i915/i915_debug.h @@ -72,7 +72,7 @@ void i915_print_ureg(const char *msg, unsigned ureg); #if defined(DEBUG) && defined(FILE_DEBUG_FLAG) -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" static INLINE void I915_DBG( diff --git a/src/gallium/drivers/i915/i915_debug_fp.c b/src/gallium/drivers/i915/i915_debug_fp.c index f1ffd27908f..066e7392d18 100644 --- a/src/gallium/drivers/i915/i915_debug_fp.c +++ b/src/gallium/drivers/i915/i915_debug_fp.c @@ -28,7 +28,7 @@ #include "i915_reg.h" #include "i915_debug.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_debug.h" diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h index 4c3e08a43f5..d81c5be51f2 100644 --- a/src/gallium/drivers/nouveau/nouveau_winsys.h +++ b/src/gallium/drivers/nouveau/nouveau_winsys.h @@ -2,7 +2,7 @@ #define NOUVEAU_WINSYS_H #include -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_defines.h" #include "nouveau/nouveau_bo.h" diff --git a/src/gallium/drivers/nv04/nv04_context.c b/src/gallium/drivers/nv04/nv04_context.c index edd96859cf8..e91ffe0f5de 100644 --- a/src/gallium/drivers/nv04/nv04_context.c +++ b/src/gallium/drivers/nv04/nv04_context.c @@ -1,6 +1,6 @@ #include "draw/draw_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "nv04_context.h" #include "nv04_screen.h" diff --git a/src/gallium/drivers/nv04/nv04_prim_vbuf.c b/src/gallium/drivers/nv04/nv04_prim_vbuf.c index dc0c1d04b79..03438c7fcb9 100644 --- a/src/gallium/drivers/nv04/nv04_prim_vbuf.c +++ b/src/gallium/drivers/nv04/nv04_prim_vbuf.c @@ -1,7 +1,7 @@ #include "util/u_debug.h" #include "util/u_inlines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_compiler.h" #include "draw/draw_vbuf.h" diff --git a/src/gallium/drivers/nv04/nv04_surface.c b/src/gallium/drivers/nv04/nv04_surface.c index 92840910e65..c5f8927c058 100644 --- a/src/gallium/drivers/nv04/nv04_surface.c +++ b/src/gallium/drivers/nv04/nv04_surface.c @@ -28,7 +28,7 @@ #include "nv04_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "util/u_tile.h" diff --git a/src/gallium/drivers/nv10/nv10_context.c b/src/gallium/drivers/nv10/nv10_context.c index 900a640ab72..a3ceb1da948 100644 --- a/src/gallium/drivers/nv10/nv10_context.c +++ b/src/gallium/drivers/nv10/nv10_context.c @@ -1,6 +1,6 @@ #include "draw/draw_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "nv10_context.h" #include "nv10_screen.h" diff --git a/src/gallium/drivers/nv10/nv10_surface.c b/src/gallium/drivers/nv10/nv10_surface.c index acf898917cf..6db0164dbe5 100644 --- a/src/gallium/drivers/nv10/nv10_surface.c +++ b/src/gallium/drivers/nv10/nv10_surface.c @@ -28,7 +28,7 @@ #include "nv10_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "util/u_tile.h" diff --git a/src/gallium/drivers/nv20/nv20_context.c b/src/gallium/drivers/nv20/nv20_context.c index 22185a2f6e8..f0c0d8a4b3b 100644 --- a/src/gallium/drivers/nv20/nv20_context.c +++ b/src/gallium/drivers/nv20/nv20_context.c @@ -1,6 +1,6 @@ #include "draw/draw_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "nv20_context.h" #include "nv20_screen.h" diff --git a/src/gallium/drivers/nv20/nv20_prim_vbuf.c b/src/gallium/drivers/nv20/nv20_prim_vbuf.c index 84faa87095e..581276ba22e 100644 --- a/src/gallium/drivers/nv20/nv20_prim_vbuf.c +++ b/src/gallium/drivers/nv20/nv20_prim_vbuf.c @@ -40,7 +40,7 @@ #include "util/u_debug.h" #include "util/u_inlines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "nv20_context.h" #include "nv20_state.h" diff --git a/src/gallium/drivers/nv20/nv20_surface.c b/src/gallium/drivers/nv20/nv20_surface.c index 7beb0f0c83d..5deb8cc6f1a 100644 --- a/src/gallium/drivers/nv20/nv20_surface.c +++ b/src/gallium/drivers/nv20/nv20_surface.c @@ -28,7 +28,7 @@ #include "nv20_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "util/u_tile.h" diff --git a/src/gallium/drivers/nv30/nv30_context.c b/src/gallium/drivers/nv30/nv30_context.c index 54572e9ab3a..8a40cea2e50 100644 --- a/src/gallium/drivers/nv30/nv30_context.c +++ b/src/gallium/drivers/nv30/nv30_context.c @@ -1,6 +1,6 @@ #include "draw/draw_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "nv30_context.h" #include "nv30_screen.h" diff --git a/src/gallium/drivers/nv30/nv30_surface.c b/src/gallium/drivers/nv30/nv30_surface.c index b72a63ee76a..b48c5ab51a0 100644 --- a/src/gallium/drivers/nv30/nv30_surface.c +++ b/src/gallium/drivers/nv30/nv30_surface.c @@ -28,7 +28,7 @@ #include "nv30_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "util/u_tile.h" diff --git a/src/gallium/drivers/nv40/nv40_context.c b/src/gallium/drivers/nv40/nv40_context.c index f79ae4db84e..ffe25ffebd5 100644 --- a/src/gallium/drivers/nv40/nv40_context.c +++ b/src/gallium/drivers/nv40/nv40_context.c @@ -1,6 +1,6 @@ #include "draw/draw_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "nv40_context.h" #include "nv40_screen.h" diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c index 5c705ccc8f1..ac1abc1d5cc 100644 --- a/src/gallium/drivers/nv50/nv50_context.c +++ b/src/gallium/drivers/nv50/nv50_context.c @@ -22,7 +22,7 @@ #include "draw/draw_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "nv50_context.h" #include "nv50_screen.h" diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 38a9dfdde7a..ac0c1d02703 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -25,7 +25,7 @@ #include "nouveau/nouveau_pushbuf.h" #include "nv50_context.h" #include "pipe/p_defines.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "util/u_tile.h" diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h index bdb8b54bab6..d4842e94ae9 100644 --- a/src/gallium/drivers/r300/r300_winsys.h +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -33,7 +33,7 @@ extern "C" { #include "pipe/p_defines.h" #include "pipe/p_state.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "radeon_winsys.h" diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index f7e736df849..b2acc36bf7a 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -33,7 +33,7 @@ #include "pipe/p_defines.h" #include "pipe/p_context.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "util/u_prim.h" diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 714a1cf5343..ee6969e60fb 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -28,7 +28,7 @@ #include "util/u_memory.h" #include "util/u_simple_screen.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_defines.h" #include "pipe/p_screen.h" diff --git a/src/gallium/drivers/softpipe/sp_winsys.c b/src/gallium/drivers/softpipe/sp_winsys.c index e515d1d838d..f6598927d35 100644 --- a/src/gallium/drivers/softpipe/sp_winsys.c +++ b/src/gallium/drivers/softpipe/sp_winsys.c @@ -36,7 +36,7 @@ */ -#include "pipe/internal/p_winsys_screen.h"/* port to just p_screen */ +#include "util/u_simple_screen.h"/* port to just p_screen */ #include "pipe/p_format.h" #include "pipe/p_context.h" #include "util/u_format.h" diff --git a/src/gallium/include/pipe/internal/p_winsys_screen.h b/src/gallium/include/pipe/internal/p_winsys_screen.h deleted file mode 100644 index a1542dada70..00000000000 --- a/src/gallium/include/pipe/internal/p_winsys_screen.h +++ /dev/null @@ -1,190 +0,0 @@ - /************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -/** - * \file - * This is the interface that Gallium3D requires any window system - * hosting it to implement. This is the only include file in Gallium3D - * which is public. - */ - -#ifndef P_WINSYS_H -#define P_WINSYS_H - - -#include "pipe/p_format.h" - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** Opaque type */ -struct pipe_fence_handle; - -struct pipe_surface; - - -/** - * Gallium3D drivers are (meant to be!) independent of both GL and the - * window system. The window system provides a buffer manager and a - * set of additional hooks for things like command buffer submission, - * etc. - * - * There clearly has to be some agreement between the window system - * driver and the hardware driver about the format of command buffers, - * etc. - */ -struct pipe_winsys -{ - void (*destroy)( struct pipe_winsys *ws ); - - /** Returns name of this winsys interface */ - const char *(*get_name)( struct pipe_winsys *ws ); - - /** - * Do any special operations to ensure buffer size is correct - */ - void (*update_buffer)( struct pipe_winsys *ws, - void *context_private ); - /** - * Do any special operations to ensure frontbuffer contents are - * displayed, eg copy fake frontbuffer. - */ - void (*flush_frontbuffer)( struct pipe_winsys *ws, - struct pipe_surface *surf, - void *context_private ); - - - /** - * Buffer management. Buffer attributes are mostly fixed over its lifetime. - * - * Remember that gallium gets to choose the interface it needs, and the - * window systems must then implement that interface (rather than the - * other way around...). - * - * usage is a bitmask of PIPE_BUFFER_USAGE_PIXEL/VERTEX/INDEX/CONSTANT. This - * usage argument is only an optimization hint, not a guarantee, therefore - * proper behavior must be observed in all circumstances. - * - * alignment indicates the client's alignment requirements, eg for - * SSE instructions. - */ - struct pipe_buffer *(*buffer_create)( struct pipe_winsys *ws, - 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_winsys *ws, - 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_winsys *ws, - unsigned width, unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_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_winsys *ws, - struct pipe_buffer *buf, - unsigned usage ); - - void (*buffer_unmap)( struct pipe_winsys *ws, - struct pipe_buffer *buf ); - - void (*buffer_destroy)( struct pipe_buffer *buf ); - - - /** Set ptr = fence, with reference counting */ - void (*fence_reference)( struct pipe_winsys *ws, - struct pipe_fence_handle **ptr, - struct pipe_fence_handle *fence ); - - /** - * Checks whether the fence has been signalled. - * \param flags driver-specific meaning - * \return zero on success. - */ - int (*fence_signalled)( struct pipe_winsys *ws, - struct pipe_fence_handle *fence, - unsigned flag ); - - /** - * Wait for the fence to finish. - * \param flags driver-specific meaning - * \return zero on success. - */ - int (*fence_finish)( struct pipe_winsys *ws, - struct pipe_fence_handle *fence, - unsigned flag ); - -}; - -#ifdef __cplusplus -} -#endif - -#endif /* P_WINSYS_H */ diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index dfa8df22234..697fd7c4136 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -33,7 +33,7 @@ #include "util/u_math.h" #include "util/u_format.h" #include "pipe/p_compiler.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "softpipe/sp_winsys.h" #include "egllog.h" diff --git a/src/gallium/state_trackers/egl/x11/sw_winsys.c b/src/gallium/state_trackers/egl/x11/sw_winsys.c index 6cf8e5c6c9f..33328aadf26 100644 --- a/src/gallium/state_trackers/egl/x11/sw_winsys.c +++ b/src/gallium/state_trackers/egl/x11/sw_winsys.c @@ -35,7 +35,7 @@ */ -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_state.h" #include "util/u_inlines.h" #include "util/u_format.h" diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h index e61e0e0957a..a32f2907b37 100644 --- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h +++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h @@ -4,7 +4,7 @@ #include "state_tracker/drm_api.h" #include "state_tracker/dri1_api.h" -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "nouveau_dri.h" diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h index 9379021911a..f1c8fc2a3b1 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h @@ -32,7 +32,7 @@ #include -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" diff --git a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h index 864082b99b3..4901080ca7b 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h @@ -30,7 +30,7 @@ #ifndef RADEON_WINSYS_H #define RADEON_WINSYS_H -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" struct radeon_winsys_priv; diff --git a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c index 6a7e8c9b592..048af62ed30 100644 --- a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c +++ b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c index 4db9776280b..36bf867f193 100644 --- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c @@ -38,7 +38,7 @@ #include -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_format.h" #include "pipe/p_context.h" #include "util/u_inlines.h" diff --git a/src/gallium/winsys/xlib/xlib_brw_context.c b/src/gallium/winsys/xlib/xlib_brw_context.c index 5558654d7b7..22bf41a46f7 100644 --- a/src/gallium/winsys/xlib/xlib_brw_context.c +++ b/src/gallium/winsys/xlib/xlib_brw_context.c @@ -36,7 +36,7 @@ /* #include "glxheader.h" */ /* #include "xmesaP.h" */ -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_memory.h" diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c index 8dc18efbf3d..9520bac69db 100644 --- a/src/gallium/winsys/xlib/xlib_cell.c +++ b/src/gallium/winsys/xlib/xlib_cell.c @@ -41,7 +41,7 @@ #undef ASSERT #undef Elements -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_format.h" #include "pipe/p_context.h" #include "util/u_inlines.h" diff --git a/src/gallium/winsys/xlib/xlib_llvmpipe.c b/src/gallium/winsys/xlib/xlib_llvmpipe.c index cdf92d8b5e3..503addb55c6 100644 --- a/src/gallium/winsys/xlib/xlib_llvmpipe.c +++ b/src/gallium/winsys/xlib/xlib_llvmpipe.c @@ -40,7 +40,7 @@ #undef ASSERT #undef Elements -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_format.h" #include "pipe/p_context.h" #include "util/u_inlines.h" diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c index 87a1325ca4d..8ce1ea79366 100644 --- a/src/gallium/winsys/xlib/xlib_softpipe.c +++ b/src/gallium/winsys/xlib/xlib_softpipe.c @@ -38,7 +38,7 @@ #undef ASSERT #undef Elements -#include "pipe/internal/p_winsys_screen.h" +#include "util/u_simple_screen.h" #include "pipe/p_format.h" #include "pipe/p_context.h" #include "util/u_inlines.h" -- cgit v1.2.3 From 630c375fe93abb7de8362cc4f092c4aa08d2fdc2 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Feb 2010 11:06:23 +0000 Subject: trace: Include the appropriate header instead of defining prototypes. Avoids header when the header was included before. --- src/gallium/drivers/trace/tr_rbug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/trace/tr_rbug.c b/src/gallium/drivers/trace/tr_rbug.c index 0546aad9b50..d66a75c6c87 100644 --- a/src/gallium/drivers/trace/tr_rbug.c +++ b/src/gallium/drivers/trace/tr_rbug.c @@ -46,7 +46,7 @@ #if defined(PIPE_SUBSYSTEM_WINDOWS_USER) # define sleep Sleep #elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_APPLE) -void usleep(int); +# include # define sleep usleep #else # warning "No socket implementation" -- cgit v1.2.3