Module: Mesa
Branch: master
Commit: 6b3627da08997701b837dfb166eb0fb35a6312ee
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6b3627da08997701b837dfb166eb0fb35a6312ee

Author: Neha Bhende <[email protected]>
Date:   Mon Mar  6 15:53:58 2017 -0800

svga: Add SVGA3dCmdIntraSurfaceCopy command support in OpenGL driver

v2: changes as per Charmaine's comment

Reviewed-by: Charmaine Lee <[email protected]>
Reviewed-by: Brian Paul <[email protected]>

---

 src/gallium/drivers/svga/svga_cmd.h           |  8 ++++++++
 src/gallium/drivers/svga/svga_cmd_vgpu10.c    | 24 ++++++++++++++++++++++++
 src/gallium/drivers/svga/svgadump/svga_dump.c | 17 +++++++++++++++++
 3 files changed, 49 insertions(+)

diff --git a/src/gallium/drivers/svga/svga_cmd.h 
b/src/gallium/drivers/svga/svga_cmd.h
index 51788849d6..b191ed5d30 100644
--- a/src/gallium/drivers/svga/svga_cmd.h
+++ b/src/gallium/drivers/svga/svga_cmd.h
@@ -682,4 +682,12 @@ SVGA3D_vgpu10_TransferFromBuffer(struct 
svga_winsys_context *swc,
                                  unsigned dstSubResource,
                                  SVGA3dBox *dstBox);
 
+/*Cap2 commands*/
+enum pipe_error
+SVGA3D_vgpu10_IntraSurfaceCopy(struct svga_winsys_context *swc,
+                        struct svga_winsys_surface *src,
+                        unsigned level, unsigned face,
+                        const SVGA3dCopyBox *box);
+
+
 #endif /* __SVGA3D_H__ */
diff --git a/src/gallium/drivers/svga/svga_cmd_vgpu10.c 
b/src/gallium/drivers/svga/svga_cmd_vgpu10.c
index bed1403ac1..e0e47e1c26 100644
--- a/src/gallium/drivers/svga/svga_cmd_vgpu10.c
+++ b/src/gallium/drivers/svga/svga_cmd_vgpu10.c
@@ -1372,3 +1372,27 @@ SVGA3D_vgpu10_TransferFromBuffer(struct 
svga_winsys_context *swc,
    swc->commit(swc);
    return PIPE_OK;
 }
+
+enum pipe_error
+SVGA3D_vgpu10_IntraSurfaceCopy(struct svga_winsys_context *swc,
+                        struct svga_winsys_surface *surface,
+                        unsigned level, unsigned face,
+                        const SVGA3dCopyBox *box)
+{
+   SVGA3dCmdIntraSurfaceCopy *cmd =
+      SVGA3D_FIFOReserve(swc,
+                         SVGA_3D_CMD_INTRA_SURFACE_COPY,
+                         sizeof(SVGA3dCmdIntraSurfaceCopy),
+                         1);  /* one relocation */
+   if (!cmd)
+      return PIPE_ERROR_OUT_OF_MEMORY;
+
+   swc->surface_relocation(swc, &cmd->surface.sid, NULL, surface, 
SVGA_RELOC_READ | SVGA_RELOC_WRITE);
+   cmd->surface.face = face;
+   cmd->surface.mipmap = level;
+   cmd->box = *box;
+
+   swc->commit(swc);
+
+   return PIPE_OK;
+}
diff --git a/src/gallium/drivers/svga/svgadump/svga_dump.c 
b/src/gallium/drivers/svga/svgadump/svga_dump.c
index c8e6856f17..e93bb58de7 100644
--- a/src/gallium/drivers/svga/svgadump/svga_dump.c
+++ b/src/gallium/drivers/svga/svgadump/svga_dump.c
@@ -2042,6 +2042,15 @@ SVGA3D_DUMP_HEADER(TransferFromBuffer)
 }
 
 static void
+dump_SVGA3dCmdIntraSurfaceCopy(const SVGA3dCmdIntraSurfaceCopy *cmd)
+{
+   SVGA3D_DUMP_PARAMETER(surface.sid, u);
+   SVGA3D_DUMP_PARAMETER(surface.face, u);
+   SVGA3D_DUMP_PARAMETER(surface.mipmap, u);
+   dump_SVGA3dCopyBox(&cmd->box);
+}
+
+static void
 dump_SVGA3dCmdInvalidateGBSurface(const SVGA3dCmdInvalidateGBSurface *cmd)
 {
    SVGA3D_DUMP_PARAMETER(sid, u);
@@ -2559,6 +2568,14 @@ svga_dump_command(uint32_t cmd_id, const void *data, 
uint32_t size)
          body = (const uint8_t *)&cmd[1];
       }
       break;
+   case SVGA_3D_CMD_INTRA_SURFACE_COPY:
+      _debug_printf("\tSVGA_3D_CMD_INTRA_SURFACE_COPY\n");
+      {
+         const SVGA3dCmdIntraSurfaceCopy *cmd = (const 
SVGA3dCmdIntraSurfaceCopy *)body;
+         dump_SVGA3dCmdIntraSurfaceCopy(cmd);
+         body = (const uint8_t *)&cmd[1];
+      }
+      break;
    default:
       _debug_printf("\t0x%08x\n", cmd_id);
       break;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to