[Mesa-dev] [PATCH 4/6] svga: add new SVGA3D_vgpu10_BufferCopy() command

Brian Paul brianp at vmware.com
Tue Jun 21 22:16:21 UTC 2016


From: Neha Bhende <bhenden at vmware.com>

Reviewed-by: Brian Paul <brianp at vmware.com>
---
 src/gallium/drivers/svga/svga_cmd.h        |  6 ++++++
 src/gallium/drivers/svga/svga_cmd_vgpu10.c | 24 ++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/src/gallium/drivers/svga/svga_cmd.h b/src/gallium/drivers/svga/svga_cmd.h
index 26e4690..06e1b4a 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 2729655..1f13193 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;
+}
-- 
1.9.1



More information about the mesa-dev mailing list