From: Brian Paul Date: Thu, 23 Jun 2016 02:38:06 +0000 (-0600) Subject: svga: add SVGA3D_vgpu10_BufferCopy() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29a38f37ee5f090a6964caff42825259b8f39bbc;p=mesa.git svga: add SVGA3D_vgpu10_BufferCopy() Acked-by: Roland Scheidegger Reviewed-by: Charmaine Lee --- diff --git a/src/gallium/drivers/svga/svga_cmd.h b/src/gallium/drivers/svga/svga_cmd.h index 26e4690e649..06e1b4a3253 100644 --- a/src/gallium/drivers/svga/svga_cmd.h +++ b/src/gallium/drivers/svga/svga_cmd.h @@ -642,4 +642,10 @@ enum pipe_error SVGA3D_vgpu10_GenMips(struct svga_winsys_context *swc, const SVGA3dShaderResourceViewId shaderResourceViewId, struct svga_winsys_surface *view); + +enum pipe_error +SVGA3D_vgpu10_BufferCopy(struct svga_winsys_context *swc, + struct svga_winsys_surface *src, + struct svga_winsys_surface *dst, + unsigned srcx, unsigned dstx, unsigned width); #endif /* __SVGA3D_H__ */ diff --git a/src/gallium/drivers/svga/svga_cmd_vgpu10.c b/src/gallium/drivers/svga/svga_cmd_vgpu10.c index 2729655ef47..1f13193d233 100644 --- a/src/gallium/drivers/svga/svga_cmd_vgpu10.c +++ b/src/gallium/drivers/svga/svga_cmd_vgpu10.c @@ -1314,3 +1314,27 @@ SVGA3D_vgpu10_GenMips(struct svga_winsys_context *swc, swc->commit(swc); return PIPE_OK; } + + +enum pipe_error +SVGA3D_vgpu10_BufferCopy(struct svga_winsys_context *swc, + struct svga_winsys_surface *src, + struct svga_winsys_surface *dst, + unsigned srcx, unsigned dstx, unsigned width) +{ + SVGA3dCmdDXBufferCopy *cmd; + + cmd = SVGA3D_FIFOReserve(swc, SVGA_3D_CMD_DX_BUFFER_COPY, sizeof *cmd, 2); + + if (!cmd) + return PIPE_ERROR_OUT_OF_MEMORY; + + swc->surface_relocation(swc, &cmd->dest, NULL, dst, SVGA_RELOC_WRITE); + swc->surface_relocation(swc, &cmd->src, NULL, src, SVGA_RELOC_READ); + cmd->destX = dstx; + cmd->srcX = srcx; + cmd->width = width; + + swc->commit(swc); + return PIPE_OK; +}