From fcb6beceefdf7f589033ee3160b28739a20ca4e9 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 15 Jun 2021 21:45:35 -0700 Subject: [PATCH] i915g: Improve debug output for the fresh-batch overflow case. Much more useful info for dEQP-GLES2.functional.buffer.write.random.0 than "i915_vbuf_render_draw_elements: Assertion `0' failed." Part-of: --- src/gallium/drivers/i915/i915_context.h | 1 + src/gallium/drivers/i915/i915_prim_vbuf.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h index d3ea29d1b41..44e7a9bc1d0 100644 --- a/src/gallium/drivers/i915/i915_context.h +++ b/src/gallium/drivers/i915/i915_context.h @@ -36,6 +36,7 @@ #include "tgsi/tgsi_scan.h" +#include "util/log.h" #include "util/slab.h" #include "util/u_blitter.h" #include "i915_reg.h" diff --git a/src/gallium/drivers/i915/i915_prim_vbuf.c b/src/gallium/drivers/i915/i915_prim_vbuf.c index 9dba054f786..6a4886d5065 100644 --- a/src/gallium/drivers/i915/i915_prim_vbuf.c +++ b/src/gallium/drivers/i915/i915_prim_vbuf.c @@ -467,6 +467,9 @@ draw_arrays_fallback(struct vbuf_render *render, unsigned start, uint32_t nr) i915->vbo_flushed = 1; if (!BEGIN_BATCH(1 + (nr_indices + 1) / 2)) { + mesa_loge("i915: Failed to allocate space for %d indices in fresh " + "batch with %d bytes left\n", + nr_indices, (int)i915_winsys_batchbuffer_space(i915->batch)); assert(0); goto out; } @@ -625,6 +628,9 @@ i915_vbuf_render_draw_elements(struct vbuf_render *render, i915->vbo_flushed = 1; if (!BEGIN_BATCH(1 + (nr_indices + 1) / 2)) { + mesa_loge("i915: Failed to allocate space for %d indices in fresh " + "batch with %d bytes left\n", + nr_indices, (int)i915_winsys_batchbuffer_space(i915->batch)); assert(0); goto out; }