summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-02-06 17:20:24 +0100
committerEric Anholt <eric@anholt.net>2010-02-06 17:45:34 +0100
commita1cac0732b53df8b08aa0ef1b440ea4398a467cc (patch)
treececbd2aa5289d6c64260e60fdf4ce9b018e0d384
parentfb32e0fcc551c335c358f3b14009714cfcfa872f (diff)
intel: Check aperture size when doing a blit glClear.
Fixes failure in cairo-gl firefox-planet-gnome. (cherry picked from commit 67e5fd73973eaedf5ec6e0b5139b61f6196fb35c) Conflicts: src/mesa/drivers/dri/intel/intel_blit.c
-rw-r--r--src/mesa/drivers/dri/intel/intel_blit.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c
index 5b94d05966..94bf1ceb53 100644
--- a/src/mesa/drivers/dri/intel/intel_blit.c
+++ b/src/mesa/drivers/dri/intel/intel_blit.c
@@ -376,6 +376,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
GLint cx, cy, cw, ch;
drm_clip_rect_t clear;
int i;
+ drm_intel_bo *aper_array[2];
/* Get clear bounds after locking */
cx = fb->_Xmin;
@@ -526,6 +527,15 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
assert(x1 < x2);
assert(y1 < y2);
+ /* do space check before going any further */
+ aper_array[0] = intel->batch->buf;
+ aper_array[1] = write_buffer;
+
+ if (drm_intel_bufmgr_check_aperture_space(aper_array,
+ ARRAY_SIZE(aper_array)) != 0) {
+ intel_batchbuffer_flush(intel->batch);
+ }
+
BEGIN_BATCH(6, REFERENCES_CLIPRECTS);
OUT_BATCH(CMD);
OUT_BATCH(BR13);