summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-09-03 11:48:05 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-09-03 11:53:39 +0900
commitf637a96e85a51a66f2c53b91118a6815bb61d6e6 (patch)
treebd56aa4cc21fed53612e8625321a961dea25e60c /src/gallium
parent82086f5d21295d5ceffb0fd9963de7de4112964b (diff)
gallium: Have pipe_buffer_* receive a pipe_screen instead of a pipe_context.
We want to use the pipe_buffer_* inlines everywhere, but a pipe context is not always available nor is it needed.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_draw_quad.c2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_shader.c2
-rw-r--r--src/gallium/drivers/cell/ppu/cell_texture.c4
-rw-r--r--src/gallium/drivers/i915simple/i915_prim_vbuf.c2
-rw-r--r--src/gallium/drivers/i915simple/i915_texture.c8
-rw-r--r--src/gallium/drivers/i965simple/brw_state_pool.c2
-rw-r--r--src/gallium/drivers/i965simple/brw_tex_layout.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_state_fs.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c6
-rw-r--r--src/gallium/include/pipe/p_inlines.h28
-rw-r--r--src/gallium/state_trackers/python/p_context.i2
-rw-r--r--src/gallium/state_trackers/python/st_device.c2
-rw-r--r--src/gallium/state_trackers/python/st_softpipe_winsys.c2
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_screen.c2
-rw-r--r--src/gallium/winsys/egl_xlib/sw_winsys.c2
-rw-r--r--src/gallium/winsys/gdi/wmesa.c2
-rw-r--r--src/gallium/winsys/xlib/xm_winsys.c2
-rw-r--r--src/gallium/winsys/xlib/xm_winsys_aub.c2
19 files changed, 39 insertions, 39 deletions
diff --git a/src/gallium/auxiliary/util/u_draw_quad.c b/src/gallium/auxiliary/util/u_draw_quad.c
index bf143815d8..d643ee9ab7 100644
--- a/src/gallium/auxiliary/util/u_draw_quad.c
+++ b/src/gallium/auxiliary/util/u_draw_quad.c
@@ -127,6 +127,6 @@ util_draw_texquad(struct pipe_context *pipe,
util_draw_vertex_buffer(pipe, vbuf, PIPE_PRIM_TRIANGLE_FAN, 4, 2);
}
- pipe_buffer_reference(pipe->winsys, &vbuf, NULL);
+ pipe_buffer_reference(pipe->screen, &vbuf, NULL);
}
}
diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c
index 86bcad05e9..3d1b887da9 100644
--- a/src/gallium/drivers/cell/ppu/cell_state_shader.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c
@@ -166,7 +166,7 @@ cell_set_constant_buffer(struct pipe_context *pipe,
assert(index == 0);
/* note: reference counting */
- pipe_buffer_reference(ws,
+ winsys_buffer_reference(ws,
&cell->constants[shader].buffer,
buf->buffer);
cell->constants[shader].size = buf->size;
diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c
index 5a0942bbd6..5c01aa21b8 100644
--- a/src/gallium/drivers/cell/ppu/cell_texture.c
+++ b/src/gallium/drivers/cell/ppu/cell_texture.c
@@ -130,7 +130,7 @@ cell_texture_release_screen(struct pipe_screen *screen,
DBG("%s deleting %p\n", __FUNCTION__, (void *) spt);
*/
- pipe_buffer_reference(screen->winsys, &spt->buffer, NULL);
+ pipe_buffer_reference(screen, &spt->buffer, NULL);
FREE(spt);
}
@@ -161,7 +161,7 @@ cell_get_tex_surface_screen(struct pipe_screen *screen,
if (ps) {
assert(ps->refcount);
assert(ps->winsys);
- pipe_buffer_reference(ws, &ps->buffer, spt->buffer);
+ winsys_buffer_reference(ws, &ps->buffer, spt->buffer);
ps->format = pt->format;
ps->block = pt->block;
ps->width = pt->width[level];
diff --git a/src/gallium/drivers/i915simple/i915_prim_vbuf.c b/src/gallium/drivers/i915simple/i915_prim_vbuf.c
index e4ece55098..9397a2ca1a 100644
--- a/src/gallium/drivers/i915simple/i915_prim_vbuf.c
+++ b/src/gallium/drivers/i915simple/i915_prim_vbuf.c
@@ -124,7 +124,7 @@ i915_vbuf_render_allocate_vertices( struct vbuf_render *render,
if (i915_render->vbo_size > size + i915_render->vbo_offset && !i915->vbo_flushed) {
} else {
i915->vbo_flushed = 0;
- pipe_buffer_reference(winsys, &i915_render->vbo, NULL);
+ winsys_buffer_reference(winsys, &i915_render->vbo, NULL);
}
if (!i915_render->vbo) {
diff --git a/src/gallium/drivers/i915simple/i915_texture.c b/src/gallium/drivers/i915simple/i915_texture.c
index a853a5a3f6..bd87217063 100644
--- a/src/gallium/drivers/i915simple/i915_texture.c
+++ b/src/gallium/drivers/i915simple/i915_texture.c
@@ -645,7 +645,7 @@ i915_texture_release(struct pipe_screen *screen,
DBG("%s deleting %p\n", __FUNCTION__, (void *) tex);
*/
- pipe_buffer_reference(screen->winsys, &tex->buffer, NULL);
+ pipe_buffer_reference(screen, &tex->buffer, NULL);
for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++)
if (tex->image_offset[i])
@@ -684,7 +684,7 @@ i915_get_tex_surface(struct pipe_screen *screen,
ps->refcount = 1;
ps->winsys = ws;
pipe_texture_reference(&ps->texture, pt);
- pipe_buffer_reference(ws, &ps->buffer, tex->buffer);
+ pipe_buffer_reference(screen, &ps->buffer, tex->buffer);
ps->format = pt->format;
ps->width = pt->width[level];
ps->height = pt->height[level];
@@ -728,7 +728,7 @@ i915_texture_blanket(struct pipe_screen * screen,
i915_miptree_set_level_info(tex, 0, 1, base->width[0], base->height[0], 1);
i915_miptree_set_image_offset(tex, 0, 0, 0, 0);
- pipe_buffer_reference(screen->winsys, &tex->buffer, buffer);
+ pipe_buffer_reference(screen, &tex->buffer, buffer);
return &tex->base;
}
@@ -756,7 +756,7 @@ i915_tex_surface_release(struct pipe_screen *screen,
}
pipe_texture_reference(&surf->texture, NULL);
- pipe_buffer_reference(screen->winsys, &surf->buffer, NULL);
+ pipe_buffer_reference(screen, &surf->buffer, NULL);
FREE(surf);
}
diff --git a/src/gallium/drivers/i965simple/brw_state_pool.c b/src/gallium/drivers/i965simple/brw_state_pool.c
index 78d4c0e411..d0dc1ef74d 100644
--- a/src/gallium/drivers/i965simple/brw_state_pool.c
+++ b/src/gallium/drivers/i965simple/brw_state_pool.c
@@ -103,7 +103,7 @@ static void brw_destroy_pool( struct brw_context *brw,
{
struct brw_mem_pool *pool = &brw->pool[pool_id];
- pipe_buffer_reference( pool->brw->pipe.winsys,
+ winsys_buffer_reference( pool->brw->pipe.winsys,
&pool->buffer,
NULL );
}
diff --git a/src/gallium/drivers/i965simple/brw_tex_layout.c b/src/gallium/drivers/i965simple/brw_tex_layout.c
index 05eda9d1f2..cc0c665e02 100644
--- a/src/gallium/drivers/i965simple/brw_tex_layout.c
+++ b/src/gallium/drivers/i965simple/brw_tex_layout.c
@@ -330,7 +330,7 @@ brw_texture_release_screen(struct pipe_screen *screen,
DBG("%s deleting %p\n", __FUNCTION__, (void *) tex);
*/
- pipe_buffer_reference(ws, &tex->buffer, NULL);
+ winsys_buffer_reference(ws, &tex->buffer, NULL);
for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++)
if (tex->image_offset[i])
@@ -369,7 +369,7 @@ brw_get_tex_surface_screen(struct pipe_screen *screen,
if (ps) {
assert(ps->format);
assert(ps->refcount);
- pipe_buffer_reference(ws, &ps->buffer, tex->buffer);
+ winsys_buffer_reference(ws, &ps->buffer, tex->buffer);
ps->format = pt->format;
ps->width = pt->width[level];
ps->height = pt->height[level];
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index dda90f760a..6f12390cf7 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -113,7 +113,7 @@ static void softpipe_destroy( struct pipe_context *pipe )
for (i = 0; i < Elements(softpipe->constants); i++) {
if (softpipe->constants[i].buffer) {
- pipe_buffer_reference(ws, &softpipe->constants[i].buffer, NULL);
+ winsys_buffer_reference(ws, &softpipe->constants[i].buffer, NULL);
}
}
diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c
index 1be461b3a4..e5b609cf6c 100644
--- a/src/gallium/drivers/softpipe/sp_state_fs.c
+++ b/src/gallium/drivers/softpipe/sp_state_fs.c
@@ -152,7 +152,7 @@ softpipe_set_constant_buffer(struct pipe_context *pipe,
assert(index == 0);
/* note: reference counting */
- pipe_buffer_reference(ws,
+ winsys_buffer_reference(ws,
&softpipe->constants[shader].buffer,
buf ? buf->buffer : NULL);
softpipe->constants[shader].size = buf ? buf->size : 0;
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index 3a737d6f72..c283e3e410 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -192,7 +192,7 @@ softpipe_texture_blanket(struct pipe_screen * screen,
spt->base.nblocksy[0] = pf_get_nblocksy(&spt->base.block, spt->base.height[0]);
spt->stride[0] = stride[0];
- pipe_buffer_reference(screen->winsys, &spt->buffer, buffer);
+ pipe_buffer_reference(screen, &spt->buffer, buffer);
return &spt->base;
}
@@ -208,7 +208,7 @@ softpipe_texture_release(struct pipe_screen *screen,
if (--(*pt)->refcount <= 0) {
struct softpipe_texture *spt = softpipe_texture(*pt);
- pipe_buffer_reference(screen->winsys, &spt->buffer, NULL);
+ pipe_buffer_reference(screen, &spt->buffer, NULL);
FREE(spt);
}
*pt = NULL;
@@ -231,7 +231,7 @@ softpipe_get_tex_surface(struct pipe_screen *screen,
if (ps) {
assert(ps->refcount);
assert(ps->winsys);
- pipe_buffer_reference(ws, &ps->buffer, spt->buffer);
+ pipe_buffer_reference(screen, &ps->buffer, spt->buffer);
ps->format = pt->format;
ps->block = pt->block;
ps->width = pt->width[level];
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index 1e4b98edb4..d70de8e301 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -109,7 +109,7 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
/* XXX: thread safety issues!
*/
static INLINE void
-pipe_buffer_reference(struct pipe_winsys *winsys,
+winsys_buffer_reference(struct pipe_winsys *winsys,
struct pipe_buffer **ptr,
struct pipe_buffer *buf)
{
@@ -164,48 +164,48 @@ pipe_texture_release(struct pipe_texture **ptr)
*/
static INLINE struct pipe_buffer *
-pipe_buffer_create( struct pipe_context *pipe,
+pipe_buffer_create( struct pipe_screen *screen,
unsigned alignment, unsigned usage, unsigned size )
{
- return pipe->winsys->buffer_create(pipe->winsys, alignment, usage, size);
+ return screen->winsys->buffer_create(screen->winsys, alignment, usage, size);
}
static INLINE struct pipe_buffer *
-pipe_user_buffer_create( struct pipe_context *pipe, void *ptr, unsigned size )
+pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size )
{
- return pipe->winsys->user_buffer_create(pipe->winsys, ptr, size);
+ return screen->winsys->user_buffer_create(screen->winsys, ptr, size);
}
static INLINE void
-pipe_buffer_destroy( struct pipe_context *pipe, struct pipe_buffer *buf )
+pipe_buffer_destroy( struct pipe_screen *screen, struct pipe_buffer *buf )
{
- pipe->winsys->buffer_destroy(pipe->winsys, buf);
+ screen->winsys->buffer_destroy(screen->winsys, buf);
}
static INLINE void *
-pipe_buffer_map(struct pipe_context *pipe,
+pipe_buffer_map(struct pipe_screen *screen,
struct pipe_buffer *buf,
unsigned usage)
{
- return pipe->winsys->buffer_map(pipe->winsys, buf, usage);
+ return screen->winsys->buffer_map(screen->winsys, buf, usage);
}
static INLINE void
-pipe_buffer_unmap(struct pipe_context *pipe,
+pipe_buffer_unmap(struct pipe_screen *screen,
struct pipe_buffer *buf)
{
- pipe->winsys->buffer_unmap(pipe->winsys, buf);
+ screen->winsys->buffer_unmap(screen->winsys, buf);
}
/* XXX when we're using this everywhere, get rid of
- * pipe_buffer_reference() above.
+ * winsys_buffer_reference() above.
*/
static INLINE void
-pipe_reference_buffer(struct pipe_context *pipe,
+pipe_buffer_reference(struct pipe_screen *screen,
struct pipe_buffer **ptr,
struct pipe_buffer *buf)
{
- pipe_buffer_reference(pipe->winsys, ptr, buf);
+ winsys_buffer_reference(screen->winsys, ptr, buf);
}
diff --git a/src/gallium/state_trackers/python/p_context.i b/src/gallium/state_trackers/python/p_context.i
index 0b2621f7c3..231e07cd63 100644
--- a/src/gallium/state_trackers/python/p_context.i
+++ b/src/gallium/state_trackers/python/p_context.i
@@ -248,7 +248,7 @@ struct st_context {
util_draw_vertex_buffer(pipe, vbuf, prim, num_verts, num_attribs);
error2:
- pipe_buffer_reference(pipe->winsys, &vbuf, NULL);
+ pipe_buffer_reference(pipe->screen, &vbuf, NULL);
error1:
;
}
diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c
index f71d85dd9b..bd71755f0b 100644
--- a/src/gallium/state_trackers/python/st_device.c
+++ b/src/gallium/state_trackers/python/st_device.c
@@ -293,7 +293,7 @@ st_buffer_destroy(struct st_buffer *st_buf)
{
if(st_buf) {
struct pipe_winsys *winsys = st_buf->st_dev->screen->winsys;
- pipe_buffer_reference(winsys, &st_buf->buffer, NULL);
+ pipe_buffer_reference(pipe->screen, &st_buf->buffer, NULL);
FREE(st_buf);
}
}
diff --git a/src/gallium/state_trackers/python/st_softpipe_winsys.c b/src/gallium/state_trackers/python/st_softpipe_winsys.c
index 2d4f5434b3..f62113a469 100644
--- a/src/gallium/state_trackers/python/st_softpipe_winsys.c
+++ b/src/gallium/state_trackers/python/st_softpipe_winsys.c
@@ -221,7 +221,7 @@ st_softpipe_surface_release(struct pipe_winsys *winsys,
surf->refcount--;
if (surf->refcount == 0) {
if (surf->buffer)
- pipe_buffer_reference(winsys, &surf->buffer, NULL);
+ winsys_buffer_reference(winsys, &surf->buffer, NULL);
free(surf);
}
*s = NULL;
diff --git a/src/gallium/winsys/drm/intel/dri/intel_screen.c b/src/gallium/winsys/drm/intel/dri/intel_screen.c
index 46d4861e77..3a486481f5 100644
--- a/src/gallium/winsys/drm/intel/dri/intel_screen.c
+++ b/src/gallium/winsys/drm/intel/dri/intel_screen.c
@@ -83,7 +83,7 @@ intelCreateSurface(struct intel_screen *intelScreen, struct pipe_winsys *winsys,
buffer);
/* Unref the buffer we don't need it anyways */
- pipe_buffer_reference(screen->winsys, &buffer, NULL);
+ pipe_buffer_reference(screen, &buffer, NULL);
surface = screen->get_tex_surface(screen,
texture,
diff --git a/src/gallium/winsys/egl_xlib/sw_winsys.c b/src/gallium/winsys/egl_xlib/sw_winsys.c
index ae81d7f801..2fd190da52 100644
--- a/src/gallium/winsys/egl_xlib/sw_winsys.c
+++ b/src/gallium/winsys/egl_xlib/sw_winsys.c
@@ -216,7 +216,7 @@ surface_release(struct pipe_winsys *winsys, struct pipe_surface **s)
surf->refcount--;
if (surf->refcount == 0) {
if (surf->buffer)
- pipe_buffer_reference(winsys, &surf->buffer, NULL);
+ winsys_buffer_reference(winsys, &surf->buffer, NULL);
free(surf);
}
*s = NULL;
diff --git a/src/gallium/winsys/gdi/wmesa.c b/src/gallium/winsys/gdi/wmesa.c
index 730fb1b541..ed3dd2b927 100644
--- a/src/gallium/winsys/gdi/wmesa.c
+++ b/src/gallium/winsys/gdi/wmesa.c
@@ -463,7 +463,7 @@ wm_surface_release(struct pipe_winsys *winsys, struct pipe_surface **s)
surf->refcount--;
if (surf->refcount == 0) {
if (surf->buffer)
- pipe_buffer_reference(winsys, &surf->buffer, NULL);
+ winsys_buffer_reference(winsys, &surf->buffer, NULL);
free(surf);
}
*s = NULL;
diff --git a/src/gallium/winsys/xlib/xm_winsys.c b/src/gallium/winsys/xlib/xm_winsys.c
index 68ead7f528..70f01e0ef8 100644
--- a/src/gallium/winsys/xlib/xm_winsys.c
+++ b/src/gallium/winsys/xlib/xm_winsys.c
@@ -543,7 +543,7 @@ xm_surface_release(struct pipe_winsys *winsys, struct pipe_surface **s)
surf->refcount--;
if (surf->refcount == 0) {
if (surf->buffer)
- pipe_buffer_reference(winsys, &surf->buffer, NULL);
+ winsys_buffer_reference(winsys, &surf->buffer, NULL);
free(surf);
}
*s = NULL;
diff --git a/src/gallium/winsys/xlib/xm_winsys_aub.c b/src/gallium/winsys/xlib/xm_winsys_aub.c
index 35c4ebc4ba..b7c10b6bca 100644
--- a/src/gallium/winsys/xlib/xm_winsys_aub.c
+++ b/src/gallium/winsys/xlib/xm_winsys_aub.c
@@ -308,7 +308,7 @@ aub_i915_surface_release(struct pipe_winsys *winsys, struct pipe_surface **s)
surf->refcount--;
if (surf->refcount == 0) {
if (surf->buffer)
- pipe_buffer_reference(winsys, &surf->buffer, NULL);
+ winsys_buffer_reference(winsys, &surf->buffer, NULL);
free(surf);
}
*s = NULL;