r600_blitter_end(ctx);
}
-void r600_copy_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsigned dstx,
- struct pipe_resource *src, const struct pipe_box *src_box)
+static void r600_copy_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsigned dstx,
+ struct pipe_resource *src, const struct pipe_box *src_box)
{
struct r600_context *rctx = (struct r600_context*)ctx;
if (rtransfer->staging) {
struct pipe_resource *dst, *src;
unsigned soffset, doffset, size;
+ struct pipe_box box;
dst = transfer->resource;
src = &rtransfer->staging->b.b;
size = transfer->box.width;
doffset = transfer->box.x;
soffset = rtransfer->offset + transfer->box.x % R600_MAP_BUFFER_ALIGNMENT;
+
+ u_box_1d(soffset, size, &box);
+
/* Copy the staging buffer into the original one. */
- if (rctx->b.rings.dma.cs && !(size % 4) && !(doffset % 4) && !(soffset % 4)) {
- if (rctx->screen->b.chip_class >= EVERGREEN) {
- evergreen_dma_copy(rctx, dst, src, doffset, soffset, size);
- } else {
- r600_dma_copy(rctx, dst, src, doffset, soffset, size);
- }
+ if (!(size % 4) && !(doffset % 4) && !(soffset % 4) &&
+ rctx->b.dma_copy(pipe, dst, 0, doffset, 0, 0, src, 0, &box)) {
+ /* DONE. */
} else {
- struct pipe_box box;
-
- u_box_1d(soffset, size, &box);
- r600_copy_buffer(pipe, dst, doffset, src, &box);
+ pipe->resource_copy_region(pipe, dst, 0, doffset, 0, 0, src, 0, &box);
}
pipe_resource_reference((struct pipe_resource**)&rtransfer->staging, NULL);
}
void evergreen_update_db_shader_control(struct r600_context * rctx);
/* r600_blit.c */
-void r600_copy_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsigned dstx,
- struct pipe_resource *src, const struct pipe_box *src_box);
void r600_init_blit_functions(struct r600_context *rctx);
void r600_decompress_depth_textures(struct r600_context *rctx,
struct r600_samplerview_state *textures);