mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
ilo: add ILO_DEBUG=flush
When specified, ilo will print a line similar to cp flushed for render with 949+888 DWords (22.4%) because of frame end for every ilo_cp_flush() call.
This commit is contained in:
parent
216a576e11
commit
ce87c51e9a
10 changed files with 29 additions and 12 deletions
|
|
@ -402,7 +402,7 @@ draw_vbo(struct ilo_3d *hw3d, const struct ilo_context *ilo,
|
|||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
|
@ -782,7 +782,7 @@ ilo_texture_barrier(struct pipe_context *pipe)
|
|||
|
||||
/* 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
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ ilo_3d_pipeline_emit_draw(struct ilo_3d_pipeline *p,
|
|||
}
|
||||
else {
|
||||
/* flush and try again */
|
||||
ilo_cp_flush(p->cp);
|
||||
ilo_cp_flush(p->cp, "out of aperture");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ ilo_blitter_blt_begin(struct ilo_blitter *blitter, int max_cmd_size,
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
@ -371,7 +371,7 @@ ilo_blitter_blt_begin(struct ilo_blitter *blitter, int max_cmd_size,
|
|||
* 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);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ enum ilo_debug {
|
|||
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,
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@ ilo_flush(struct pipe_context *pipe,
|
|||
*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
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ ilo_cp_exec_bo(struct ilo_cp *cp)
|
|||
* 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;
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,21 @@ void
|
|||
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);
|
||||
|
|
@ -132,7 +146,7 @@ ilo_cp_implicit_flush(struct ilo_cp *cp)
|
|||
cp->used = 0;
|
||||
}
|
||||
|
||||
ilo_cp_flush(cp);
|
||||
ilo_cp_flush(cp, "out of space (implicit)");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ ilo_get_query_result(struct pipe_context *pipe, struct pipe_query *query,
|
|||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ static const struct debug_named_value ilo_debug_flags[] = {
|
|||
{ "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
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ choose_transfer_method(struct ilo_context *ilo, struct ilo_transfer *xfer)
|
|||
|
||||
/* 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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -938,7 +938,7 @@ buf_pwrite(struct ilo_context *ilo, struct ilo_buffer *buf,
|
|||
|
||||
/* 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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue