From 3233d0539021e3aa3bbf5bba66bc6d01aa6a599c Mon Sep 17 00:00:00 2001 From: Charmaine Lee Date: Tue, 24 Oct 2017 10:57:42 -0700 Subject: [PATCH] svga: use helper function to do copy region Use the common helper function svga_texture_copy_region for copy region command. Reviewed-by: Brian Paul --- src/gallium/drivers/svga/svga_pipe_blit.c | 26 +++++------------------ 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c index bb213ac92e8..a3579ba98c2 100644 --- a/src/gallium/drivers/svga/svga_pipe_blit.c +++ b/src/gallium/drivers/svga/svga_pipe_blit.c @@ -125,36 +125,20 @@ copy_region_vgpu10(struct svga_context *svga, struct pipe_resource *src_tex, enum pipe_error ret; uint32 srcSubResource, dstSubResource; struct svga_texture *dtex, *stex; - SVGA3dCopyBox box; stex = svga_texture(src_tex); dtex = svga_texture(dst_tex); svga_surfaces_flush(svga); - box.x = dst_x; - box.y = dst_y; - box.z = dst_z; - box.w = width; - box.h = height; - box.d = depth; - box.srcx = src_x; - box.srcy = src_y; - box.srcz = src_z; - srcSubResource = src_layer_face * (src_tex->last_level + 1) + src_level; dstSubResource = dst_layer_face * (dst_tex->last_level + 1) + dst_level; - ret = SVGA3D_vgpu10_PredCopyRegion(svga->swc, - dtex->handle, dstSubResource, - stex->handle, srcSubResource, &box); - if (ret != PIPE_OK) { - svga_context_flush(svga, NULL); - ret = SVGA3D_vgpu10_PredCopyRegion(svga->swc, - dtex->handle, dstSubResource, - stex->handle, srcSubResource, &box); - assert(ret == PIPE_OK); - } + svga_texture_copy_region(svga, stex->handle, srcSubResource, + src_x, src_y, src_z, + dtex->handle, dstSubResource, + dst_x, dst_y, dst_z, + width, height, depth); /* Mark the texture subresource as defined. */ svga_define_texture_level(dtex, dst_layer_face, dst_level); -- 2.30.2