aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915/i830_vtbl.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2008-08-08 13:58:48 -0700
committerEric Anholt <[email protected]>2008-08-08 14:00:43 -0700
commitd2796939f18815935c8fe1effb01fa9765d6c7d8 (patch)
tree207b657f757db711640029fe2e27ee657cbc04d0 /src/mesa/drivers/dri/i915/i830_vtbl.c
parent527e1cf172cb0a4d1f2891a351498669be1620cd (diff)
intel-gem: Update to new check_aperture API for classic mode.
To do this, I had to clean up some of 965 state upload stuff. We may end up over-emitting state in the aperture overflow case, but that should be rare, and I'd rather have the simplification of state management.
Diffstat (limited to 'src/mesa/drivers/dri/i915/i830_vtbl.c')
-rw-r--r--src/mesa/drivers/dri/i915/i830_vtbl.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c
index 0af5ed0b500..40a50ff772f 100644
--- a/src/mesa/drivers/dri/i915/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i830_vtbl.c
@@ -420,10 +420,12 @@ i830_emit_state(struct intel_context *intel)
{
struct i830_context *i830 = i830_context(&intel->ctx);
struct i830_hw_state *state = i830->current;
- int i, ret, count;
+ int i, count;
GLuint dirty;
GET_CURRENT_CONTEXT(ctx);
BATCH_LOCALS;
+ dri_bo *aper_array[3 + I830_TEX_UNITS];
+ int aper_count;
/* We don't hold the lock at this point, so want to make sure that
* there won't be a buffer wrap between the state emits and the primitive
@@ -441,22 +443,23 @@ i830_emit_state(struct intel_context *intel)
LOOP_CLIPRECTS);
count = 0;
again:
+ aper_count = 0;
dirty = get_dirty(state);
- ret = 0;
+ aper_array[aper_count++] = intel->batch->buf;
if (dirty & I830_UPLOAD_BUFFERS) {
- ret |= dri_bufmgr_check_aperture_space(state->draw_region->buffer);
- ret |= dri_bufmgr_check_aperture_space(state->depth_region->buffer);
+ aper_array[aper_count++] = state->draw_region->buffer;
+ aper_array[aper_count++] = state->depth_region->buffer;
}
-
+
for (i = 0; i < I830_TEX_UNITS; i++)
if (dirty & I830_UPLOAD_TEX(i)) {
if (state->tex_buffer[i]) {
- ret |= dri_bufmgr_check_aperture_space(state->tex_buffer[i]);
+ aper_array[aper_count++] = state->tex_buffer[i];
}
}
- if (ret) {
+ if (dri_bufmgr_check_aperture_space(aper_array, aper_count)) {
if (count == 0) {
count++;
intel_batchbuffer_flush(intel->batch);