diff options
author | Marek Olšák <marek.olsak@amd.com> | 2016-04-30 01:21:22 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2016-05-10 17:20:09 +0200 |
commit | 60946c0d60610b03bc297df17ec7a3cca1e5f6e8 (patch) | |
tree | 531093de54a63ab4ae98b5ac1495df343beb80c7 /src/gallium/drivers/radeon/r600_pipe_common.c | |
parent | bb74152597de44ee877b8928587b1cece8b49656 (diff) | |
download | external_mesa3d-60946c0d60610b03bc297df17ec7a3cca1e5f6e8.zip external_mesa3d-60946c0d60610b03bc297df17ec7a3cca1e5f6e8.tar.gz external_mesa3d-60946c0d60610b03bc297df17ec7a3cca1e5f6e8.tar.bz2 |
gallium/radeon: add a heuristic for better (S)DMA performance
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_pipe_common.c')
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index ce8d769..bc7f5f5 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -176,6 +176,20 @@ void r600_dma_emit_wait_idle(struct r600_common_context *rctx) /* done at the end of DMA calls, so increment this. */ rctx->num_dma_calls++; + /* IBs using too little memory are limited by the IB submission overhead. + * IBs using too much memory are limited by the kernel/TTM overhead. + * Too long IBs create CPU-GPU pipeline bubbles and add latency. + * + * This heuristic makes sure that DMA requests are executed + * very soon after the call is made and lowers memory usage. + * It improves texture upload performance by keeping the DMA + * engine busy while uploads are being submitted. + */ + if (rctx->ws->cs_query_memory_usage(rctx->dma.cs) > 64 * 1024 * 1024) { + rctx->dma.flush(rctx, RADEON_FLUSH_ASYNC, NULL); + return; + } + r600_need_dma_space(rctx, 1, NULL, NULL); if (cs->cdw == 0) /* empty queue */ |