diff options
author | Michel Dänzer <[email protected]> | 2014-11-19 15:31:24 +0900 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2015-06-08 18:10:35 +0900 |
commit | 79f2acb8f89704c609dd87d969353a506e03b05e (patch) | |
tree | 010c71a22e5772161084452f916b52f221262553 /src/gallium/drivers/radeon | |
parent | 9538902c4f0e94e57228f939489d31676c43a778 (diff) |
r600g,radeonsi: Assert that there's enough space after flushing
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 42e681dc7d2..3def4446882 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -107,11 +107,10 @@ void r600_draw_rectangle(struct blitter_context *blitter, void r600_need_dma_space(struct r600_common_context *ctx, unsigned num_dw) { - /* The number of dwords we already used in the DMA so far. */ - num_dw += ctx->rings.dma.cs->cdw; /* Flush if there's not enough space. */ - if (num_dw > RADEON_MAX_CMDBUF_DWORDS) { + if ((num_dw + ctx->rings.dma.cs->cdw) > RADEON_MAX_CMDBUF_DWORDS) { ctx->rings.dma.flush(ctx, RADEON_FLUSH_ASYNC, NULL); + assert((num_dw + ctx->rings.dma.cs->cdw) <= RADEON_MAX_CMDBUF_DWORDS); } } |