summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_surface.c
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/drivers/r300/r300_surface.c
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/drivers/r300/r300_surface.c')
-rw-r--r--src/gallium/drivers/r300/r300_surface.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
index 7711e8f569f..c9e2dff14ed 100644
--- a/src/gallium/drivers/r300/r300_surface.c
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -120,8 +120,11 @@ fallback:
/* Make sure our target BO is okay. */
validate:
- r300->winsys->add_buffer(r300->winsys, tex->buffer,
- 0, RADEON_GEM_DOMAIN_VRAM);
+ if (!r300->winsys->add_buffer(r300->winsys, tex->buffer,
+ 0, RADEON_GEM_DOMAIN_VRAM)) {
+ r300->context.flush(&r300->context, 0, NULL);
+ goto validate;
+ }
if (r300->winsys->validate(r300->winsys)) {
r300->context.flush(&r300->context, 0, NULL);
if (invalid) {
@@ -242,10 +245,16 @@ fallback:
/* Add our target BOs to the list. */
validate:
- r300->winsys->add_buffer(r300->winsys, srctex->buffer,
- RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
- r300->winsys->add_buffer(r300->winsys, desttex->buffer,
- 0, RADEON_GEM_DOMAIN_VRAM);
+ if (!r300->winsys->add_buffer(r300->winsys, srctex->buffer,
+ RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0)) {
+ r300->context.flush(&r300->context, 0, NULL);
+ goto validate;
+ }
+ if (!r300->winsys->add_buffer(r300->winsys, desttex->buffer,
+ 0, RADEON_GEM_DOMAIN_VRAM)) {
+ r300->context.flush(&r300->context, 0, NULL);
+ goto validate;
+ }
if (r300->winsys->validate(r300->winsys)) {
r300->context.flush(&r300->context, 0, NULL);
if (invalid) {