diff options
author | Marek Olšák <[email protected]> | 2015-08-30 03:44:03 +0200 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-09-06 18:32:59 +0100 |
commit | 63b4e6bfc931d0da1a31389f7f44e297c988971d (patch) | |
tree | cdcbb22805646f0bc58b73dea035ea330b0d964e /src | |
parent | a5dee22767c4ea133b93dcbae16c0d08f161e8e1 (diff) |
radeonsi: fix memory usage checking for big IBs
Cc: 11.0 <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Acked-by: Christian König <[email protected]>
(cherry picked from commit 05af645a951fd985d0dbe3c22614e1dee8dfb3f0)
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_hw_context.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index 307dc391431..7accfddb7b0 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -33,14 +33,6 @@ void si_need_cs_space(struct si_context *ctx, unsigned num_dw, struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs; int i; - /* If the CS is sufficiently large, don't count the space needed - * and just flush if there is less than 8096 dwords left. */ - if (cs->max_dw >= 24 * 1024) { - if (cs->cdw > cs->max_dw - 8 * 1024) - ctx->b.rings.gfx.flush(ctx, RADEON_FLUSH_ASYNC, NULL); - return; - } - /* There are two memory usage counters in the winsys for all buffers * that have been added (cs_add_reloc) and two counters in the pipe * driver for those that haven't been added yet. @@ -54,6 +46,15 @@ void si_need_cs_space(struct si_context *ctx, unsigned num_dw, ctx->b.gtt = 0; ctx->b.vram = 0; + /* If the CS is sufficiently large, don't count the space needed + * and just flush if there is less than 8096 dwords left. + */ + if (cs->max_dw >= 24 * 1024) { + if (cs->cdw > cs->max_dw - 8 * 1024) + ctx->b.rings.gfx.flush(ctx, RADEON_FLUSH_ASYNC, NULL); + return; + } + /* The number of dwords we already used in the CS so far. */ num_dw += cs->cdw; |