summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-06-22 20:38:06 -0600
committerBrian Paul <[email protected]>2016-06-30 14:32:10 -0600
commit29a38f37ee5f090a6964caff42825259b8f39bbc (patch)
tree3faaba0a7732ff2f346bcf69e0fa5f95ecc90961 /src/gallium/drivers
parent88a344253c2091f7935b3dfc7fe3be99b76033a3 (diff)
svga: add SVGA3D_vgpu10_BufferCopy()
Acked-by: Roland Scheidegger <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/svga/svga_cmd.h6
-rw-r--r--src/gallium/drivers/svga/svga_cmd_vgpu10.c24
2 files changed, 30 insertions, 0 deletions
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;
+}