Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
ctx->gtt = 0;
ctx->vram = 0;
- /* If the IB is sufficiently large, don't count the space needed
- * and just flush if there is not enough space left.
- *
- * Also reserve space for stopping queries at the end of IB, because
- * the number of active queries is mostly unlimited.
- */
- unsigned need_dwords = 2048 + ctx->num_cs_dw_queries_suspend;
+ unsigned need_dwords = si_get_minimum_num_gfx_cs_dwords(ctx);
if (!ctx->ws->cs_check_space(cs, need_dwords))
si_flush_gfx_cs(ctx, RADEON_FLUSH_ASYNC_START_NEXT_GFX_IB_NOW, NULL);
}
return tex->surface.u.legacy.tiling_index[level];
}
+static inline unsigned
+si_get_minimum_num_gfx_cs_dwords(struct si_context *sctx)
+{
+ /* Don't count the needed CS space exactly and just use an upper bound.
+ *
+ * Also reserve space for stopping queries at the end of IB, because
+ * the number of active queries is unlimited in theory.
+ */
+ return 2048 + sctx->num_cs_dw_queries_suspend;
+}
+
static inline void
si_context_add_resource_size(struct si_context *sctx, struct pipe_resource *r)
{