From 5bbeae7a3d3be17d44b1bc851872a107a75c393b Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 24 Apr 2013 12:26:52 -0400 Subject: r600g: use CP DMA for buffer clears on evergreen+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lighter weight then using streamout. Only evergreen and newer asics support embedded data as src with CP DMA. Reviewed-by: Jerome Glisse Reviewed-by: Marek Olšák Signed-off-by: Alex Deucher --- src/gallium/drivers/r600/r600_blit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/r600/r600_blit.c') diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c index a0384bf366a..afe43896568 100644 --- a/src/gallium/drivers/r600/r600_blit.c +++ b/src/gallium/drivers/r600/r600_blit.c @@ -526,10 +526,16 @@ static void r600_clear_buffer(struct pipe_context *ctx, struct pipe_resource *ds unsigned offset, unsigned size, unsigned char value) { struct r600_context *rctx = (struct r600_context*)ctx; + uint32_t v = value; - if (rctx->screen->has_streamout && offset % 4 == 0 && size % 4 == 0) { + if (rctx->screen->has_cp_dma && + rctx->chip_class >= EVERGREEN && + offset % 4 == 0 && size % 4 == 0) { + uint32_t clear_value = v | (v << 8) | (v << 16) | (v << 24); + + evergreen_cp_dma_clear_buffer(rctx, dst, offset, size, clear_value); + } else if (rctx->screen->has_streamout && offset % 4 == 0 && size % 4 == 0) { union pipe_color_union clear_value; - uint32_t v = value; clear_value.ui[0] = v | (v << 8) | (v << 16) | (v << 24); -- cgit v1.2.3