diff options
author | Neha Bhende <nbhende@vmware.com> | 2015-08-10 13:51:07 -0400 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2015-08-12 13:06:42 -0400 |
commit | 0fca749e9a085ac4623a807ab12c37fc09851e3c (patch) | |
tree | 9f1eadfab0b7d1ac2bd3be354f33bf7d2d1e01ba | |
parent | 2f633e5e40798d5c8db512118b5e464b62f7ff06 (diff) |
drm/vmwgfx: Add command parser support for a couple of DX commands
Add support for SVGA_3D_CMD_DX_BUFFER_COPY and
SVGA_3D_CMD_DX_PRED_COPY_REGION
Signed-off-by: Neha Bhende <nbhende@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 2553baa7b4d8..2b7ac4918855 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | |||
@@ -909,6 +909,50 @@ static int vmw_cmd_surface_copy_check(struct vmw_private *dev_priv, | |||
909 | &cmd->body.dest.sid, NULL); | 909 | &cmd->body.dest.sid, NULL); |
910 | } | 910 | } |
911 | 911 | ||
912 | static int vmw_cmd_buffer_copy_check(struct vmw_private *dev_priv, | ||
913 | struct vmw_sw_context *sw_context, | ||
914 | SVGA3dCmdHeader *header) | ||
915 | { | ||
916 | struct { | ||
917 | SVGA3dCmdHeader header; | ||
918 | SVGA3dCmdDXBufferCopy body; | ||
919 | } *cmd; | ||
920 | int ret; | ||
921 | |||
922 | cmd = container_of(header, typeof(*cmd), header); | ||
923 | ret = vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface, | ||
924 | user_surface_converter, | ||
925 | &cmd->body.src, NULL); | ||
926 | if (ret != 0) | ||
927 | return ret; | ||
928 | |||
929 | return vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface, | ||
930 | user_surface_converter, | ||
931 | &cmd->body.dest, NULL); | ||
932 | } | ||
933 | |||
934 | static int vmw_cmd_pred_copy_check(struct vmw_private *dev_priv, | ||
935 | struct vmw_sw_context *sw_context, | ||
936 | SVGA3dCmdHeader *header) | ||
937 | { | ||
938 | struct { | ||
939 | SVGA3dCmdHeader header; | ||
940 | SVGA3dCmdDXPredCopyRegion body; | ||
941 | } *cmd; | ||
942 | int ret; | ||
943 | |||
944 | cmd = container_of(header, typeof(*cmd), header); | ||
945 | ret = vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface, | ||
946 | user_surface_converter, | ||
947 | &cmd->body.srcSid, NULL); | ||
948 | if (ret != 0) | ||
949 | return ret; | ||
950 | |||
951 | return vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface, | ||
952 | user_surface_converter, | ||
953 | &cmd->body.dstSid, NULL); | ||
954 | } | ||
955 | |||
912 | static int vmw_cmd_stretch_blt_check(struct vmw_private *dev_priv, | 956 | static int vmw_cmd_stretch_blt_check(struct vmw_private *dev_priv, |
913 | struct vmw_sw_context *sw_context, | 957 | struct vmw_sw_context *sw_context, |
914 | SVGA3dCmdHeader *header) | 958 | SVGA3dCmdHeader *header) |
@@ -3075,8 +3119,6 @@ static const struct vmw_cmd_entry vmw_cmd_entries[SVGA_3D_CMD_MAX] = { | |||
3075 | &vmw_cmd_dx_clear_rendertarget_view, true, false, true), | 3119 | &vmw_cmd_dx_clear_rendertarget_view, true, false, true), |
3076 | VMW_CMD_DEF(SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW, | 3120 | VMW_CMD_DEF(SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW, |
3077 | &vmw_cmd_dx_clear_depthstencil_view, true, false, true), | 3121 | &vmw_cmd_dx_clear_depthstencil_view, true, false, true), |
3078 | VMW_CMD_DEF(SVGA_3D_CMD_DX_PRED_COPY_REGION, &vmw_cmd_invalid, | ||
3079 | true, false, true), | ||
3080 | VMW_CMD_DEF(SVGA_3D_CMD_DX_PRED_COPY, &vmw_cmd_invalid, | 3122 | VMW_CMD_DEF(SVGA_3D_CMD_DX_PRED_COPY, &vmw_cmd_invalid, |
3081 | true, false, true), | 3123 | true, false, true), |
3082 | VMW_CMD_DEF(SVGA_3D_CMD_DX_GENMIPS, &vmw_cmd_invalid, | 3124 | VMW_CMD_DEF(SVGA_3D_CMD_DX_GENMIPS, &vmw_cmd_invalid, |
@@ -3137,6 +3179,10 @@ static const struct vmw_cmd_entry vmw_cmd_entries[SVGA_3D_CMD_MAX] = { | |||
3137 | &vmw_cmd_dx_cid_check, true, false, true), | 3179 | &vmw_cmd_dx_cid_check, true, false, true), |
3138 | VMW_CMD_DEF(SVGA_3D_CMD_DX_SET_TOPOLOGY, | 3180 | VMW_CMD_DEF(SVGA_3D_CMD_DX_SET_TOPOLOGY, |
3139 | &vmw_cmd_dx_cid_check, true, false, true), | 3181 | &vmw_cmd_dx_cid_check, true, false, true), |
3182 | VMW_CMD_DEF(SVGA_3D_CMD_DX_BUFFER_COPY, | ||
3183 | &vmw_cmd_buffer_copy_check, true, false, true), | ||
3184 | VMW_CMD_DEF(SVGA_3D_CMD_DX_PRED_COPY_REGION, | ||
3185 | &vmw_cmd_pred_copy_check, true, false, true), | ||
3140 | }; | 3186 | }; |
3141 | 3187 | ||
3142 | static int vmw_cmd_check(struct vmw_private *dev_priv, | 3188 | static int vmw_cmd_check(struct vmw_private *dev_priv, |