summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-02-05 01:03:35 -0800
committerEric Anholt <eric@anholt.net>2010-02-06 14:10:07 +0100
commit67e5fd73973eaedf5ec6e0b5139b61f6196fb35c (patch)
treed0e4a88ae86efc3eb9562621ae7669395f4191c3
parent12d0721ae156bbb6c1bda1e28cfc71fe081a2a4c (diff)
intel: Check aperture size when doing a blit glClear.
Fixes failure in cairo-gl firefox-planet-gnome.
-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 31d4f3d421..1fd07e8b82 100644
--- a/src/mesa/drivers/dri/intel/intel_blit.c
+++ b/src/mesa/drivers/dri/intel/intel_blit.c
@@ -250,6 +250,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
uint32_t clear_val;
uint32_t BR13, CMD;
int pitch, cpp;
+ drm_intel_bo *aper_array[2];
if (!(mask & bufBit))
continue;
@@ -340,6 +341,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);
OUT_BATCH(CMD);
OUT_BATCH(BR13);