summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/drm
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2009-12-04 15:54:29 +0100
committerCorbin Simpson <[email protected]>2009-12-04 09:23:59 -0800
commit042b524d48ebb15215430149b9b1653f4b46dee3 (patch)
tree7358877ab41887eb4c0a1de23a43538f0c378035 /src/gallium/winsys/drm
parent7679447b5835fd73ab44b3d77b12a034c95af5c5 (diff)
radeong: flush CS if a buffer being mapped is referenced by it
Also, overlapping occlusion queries seems to work now.
Diffstat (limited to 'src/gallium/winsys/drm')
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_buffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
index 0ca7b392554..2a8daed051d 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
@@ -140,10 +140,15 @@ static void *radeon_buffer_map(struct pipe_winsys *ws,
struct pipe_buffer *buffer,
unsigned flags)
{
+ struct radeon_winsys_priv *priv = ((struct radeon_winsys *)ws)->priv;
struct radeon_pipe_buffer *radeon_buffer =
(struct radeon_pipe_buffer*)buffer;
int write = 0;
+ if (radeon_bo_is_referenced_by_cs(radeon_buffer->bo, priv->cs)) {
+ priv->cs->space_flush_fn(priv->cs->space_flush_data);
+ }
+
if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) {
uint32_t domain;