summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_3d.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_3d.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_3d.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/ilo/ilo_3d.c b/src/gallium/drivers/ilo/ilo_3d.c
index 47b05caf2cf..484823ee820 100644
--- a/src/gallium/drivers/ilo/ilo_3d.c
+++ b/src/gallium/drivers/ilo/ilo_3d.c
@@ -239,6 +239,11 @@ ilo_3d_begin_query(struct ilo_context *ilo, struct ilo_query *q)
if (ilo_query_alloc_bo(q, 2, -1, hw3d->cp->winsys)) {
/* XXX we should check the aperture size */
+ if (q->reg_cmd_size > ilo_cp_space(hw3d->cp)) {
+ ilo_cp_flush(hw3d->cp, "out of space");
+ assert(q->reg_cmd_size <= ilo_cp_space(hw3d->cp));
+ }
+
ilo_3d_pipeline_emit_write_depth_count(hw3d->pipeline,
q->bo, q->reg_read++);
@@ -259,6 +264,11 @@ ilo_3d_begin_query(struct ilo_context *ilo, struct ilo_query *q)
if (ilo_query_alloc_bo(q, 2, -1, hw3d->cp->winsys)) {
/* XXX we should check the aperture size */
+ if (q->reg_cmd_size > ilo_cp_space(hw3d->cp)) {
+ ilo_cp_flush(hw3d->cp, "out of space");
+ assert(q->reg_cmd_size <= ilo_cp_space(hw3d->cp));
+ }
+
ilo_3d_pipeline_emit_write_timestamp(hw3d->pipeline,
q->bo, q->reg_read++);
@@ -285,6 +295,11 @@ ilo_3d_begin_query(struct ilo_context *ilo, struct ilo_query *q)
if (ilo_query_alloc_bo(q, 11 * 2, -1, hw3d->cp->winsys)) {
/* XXX we should check the aperture size */
+ if (q->reg_cmd_size > ilo_cp_space(hw3d->cp)) {
+ ilo_cp_flush(hw3d->cp, "out of space");
+ assert(q->reg_cmd_size <= ilo_cp_space(hw3d->cp));
+ }
+
ilo_3d_pipeline_emit_write_statistics(hw3d->pipeline,
q->bo, q->reg_read);
q->reg_read += 11;