summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_blit.c
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2013-04-24 12:26:52 -0400
committerAlex Deucher <[email protected]>2013-04-24 18:54:31 -0400
commit5bbeae7a3d3be17d44b1bc851872a107a75c393b (patch)
tree1f9910aa85a122f562b1e9ee0fb6a5c501910199 /src/gallium/drivers/r600/r600_blit.c
parent9d0ad4c2f2eb89bab82194478180df570cc7aa4e (diff)
r600g: use CP DMA for buffer clears on evergreen+
Lighter weight then using streamout. Only evergreen and newer asics support embedded data as src with CP DMA. Reviewed-by: Jerome Glisse <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_blit.c')
-rw-r--r--src/gallium/drivers/r600/r600_blit.c10
1 files changed, 8 insertions, 2 deletions
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);