summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel
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/intel
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/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_batchbuffer.c4
-rw-r--r--src/mesa/drivers/dri/intel/intel_blit.c30
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.h1
3 files changed, 18 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
index 9ad9f6a6c0e..5afaad070cf 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
@@ -94,10 +94,6 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch)
batch->ptr = batch->map;
batch->dirty_state = ~0;
batch->cliprect_mode = IGNORE_CLIPRECTS;
-
- /* account batchbuffer in aperture */
- dri_bufmgr_check_aperture_space(batch->buf);
-
}
struct intel_batchbuffer *
diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c
index e9076f9ac97..7129a4ba917 100644
--- a/src/mesa/drivers/dri/intel/intel_blit.c
+++ b/src/mesa/drivers/dri/intel/intel_blit.c
@@ -54,7 +54,6 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
struct intel_context *intel;
const intelScreenPrivate *intelScreen;
- int ret;
DBG("%s\n", __FUNCTION__);
@@ -81,6 +80,7 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
unsigned short src_x, src_y;
int BR13, CMD;
int i;
+ dri_bo *aper_array[3];
src = intel_get_rb_region(&intel_fb->Base, BUFFER_BACK_LEFT);
dst = intel_get_rb_region(&intel_fb->Base, BUFFER_FRONT_LEFT);
@@ -116,16 +116,18 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
}
#endif
/* do space/cliprects check before going any further */
- intel_batchbuffer_require_space(intel->batch, 8 * 4, REFERENCES_CLIPRECTS);
+ intel_batchbuffer_require_space(intel->batch, 8 * 4,
+ REFERENCES_CLIPRECTS);
again:
- ret = dri_bufmgr_check_aperture_space(dst->buffer);
- ret |= dri_bufmgr_check_aperture_space(src->buffer);
-
- if (ret) {
+ aper_array[0] = intel->batch->buf;
+ aper_array[1] = dst->buffer;
+ aper_array[2] = src->buffer;
+
+ if (dri_bufmgr_check_aperture_space(aper_array, 3) != 0) {
intel_batchbuffer_flush(intel->batch);
goto again;
}
-
+
for (i = 0; i < nbox; i++, pbox++) {
drm_clip_rect_t box = *pbox;
@@ -273,17 +275,19 @@ intelEmitCopyBlit(struct intel_context *intel,
GLuint CMD, BR13;
int dst_y2 = dst_y + h;
int dst_x2 = dst_x + w;
- int ret;
+ dri_bo *aper_array[3];
BATCH_LOCALS;
/* do space/cliprects check before going any further */
intel_batchbuffer_require_space(intel->batch, 8 * 4, NO_LOOP_CLIPRECTS);
again:
- ret = dri_bufmgr_check_aperture_space(dst_buffer);
- ret |= dri_bufmgr_check_aperture_space(src_buffer);
- if (ret) {
- intel_batchbuffer_flush(intel->batch);
- goto again;
+ aper_array[0] = intel->batch->buf;
+ aper_array[1] = dst_buffer;
+ aper_array[2] = src_buffer;
+
+ if (dri_bufmgr_check_aperture_space(aper_array, 3) != 0) {
+ intel_batchbuffer_flush(intel->batch);
+ goto again;
}
DBG("%s src:buf(%p)/%d+%d %d,%d dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index f1116d27479..f9a373cf748 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -294,6 +294,7 @@ extern char *__progname;
#define SUBPIXEL_X 0.125
#define SUBPIXEL_Y 0.125
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#define ALIGN(value, alignment) ((value + alignment - 1) & ~(alignment - 1))
#define INTEL_FIREVERTICES(intel) \