From: Brian Paul Date: Thu, 23 Jun 2016 17:57:08 +0000 (-0600) Subject: svga: use copy_region_vgpu10() for region copies when possible X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=92b44efef464c04cb4191356936046b49ff13bd9;p=mesa.git svga: use copy_region_vgpu10() for region copies when possible v2: remove extra svga_define_texture_level() call, per Charmaine. Acked-by: Roland Scheidegger Reviewed-by: Charmaine Lee --- diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c index 564af51fca7..438151fed70 100644 --- a/src/gallium/drivers/svga/svga_pipe_blit.c +++ b/src/gallium/drivers/svga/svga_pipe_blit.c @@ -138,7 +138,6 @@ svga_resource_copy_region(struct pipe_context *pipe, src_z = src_box->z; } - /* different src/dst type???*/ if (dst_tex->target == PIPE_TEXTURE_CUBE || dst_tex->target == PIPE_TEXTURE_1D_ARRAY) { dst_face_layer = dstz; @@ -150,14 +149,48 @@ svga_resource_copy_region(struct pipe_context *pipe, dst_z = dstz; } - svga_texture_copy_handle(svga, - stex->handle, + stex = svga_texture(src_tex); + dtex = svga_texture(dst_tex); + + if (svga_have_vgpu10(svga)) { + /* vgpu10 */ + if (util_format_is_compressed(src_tex->format) == + util_format_is_compressed(dst_tex->format) && + !util_format_is_depth_and_stencil(src_tex->format) && + stex->handle != dtex->handle && + src_tex->target == dst_tex->target) { + copy_region_vgpu10(svga, + src_tex, src_box->x, src_box->y, src_z, src_level, src_face_layer, - dtex->handle, + dst_tex, dstx, dsty, dst_z, dst_level, dst_face_layer, src_box->width, src_box->height, src_box->depth); + } + else { + util_resource_copy_region(pipe, dst_tex, dst_level, dstx, dsty, dstz, + src_tex, src_level, src_box); + } + } + else { + /* vgpu9 */ + if (src_tex->format == dst_tex->format) { + svga_texture_copy_handle(svga, + stex->handle, + src_box->x, src_box->y, src_z, + src_level, src_face_layer, + dtex->handle, + dstx, dsty, dst_z, + dst_level, dst_face_layer, + src_box->width, src_box->height, + src_box->depth); + } + else { + util_resource_copy_region(pipe, dst_tex, dst_level, dstx, dsty, dstz, + src_tex, src_level, src_box); + } + } /* Mark the destination image as being defined */ svga_define_texture_level(dtex, dst_face_layer, dst_level);