diff options
author | Niels Ole Salscheider <[email protected]> | 2014-03-17 18:48:05 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-03-20 17:21:16 +0100 |
commit | acf55e73252e46fa51378ef4b23c94a89902ae1c (patch) | |
tree | a1f436e3c4d9a6a7fd0f16cbbf55f4b2988d08f2 /src/gallium/drivers/radeon | |
parent | f4b3430a36ea88707f59ce147a140a1a559378c5 (diff) |
radeon: Move r600_need_dma_space to common code
Signed-off-by: Niels Ole Salscheider <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 05ada1c4bb4..a5c140ab6aa 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -39,6 +39,16 @@ * pipe_context */ +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) { + ctx->rings.dma.flush(ctx, RADEON_FLUSH_ASYNC); + } +} + static void r600_memory_barrier(struct pipe_context *ctx, unsigned flags) { } diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 92883a05e6a..1815ff6003a 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -409,6 +409,7 @@ void r600_screen_clear_buffer(struct r600_common_screen *rscreen, struct pipe_re struct pipe_resource *r600_resource_create_common(struct pipe_screen *screen, const struct pipe_resource *templ); const char *r600_get_llvm_processor_name(enum radeon_family family); +void r600_need_dma_space(struct r600_common_context *ctx, unsigned num_dw); /* r600_query.c */ void r600_query_init(struct r600_common_context *rctx); |