summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-06-30 00:02:27 +0200
committerMarek Olšák <maraeo@gmail.com>2010-06-30 00:03:04 +0200
commitb939f83eb7af8f818c638453b2d2522b2362a831 (patch)
tree7d2e4e7a4610ce52d8a6b3695e2434fbb3ec26f6 /src
parent6a34287bb5147a3213e94d88c97db4ec403509ae (diff)
r300g: add workaround for multiple contexts
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r300/r300_context.c2
-rw-r--r--src/gallium/drivers/r300/r300_context.h1
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c7
3 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 59129bc24d..2fe2e0a96d 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -121,7 +121,7 @@ static void r300_destroy_context(struct pipe_context* context)
FREE(r300);
}
-static void r300_flush_cb(void *data)
+void r300_flush_cb(void *data)
{
struct r300_context* const cs_context_copy = data;
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index ac5ae23cb5..5bc5d98939 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -564,6 +564,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
boolean r300_check_cs(struct r300_context *r300, unsigned size);
void r300_finish(struct r300_context *r300);
+void r300_flush_cb(void *data);
/* Context initialization. */
struct draw_stage* r300_draw_stage(struct r300_context* r300);
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index 7959e6a2f9..f49f36b626 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -178,7 +178,14 @@ r300_buffer_transfer_map( struct pipe_context *pipe,
}
}
}
+
just_map:
+ /* XXX buffer_map might flush.
+ * We cannot flush here because there is a buffer manager between
+ * the context and winsys, and it does some magic to make the driver
+ * fast. This is a workaround for the case of multiple contexts. */
+ rws->set_flush_cb(rws, r300_flush_cb, pipe);
+
map = rws->buffer_map(rws, rbuf->buf, transfer->usage);
if (map == NULL)