summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/radeon/drm
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2010-08-28 18:59:32 +1000
committerDave Airlie <[email protected]>2010-09-12 13:32:43 +1000
commitb5fcf0c8e07e666523b007fab1d0fc18c2c89241 (patch)
tree2cd8fdfbe697531b04a9912e296df70d554db509 /src/gallium/winsys/radeon/drm
parent95555ed03e95f7472ad1f6c4b43e0aa7aaa13f93 (diff)
pb: add void * for flush ctx to mapping functions
If the buffer we are attempting to map is referenced by the unsubmitted command stream for this context, we need to flush the command stream, however to do that we need to be able to access the context at the lowest level map function, currently we set the buffer in the toplevel map, but this racy between context. (we probably have a lot more issues than that.) I'll look into a proper solution as suggested by jrfonseca when I get some time.
Diffstat (limited to 'src/gallium/winsys/radeon/drm')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_buffer.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
index 017eac8464e..cef59975ca8 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
@@ -89,10 +89,10 @@ static unsigned get_pb_usage_from_transfer_flags(enum pipe_transfer_usage usage)
static void *
radeon_drm_buffer_map_internal(struct pb_buffer *_buf,
- unsigned flags)
+ unsigned flags, void *flush_ctx)
{
struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf);
- struct radeon_libdrm_cs *cs = buf->cs;
+ struct radeon_libdrm_cs *cs = flush_ctx;
int write = 0;
if (flags & PB_USAGE_DONTBLOCK) {
@@ -293,12 +293,8 @@ void *radeon_drm_buffer_map(struct r300_winsys_screen *ws,
enum pipe_transfer_usage usage)
{
struct pb_buffer *_buf = radeon_pb_buffer(buf);
- struct radeon_drm_buffer *rbuf = get_drm_buffer(_buf);
- if (rbuf)
- rbuf->cs = radeon_libdrm_cs(cs);
-
- return pb_map(_buf, get_pb_usage_from_transfer_flags(usage));
+ return pb_map(_buf, get_pb_usage_from_transfer_flags(usage), radeon_libdrm_cs(cs));
}
void radeon_drm_buffer_unmap(struct r300_winsys_screen *ws,