}
if (max_len > ilo_cp_space(hw3d->cp)) {
- ilo_cp_flush(hw3d->cp);
+ ilo_cp_flush(hw3d->cp, "out of space");
need_flush = false;
assert(max_len <= ilo_cp_space(hw3d->cp));
}
/* don't know why */
if (ilo->dev->gen >= ILO_GEN(7))
- ilo_cp_flush(hw3d->cp);
+ ilo_cp_flush(hw3d->cp, "texture barrier");
}
static void
}
else {
/* flush and try again */
- ilo_cp_flush(p->cp);
+ ilo_cp_flush(p->cp, "out of aperture");
}
}
}
if (intel_winsys_check_aperture_space(ilo->winsys, aper_check, count))
- ilo_cp_flush(ilo->cp);
+ ilo_cp_flush(ilo->cp, "out of aperture");
/* set BCS_SWCTRL */
swctrl = 0x0;
* batch buffer.
*/
if (ilo_cp_space(ilo->cp) < (4 + 3) * 2 + max_cmd_size)
- ilo_cp_flush(ilo->cp);
+ ilo_cp_flush(ilo->cp, "out of space");
ilo_cp_assert_no_implicit_flush(ilo->cp, true);
ILO_DEBUG_FS = 1 << 3,
ILO_DEBUG_CS = 1 << 4,
ILO_DEBUG_DRAW = ILO_DEBUG_HOT << 5,
+ ILO_DEBUG_FLUSH = 1 << 6,
/* flags that affect the behaviors of the driver */
ILO_DEBUG_NOHW = 1 << 20,
*f = (struct pipe_fence_handle *) fence;
}
- ilo_cp_flush(ilo->cp);
+ ilo_cp_flush(ilo->cp,
+ (flags & PIPE_FLUSH_END_OF_FRAME) ? "frame end" : "user request");
}
static void
* is empty, the callback is not invoked.
*/
void
-ilo_cp_flush(struct ilo_cp *cp)
+ilo_cp_flush_internal(struct ilo_cp *cp)
{
int err;
ilo_cp_destroy(struct ilo_cp *cp);
void
-ilo_cp_flush(struct ilo_cp *cp);
+ilo_cp_flush_internal(struct ilo_cp *cp);
+
+static inline void
+ilo_cp_flush(struct ilo_cp *cp, const char *reason)
+{
+ if (ilo_debug & ILO_DEBUG_FLUSH) {
+ ilo_printf("cp flushed for %s with %d+%d DWords (%.1f%%) because of %s\n",
+ (cp->ring == ILO_CP_RING_RENDER) ? "render" : "blt",
+ cp->used, cp->stolen,
+ (float) (100 * (cp->used + cp->stolen)) / cp->bo_size,
+ reason);
+ }
+
+ ilo_cp_flush_internal(cp);
+}
void
ilo_cp_dump(struct ilo_cp *cp);
cp->used = 0;
}
- ilo_cp_flush(cp);
+ ilo_cp_flush(cp, "out of space (implicit)");
}
/**
if (q->bo) {
if (intel_bo_references(ilo->cp->bo, q->bo))
- ilo_cp_flush(ilo->cp);
+ ilo_cp_flush(ilo->cp, "syncing for queries");
if (!wait && intel_bo_is_busy(q->bo))
return false;
{ "fs", ILO_DEBUG_FS, "Dump fragment shaders" },
{ "cs", ILO_DEBUG_CS, "Dump compute shaders" },
{ "draw", ILO_DEBUG_DRAW, "Show draw information" },
+ { "flush", ILO_DEBUG_FLUSH, "Show batch buffer flushes" },
{ "nohw", ILO_DEBUG_NOHW, "Do not send commands to HW" },
{ "nocache", ILO_DEBUG_NOCACHE, "Always invalidate HW caches" },
DEBUG_NAMED_VALUE_END
/* flush to make bo busy (so that map() stalls as it should be) */
if (need_flush)
- ilo_cp_flush(ilo->cp);
+ ilo_cp_flush(ilo->cp, "syncing for transfers");
}
}
/* flush to make bo busy (so that pwrite() stalls as it should be) */
if (will_stall && need_flush)
- ilo_cp_flush(ilo->cp);
+ ilo_cp_flush(ilo->cp, "syncing for pwrites");
}
intel_bo_pwrite(buf->bo, offset, size, data);