aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-05-28 07:46:34 -0700
committerCorbin Simpson <[email protected]>2009-05-28 07:46:34 -0700
commitb70fcd620d69850c6e19213d84ae4584e77ab689 (patch)
treed0292c639f8adf47b05e358733f59646ec4117f0 /src/gallium/winsys
parent534f1e8f022ea7408c2ad49013e8f2446aa16364 (diff)
r300-gallium, radeon-gallium: Make add_buffer indicate when a flush is needed.
On a side note, why is RADEON_MAX_BOS 24? Should ask airlied about that.
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_r300.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
index 995bf6aa22b..63aa3179ac8 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
@@ -22,10 +22,10 @@
#include "radeon_r300.h"
-static void radeon_r300_add_buffer(struct r300_winsys* winsys,
- struct pipe_buffer* pbuffer,
- uint32_t rd,
- uint32_t wd)
+static boolean radeon_r300_add_buffer(struct r300_winsys* winsys,
+ struct pipe_buffer* pbuffer,
+ uint32_t rd,
+ uint32_t wd)
{
int i;
struct radeon_winsys_priv* priv =
@@ -35,7 +35,6 @@ static void radeon_r300_add_buffer(struct r300_winsys* winsys,
/* Check to see if this BO is already in line for validation;
* find a slot for it otherwise. */
- assert(priv->bo_count <= RADEON_MAX_BOS);
for (i = 0; i < priv->bo_count; i++) {
if (sc[i].bo == bo) {
sc[i].read_domains |= rd;
@@ -44,10 +43,17 @@ static void radeon_r300_add_buffer(struct r300_winsys* winsys,
}
}
+ if (priv->bo_count >= RADEON_MAX_BOS) {
+ /* Dohoho. Not falling for that one again. Request a flush. */
+ return FALSE;
+ }
+
sc[priv->bo_count].bo = bo;
sc[priv->bo_count].read_domains = rd;
sc[priv->bo_count].write_domain = wd;
priv->bo_count++;
+
+ return TRUE;
}
static boolean radeon_r300_validate(struct r300_winsys* winsys)