summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-03-13 06:07:33 +0100
committerMarek Olšák <[email protected]>2010-03-13 18:23:27 +0100
commitbcec6d851ce6ec2d948f03e5a1adfb5871e4e627 (patch)
tree9c989e991db8886d7c39e982be108d837ef45f33 /src/gallium/winsys
parente31bca139f720396d1a1639b46d37aee4fd9736e (diff)
r300g: refrain from using immediate mode if it causes slowdown
E.g. when mapping buffers could flush CS or cause waiting for a busy buffer. The side effect of this is it also fixes progs/demos/arbocclude however a separate fix should be proposed to address this issue in other cases it might occur.
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_buffer.c14
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_winsys.h3
2 files changed, 17 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 daa032af6f2..25b58b2926c 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
@@ -213,6 +213,18 @@ static void radeon_buffer_unmap(struct pipe_winsys *ws,
}
}
+static boolean radeon_is_buffer_referenced(struct radeon_winsys *ws,
+ struct pipe_buffer *buffer)
+{
+ struct radeon_pipe_buffer *radeon_buffer =
+ (struct radeon_pipe_buffer*)buffer;
+ uint32_t domain;
+
+ /* Referenced by CS or HW. */
+ return radeon_bo_is_referenced_by_cs(radeon_buffer->bo, ws->priv->cs) ||
+ radeon_bo_is_busy(radeon_buffer->bo, &domain);
+}
+
static void radeon_buffer_set_tiling(struct radeon_winsys *ws,
struct pipe_buffer *buffer,
uint32_t pitch,
@@ -370,5 +382,7 @@ struct radeon_winsys* radeon_pipe_winsys(int fd)
radeon_ws->buffer_from_handle = radeon_buffer_from_handle;
radeon_ws->buffer_get_handle = radeon_buffer_get_handle;
+ radeon_ws->is_buffer_referenced = radeon_is_buffer_referenced;
+
return radeon_ws;
}
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h
index 37eeb459791..887a381cc49 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h
+++ b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h
@@ -118,6 +118,9 @@ struct radeon_winsys {
uint32_t pitch,
boolean microtiled,
boolean macrotiled);
+
+ boolean (*is_buffer_referenced)(struct radeon_winsys *winsys,
+ struct pipe_buffer *buffer);
};
#endif