summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/radeon_video.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2014-09-11 09:38:50 +0200
committerChristian König <[email protected]>2014-09-11 15:06:03 +0200
commit4dfdcdb4b394df72da769806a0b64025e475f8b3 (patch)
tree36e16fdcd39b47d58c408011ea65c8d7d7e3e29d /src/gallium/drivers/radeon/radeon_video.c
parent4bc0059229f212e91ca266ef3f80b652b1cdcb86 (diff)
radeon/video: use the hw to initial clear the buffers
Less CPU overhead and avoids contention over CPU accessible memory on startup. Signed-off-by: Christian König <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/radeon_video.c')
-rw-r--r--src/gallium/drivers/radeon/radeon_video.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeon/radeon_video.c b/src/gallium/drivers/radeon/radeon_video.c
index 0bc43907005..f6cfdff7aa2 100644
--- a/src/gallium/drivers/radeon/radeon_video.c
+++ b/src/gallium/drivers/radeon/radeon_video.c
@@ -118,14 +118,12 @@ error:
}
/* clear the buffer with zeros */
-void rvid_clear_buffer(struct radeon_winsys *ws, struct radeon_winsys_cs *cs, struct rvid_buffer* buffer)
+void rvid_clear_buffer(struct pipe_context *context, struct rvid_buffer* buffer)
{
- void *ptr = ws->buffer_map(buffer->res->cs_buf, cs, PIPE_TRANSFER_WRITE);
- if (!ptr)
- return;
+ struct r600_common_context *rctx = (struct r600_common_context*)context;
- memset(ptr, 0, buffer->res->buf->size);
- ws->buffer_unmap(buffer->res->cs_buf);
+ rctx->clear_buffer(context, &buffer->res->b.b, 0, buffer->res->buf->size, 0);
+ context->flush(context, NULL, 0);
}
/**