aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/rbug
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/rbug')
-rw-r--r--src/gallium/drivers/rbug/rbug_context.c231
-rw-r--r--src/gallium/drivers/rbug/rbug_core.c2
-rw-r--r--src/gallium/drivers/rbug/rbug_screen.c20
3 files changed, 200 insertions, 53 deletions
diff --git a/src/gallium/drivers/rbug/rbug_context.c b/src/gallium/drivers/rbug/rbug_context.c
index 4a5d5413d8c..6e2d6ba1efa 100644
--- a/src/gallium/drivers/rbug/rbug_context.c
+++ b/src/gallium/drivers/rbug/rbug_context.c
@@ -44,7 +44,10 @@ rbug_destroy(struct pipe_context *_pipe)
struct pipe_context *pipe = rb_pipe->pipe;
remove_from_list(&rb_pipe->list);
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->destroy(pipe);
+ rb_pipe->pipe = NULL;
+ pipe_mutex_unlock(rb_pipe->call_mutex);
FREE(rb_pipe);
}
@@ -112,7 +115,12 @@ rbug_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info)
pipe_mutex_lock(rb_pipe->draw_mutex);
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_BEFORE);
- pipe->draw_vbo(pipe, info);
+ pipe_mutex_lock(rb_pipe->call_mutex);
+ if (!(rb_pipe->curr.fs && rb_pipe->curr.fs->disabled) &&
+ !(rb_pipe->curr.gs && rb_pipe->curr.gs->disabled) &&
+ !(rb_pipe->curr.vs && rb_pipe->curr.vs->disabled))
+ pipe->draw_vbo(pipe, info);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_AFTER);
pipe_mutex_unlock(rb_pipe->draw_mutex);
@@ -125,8 +133,10 @@ rbug_create_query(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
return pipe->create_query(pipe,
query_type);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -136,8 +146,10 @@ rbug_destroy_query(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->destroy_query(pipe,
query);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -147,8 +159,10 @@ rbug_begin_query(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->begin_query(pipe,
query);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -158,8 +172,10 @@ rbug_end_query(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->end_query(pipe,
query);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static boolean
@@ -170,11 +186,16 @@ rbug_get_query_result(struct pipe_context *_pipe,
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ boolean ret;
- return pipe->get_query_result(pipe,
- query,
- wait,
- result);
+ pipe_mutex_lock(rb_pipe->call_mutex);
+ ret = pipe->get_query_result(pipe,
+ query,
+ wait,
+ result);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
+
+ return ret;
}
static void *
@@ -183,9 +204,14 @@ rbug_create_blend_state(struct pipe_context *_pipe,
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ void *ret;
+
+ pipe_mutex_lock(rb_pipe->call_mutex);
+ ret = pipe->create_blend_state(pipe,
+ blend);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
- return pipe->create_blend_state(pipe,
- blend);
+ return ret;
}
static void
@@ -195,8 +221,10 @@ rbug_bind_blend_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->bind_blend_state(pipe,
- blend);
+ blend);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -206,8 +234,10 @@ rbug_delete_blend_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->delete_blend_state(pipe,
blend);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void *
@@ -216,9 +246,14 @@ rbug_create_sampler_state(struct pipe_context *_pipe,
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ void *ret;
+
+ pipe_mutex_lock(rb_pipe->call_mutex);
+ ret = pipe->create_sampler_state(pipe,
+ sampler);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
- return pipe->create_sampler_state(pipe,
- sampler);
+ return ret;
}
static void
@@ -229,9 +264,11 @@ rbug_bind_fragment_sampler_states(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->bind_fragment_sampler_states(pipe,
num_samplers,
samplers);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -242,9 +279,11 @@ rbug_bind_vertex_sampler_states(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->bind_vertex_sampler_states(pipe,
num_samplers,
samplers);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -254,8 +293,10 @@ rbug_delete_sampler_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->delete_sampler_state(pipe,
sampler);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void *
@@ -264,9 +305,14 @@ rbug_create_rasterizer_state(struct pipe_context *_pipe,
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ void *ret;
- return pipe->create_rasterizer_state(pipe,
- rasterizer);
+ pipe_mutex_lock(rb_pipe->call_mutex);
+ ret = pipe->create_rasterizer_state(pipe,
+ rasterizer);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
+
+ return ret;
}
static void
@@ -276,8 +322,10 @@ rbug_bind_rasterizer_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->bind_rasterizer_state(pipe,
rasterizer);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -287,8 +335,10 @@ rbug_delete_rasterizer_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->delete_rasterizer_state(pipe,
rasterizer);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void *
@@ -297,9 +347,14 @@ rbug_create_depth_stencil_alpha_state(struct pipe_context *_pipe,
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ void *ret;
+
+ pipe_mutex_lock(rb_pipe->call_mutex);
+ ret = pipe->create_depth_stencil_alpha_state(pipe,
+ depth_stencil_alpha);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
- return pipe->create_depth_stencil_alpha_state(pipe,
- depth_stencil_alpha);
+ return ret;
}
static void
@@ -309,8 +364,10 @@ rbug_bind_depth_stencil_alpha_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->bind_depth_stencil_alpha_state(pipe,
depth_stencil_alpha);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -320,8 +377,10 @@ rbug_delete_depth_stencil_alpha_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->delete_depth_stencil_alpha_state(pipe,
depth_stencil_alpha);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void *
@@ -332,7 +391,10 @@ rbug_create_fs_state(struct pipe_context *_pipe,
struct pipe_context *pipe = rb_pipe->pipe;
void *result;
+ pipe_mutex_lock(rb_pipe->call_mutex);
result = pipe->create_fs_state(pipe, state);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
+
if (!result)
return NULL;
@@ -347,10 +409,14 @@ rbug_bind_fs_state(struct pipe_context *_pipe,
struct pipe_context *pipe = rb_pipe->pipe;
void *fs;
+ pipe_mutex_lock(rb_pipe->call_mutex);
+
fs = rbug_shader_unwrap(_fs);
rb_pipe->curr.fs = rbug_shader(_fs);
pipe->bind_fs_state(pipe,
fs);
+
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -360,7 +426,9 @@ rbug_delete_fs_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct rbug_shader *rb_shader = rbug_shader(_fs);
+ pipe_mutex_lock(rb_pipe->call_mutex);
rbug_shader_destroy(rb_pipe, rb_shader);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void *
@@ -371,7 +439,10 @@ rbug_create_vs_state(struct pipe_context *_pipe,
struct pipe_context *pipe = rb_pipe->pipe;
void *result;
+ pipe_mutex_lock(rb_pipe->call_mutex);
result = pipe->create_vs_state(pipe, state);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
+
if (!result)
return NULL;
@@ -386,10 +457,14 @@ rbug_bind_vs_state(struct pipe_context *_pipe,
struct pipe_context *pipe = rb_pipe->pipe;
void *vs;
+ pipe_mutex_lock(rb_pipe->call_mutex);
+
vs = rbug_shader_unwrap(_vs);
rb_pipe->curr.vs = rbug_shader(_vs);
pipe->bind_vs_state(pipe,
vs);
+
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -399,7 +474,9 @@ rbug_delete_vs_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct rbug_shader *rb_shader = rbug_shader(_vs);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
rbug_shader_destroy(rb_pipe, rb_shader);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void *
@@ -410,7 +487,10 @@ rbug_create_gs_state(struct pipe_context *_pipe,
struct pipe_context *pipe = rb_pipe->pipe;
void *result;
+ pipe_mutex_lock(rb_pipe->call_mutex);
result = pipe->create_gs_state(pipe, state);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
+
if (!result)
return NULL;
@@ -425,10 +505,14 @@ rbug_bind_gs_state(struct pipe_context *_pipe,
struct pipe_context *pipe = rb_pipe->pipe;
void *gs;
+ pipe_mutex_lock(rb_pipe->call_mutex);
+
gs = rbug_shader_unwrap(_gs);
rb_pipe->curr.gs = rbug_shader(_gs);
pipe->bind_gs_state(pipe,
gs);
+
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -438,7 +522,9 @@ rbug_delete_gs_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct rbug_shader *rb_shader = rbug_shader(_gs);
+ pipe_mutex_lock(rb_pipe->call_mutex);
rbug_shader_destroy(rb_pipe, rb_shader);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void *
@@ -448,10 +534,15 @@ rbug_create_vertex_elements_state(struct pipe_context *_pipe,
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ void *ret;
- return pipe->create_vertex_elements_state(pipe,
+ pipe_mutex_lock(rb_pipe->call_mutex);
+ ret = pipe->create_vertex_elements_state(pipe,
num_elements,
vertex_elements);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
+
+ return ret;
}
static void
@@ -461,8 +552,10 @@ rbug_bind_vertex_elements_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->bind_vertex_elements_state(pipe,
velems);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -472,8 +565,10 @@ rbug_delete_vertex_elements_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->delete_vertex_elements_state(pipe,
velems);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -483,8 +578,10 @@ rbug_set_blend_color(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->set_blend_color(pipe,
blend_color);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -494,8 +591,10 @@ rbug_set_stencil_ref(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->set_stencil_ref(pipe,
stencil_ref);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -505,8 +604,10 @@ rbug_set_clip_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->set_clip_state(pipe,
clip);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -526,10 +627,12 @@ rbug_set_constant_buffer(struct pipe_context *_pipe,
resource = unwrapped_resource;
}
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->set_constant_buffer(pipe,
shader,
index,
resource);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -542,6 +645,9 @@ rbug_set_framebuffer_state(struct pipe_context *_pipe,
struct pipe_framebuffer_state *state = NULL;
unsigned i;
+ /* must protect curr status */
+ pipe_mutex_lock(rb_pipe->call_mutex);
+
rb_pipe->curr.nr_cbufs = 0;
memset(rb_pipe->curr.cbufs, 0, sizeof(rb_pipe->curr.cbufs));
rb_pipe->curr.zsbuf = NULL;
@@ -564,6 +670,8 @@ rbug_set_framebuffer_state(struct pipe_context *_pipe,
pipe->set_framebuffer_state(pipe,
state);
+
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -573,8 +681,10 @@ rbug_set_polygon_stipple(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->set_polygon_stipple(pipe,
poly_stipple);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -584,8 +694,10 @@ rbug_set_scissor_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->set_scissor_state(pipe,
scissor);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -595,8 +707,10 @@ rbug_set_viewport_state(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->set_viewport_state(pipe,
viewport);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -610,6 +724,9 @@ rbug_set_fragment_sampler_views(struct pipe_context *_pipe,
struct pipe_sampler_view **views = NULL;
unsigned i;
+ /* must protect curr status */
+ pipe_mutex_lock(rb_pipe->call_mutex);
+
rb_pipe->curr.num_fs_views = 0;
memset(rb_pipe->curr.fs_views, 0, sizeof(rb_pipe->curr.fs_views));
memset(rb_pipe->curr.fs_texs, 0, sizeof(rb_pipe->curr.fs_texs));
@@ -626,6 +743,8 @@ rbug_set_fragment_sampler_views(struct pipe_context *_pipe,
}
pipe->set_fragment_sampler_views(pipe, num, views);
+
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -639,6 +758,9 @@ rbug_set_vertex_sampler_views(struct pipe_context *_pipe,
struct pipe_sampler_view **views = NULL;
unsigned i;
+ /* must protect curr status */
+ pipe_mutex_lock(rb_pipe->call_mutex);
+
rb_pipe->curr.num_vs_views = 0;
memset(rb_pipe->curr.vs_views, 0, sizeof(rb_pipe->curr.vs_views));
memset(rb_pipe->curr.vs_texs, 0, sizeof(rb_pipe->curr.vs_texs));
@@ -655,6 +777,8 @@ rbug_set_vertex_sampler_views(struct pipe_context *_pipe,
}
pipe->set_vertex_sampler_views(pipe, num, views);
+
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -668,6 +792,8 @@ rbug_set_vertex_buffers(struct pipe_context *_pipe,
struct pipe_vertex_buffer *buffers = NULL;
unsigned i;
+ pipe_mutex_lock(rb_pipe->call_mutex);
+
if (num_buffers) {
memcpy(unwrapped_buffers, _buffers, num_buffers * sizeof(*_buffers));
for (i = 0; i < num_buffers; i++)
@@ -678,6 +804,8 @@ rbug_set_vertex_buffers(struct pipe_context *_pipe,
pipe->set_vertex_buffers(pipe,
num_buffers,
buffers);
+
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -694,7 +822,9 @@ rbug_set_index_buffer(struct pipe_context *_pipe,
ib = &unwrapped_ib;
}
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->set_index_buffer(pipe, ib);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -704,7 +834,9 @@ rbug_set_sample_mask(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->set_sample_mask(pipe, sample_mask);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -725,6 +857,7 @@ rbug_resource_copy_region(struct pipe_context *_pipe,
struct pipe_resource *dst = rb_resource_dst->resource;
struct pipe_resource *src = rb_resource_src->resource;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->resource_copy_region(pipe,
dst,
dst_level,
@@ -734,6 +867,7 @@ rbug_resource_copy_region(struct pipe_context *_pipe,
src,
src_level,
src_box);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -746,11 +880,13 @@ rbug_clear(struct pipe_context *_pipe,
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->clear(pipe,
buffers,
rgba,
depth,
stencil);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -765,6 +901,7 @@ rbug_clear_render_target(struct pipe_context *_pipe,
struct pipe_context *pipe = rb_pipe->pipe;
struct pipe_surface *dst = rb_surface_dst->surface;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->clear_render_target(pipe,
dst,
rgba,
@@ -772,6 +909,7 @@ rbug_clear_render_target(struct pipe_context *_pipe,
dsty,
width,
height);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
@@ -788,6 +926,7 @@ rbug_clear_depth_stencil(struct pipe_context *_pipe,
struct pipe_context *pipe = rb_pipe->pipe;
struct pipe_surface *dst = rb_surface_dst->surface;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->clear_depth_stencil(pipe,
dst,
clear_flags,
@@ -797,36 +936,20 @@ rbug_clear_depth_stencil(struct pipe_context *_pipe,
dsty,
width,
height);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void
rbug_flush(struct pipe_context *_pipe,
- unsigned flags,
struct pipe_fence_handle **fence)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
+ pipe_mutex_lock(rb_pipe->call_mutex);
pipe->flush(pipe,
- flags,
fence);
-}
-
-static unsigned int
-rbug_is_resource_referenced(struct pipe_context *_pipe,
- struct pipe_resource *_resource,
- unsigned level,
- int layer)
-{
- struct rbug_context *rb_pipe = rbug_context(_pipe);
- struct rbug_resource *rb_resource = rbug_resource(_resource);
- struct pipe_context *pipe = rb_pipe->pipe;
- struct pipe_resource *resource = rb_resource->resource;
-
- return pipe->is_resource_referenced(pipe,
- resource,
- level,
- layer);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static struct pipe_sampler_view *
@@ -840,9 +963,11 @@ rbug_context_create_sampler_view(struct pipe_context *_pipe,
struct pipe_resource *resource = rb_resource->resource;
struct pipe_sampler_view *result;
+ pipe_mutex_lock(rb_pipe->call_mutex);
result = pipe->create_sampler_view(pipe,
resource,
templ);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
if (result)
return rbug_sampler_view_create(rb_pipe, rb_resource, result);
@@ -868,9 +993,11 @@ rbug_context_create_surface(struct pipe_context *_pipe,
struct pipe_resource *resource = rb_resource->resource;
struct pipe_surface *result;
+ pipe_mutex_lock(rb_pipe->call_mutex);
result = pipe->create_surface(pipe,
resource,
surf_tmpl);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
if (result)
return rbug_surface_create(rb_pipe, rb_resource, result);
@@ -881,8 +1008,13 @@ static void
rbug_context_surface_destroy(struct pipe_context *_pipe,
struct pipe_surface *_surface)
{
- rbug_surface_destroy(rbug_context(_pipe),
- rbug_surface(_surface));
+ struct rbug_context *rb_pipe = rbug_context(_pipe);
+ struct rbug_surface *rb_surface = rbug_surface(_surface);
+
+ pipe_mutex_lock(rb_pipe->call_mutex);
+ rbug_surface_destroy(rb_pipe,
+ rb_surface);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
@@ -900,11 +1032,13 @@ rbug_context_get_transfer(struct pipe_context *_context,
struct pipe_resource *resource = rb_resource->resource;
struct pipe_transfer *result;
+ pipe_mutex_lock(rb_pipe->call_mutex);
result = context->get_transfer(context,
resource,
level,
usage,
box);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
if (result)
return rbug_transfer_create(rb_pipe, rb_resource, result);
@@ -915,8 +1049,13 @@ static void
rbug_context_transfer_destroy(struct pipe_context *_pipe,
struct pipe_transfer *_transfer)
{
- rbug_transfer_destroy(rbug_context(_pipe),
- rbug_transfer(_transfer));
+ struct rbug_context *rb_pipe = rbug_context(_pipe);
+ struct rbug_transfer *rb_transfer =rbug_transfer(_transfer);
+
+ pipe_mutex_lock(rb_pipe->call_mutex);
+ rbug_transfer_destroy(rb_pipe,
+ rb_transfer);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
static void *
@@ -927,9 +1066,14 @@ rbug_context_transfer_map(struct pipe_context *_context,
struct rbug_transfer *rb_transfer = rbug_transfer(_transfer);
struct pipe_context *context = rb_pipe->pipe;
struct pipe_transfer *transfer = rb_transfer->transfer;
+ void *ret;
- return context->transfer_map(context,
+ pipe_mutex_lock(rb_pipe->call_mutex);
+ ret = context->transfer_map(context,
transfer);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
+
+ return ret;
}
@@ -944,9 +1088,11 @@ rbug_context_transfer_flush_region(struct pipe_context *_context,
struct pipe_context *context = rb_pipe->pipe;
struct pipe_transfer *transfer = rb_transfer->transfer;
+ pipe_mutex_lock(rb_pipe->call_mutex);
context->transfer_flush_region(context,
transfer,
box);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
@@ -959,8 +1105,10 @@ rbug_context_transfer_unmap(struct pipe_context *_context,
struct pipe_context *context = rb_pipe->pipe;
struct pipe_transfer *transfer = rb_transfer->transfer;
+ pipe_mutex_lock(rb_pipe->call_mutex);
context->transfer_unmap(context,
transfer);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
@@ -979,6 +1127,7 @@ rbug_context_transfer_inline_write(struct pipe_context *_context,
struct pipe_context *context = rb_pipe->pipe;
struct pipe_resource *resource = rb_resource->resource;
+ pipe_mutex_lock(rb_pipe->call_mutex);
context->transfer_inline_write(context,
resource,
level,
@@ -987,6 +1136,7 @@ rbug_context_transfer_inline_write(struct pipe_context *_context,
data,
stride,
layer_stride);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
@@ -999,7 +1149,9 @@ static void rbug_redefine_user_buffer(struct pipe_context *_context,
struct pipe_context *context = rb_pipe->pipe;
struct pipe_resource *resource = rb_resource->resource;
+ pipe_mutex_lock(rb_pipe->call_mutex);
context->redefine_user_buffer(context, resource, offset, size);
+ pipe_mutex_unlock(rb_pipe->call_mutex);
}
@@ -1077,7 +1229,6 @@ rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
rb_pipe->base.clear_render_target = rbug_clear_render_target;
rb_pipe->base.clear_depth_stencil = rbug_clear_depth_stencil;
rb_pipe->base.flush = rbug_flush;
- rb_pipe->base.is_resource_referenced = rbug_is_resource_referenced;
rb_pipe->base.create_sampler_view = rbug_context_create_sampler_view;
rb_pipe->base.sampler_view_destroy = rbug_context_sampler_view_destroy;
rb_pipe->base.create_surface = rbug_context_create_surface;
diff --git a/src/gallium/drivers/rbug/rbug_core.c b/src/gallium/drivers/rbug/rbug_core.c
index eb772d19d05..b80bcd4228f 100644
--- a/src/gallium/drivers/rbug/rbug_core.c
+++ b/src/gallium/drivers/rbug/rbug_core.c
@@ -498,7 +498,7 @@ rbug_context_flush(struct rbug_rbug *tr_rbug, struct rbug_header *header, uint32
/* protect the pipe context */
pipe_mutex_lock(rb_context->call_mutex);
- rb_context->pipe->flush(rb_context->pipe, flush->flags, NULL);
+ rb_context->pipe->flush(rb_context->pipe, NULL);
pipe_mutex_unlock(rb_context->call_mutex);
pipe_mutex_unlock(rb_screen->list_mutex);
diff --git a/src/gallium/drivers/rbug/rbug_screen.c b/src/gallium/drivers/rbug/rbug_screen.c
index d635ce575c0..7c8dfdcc12a 100644
--- a/src/gallium/drivers/rbug/rbug_screen.c
+++ b/src/gallium/drivers/rbug/rbug_screen.c
@@ -106,8 +106,7 @@ rbug_screen_is_format_supported(struct pipe_screen *_screen,
enum pipe_format format,
enum pipe_texture_target target,
unsigned sample_count,
- unsigned tex_usage,
- unsigned geom_flags)
+ unsigned tex_usage)
{
struct rbug_screen *rb_screen = rbug_screen(_screen);
struct pipe_screen *screen = rb_screen->screen;
@@ -116,8 +115,7 @@ rbug_screen_is_format_supported(struct pipe_screen *_screen,
format,
target,
sample_count,
- tex_usage,
- geom_flags);
+ tex_usage);
}
static struct pipe_context *
@@ -240,30 +238,28 @@ rbug_screen_fence_reference(struct pipe_screen *_screen,
fence);
}
-static int
+static boolean
rbug_screen_fence_signalled(struct pipe_screen *_screen,
- struct pipe_fence_handle *fence,
- unsigned flags)
+ struct pipe_fence_handle *fence)
{
struct rbug_screen *rb_screen = rbug_screen(_screen);
struct pipe_screen *screen = rb_screen->screen;
return screen->fence_signalled(screen,
- fence,
- flags);
+ fence);
}
-static int
+static boolean
rbug_screen_fence_finish(struct pipe_screen *_screen,
struct pipe_fence_handle *fence,
- unsigned flags)
+ uint64_t timeout)
{
struct rbug_screen *rb_screen = rbug_screen(_screen);
struct pipe_screen *screen = rb_screen->screen;
return screen->fence_finish(screen,
fence,
- flags);
+ timeout);
}
boolean