diff options
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index dafa139c0ca7..9441825c7860 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | |||
@@ -1529,6 +1529,39 @@ static int vmw_cmd_set_shader(struct vmw_private *dev_priv, | |||
1529 | } | 1529 | } |
1530 | 1530 | ||
1531 | /** | 1531 | /** |
1532 | * vmw_cmd_set_shader_const - Validate an SVGA_3D_CMD_SET_SHADER_CONST | ||
1533 | * command | ||
1534 | * | ||
1535 | * @dev_priv: Pointer to a device private struct. | ||
1536 | * @sw_context: The software context being used for this batch. | ||
1537 | * @header: Pointer to the command header in the command stream. | ||
1538 | */ | ||
1539 | static int vmw_cmd_set_shader_const(struct vmw_private *dev_priv, | ||
1540 | struct vmw_sw_context *sw_context, | ||
1541 | SVGA3dCmdHeader *header) | ||
1542 | { | ||
1543 | struct vmw_set_shader_const_cmd { | ||
1544 | SVGA3dCmdHeader header; | ||
1545 | SVGA3dCmdSetShaderConst body; | ||
1546 | } *cmd; | ||
1547 | int ret; | ||
1548 | |||
1549 | cmd = container_of(header, struct vmw_set_shader_const_cmd, | ||
1550 | header); | ||
1551 | |||
1552 | ret = vmw_cmd_res_check(dev_priv, sw_context, vmw_res_context, | ||
1553 | user_context_converter, &cmd->body.cid, | ||
1554 | NULL); | ||
1555 | if (unlikely(ret != 0)) | ||
1556 | return ret; | ||
1557 | |||
1558 | if (dev_priv->has_mob) | ||
1559 | header->id = SVGA_3D_CMD_SET_GB_SHADERCONSTS_INLINE; | ||
1560 | |||
1561 | return 0; | ||
1562 | } | ||
1563 | |||
1564 | /** | ||
1532 | * vmw_cmd_bind_gb_shader - Validate an SVGA_3D_CMD_BIND_GB_SHADER | 1565 | * vmw_cmd_bind_gb_shader - Validate an SVGA_3D_CMD_BIND_GB_SHADER |
1533 | * command | 1566 | * command |
1534 | * | 1567 | * |
@@ -1642,8 +1675,8 @@ static const struct vmw_cmd_entry const vmw_cmd_entries[SVGA_3D_CMD_MAX] = { | |||
1642 | true, true, false), | 1675 | true, true, false), |
1643 | VMW_CMD_DEF(SVGA_3D_CMD_SET_SHADER, &vmw_cmd_set_shader, | 1676 | VMW_CMD_DEF(SVGA_3D_CMD_SET_SHADER, &vmw_cmd_set_shader, |
1644 | true, false, false), | 1677 | true, false, false), |
1645 | VMW_CMD_DEF(SVGA_3D_CMD_SET_SHADER_CONST, &vmw_cmd_cid_check, | 1678 | VMW_CMD_DEF(SVGA_3D_CMD_SET_SHADER_CONST, &vmw_cmd_set_shader_const, |
1646 | true, true, false), | 1679 | true, false, false), |
1647 | VMW_CMD_DEF(SVGA_3D_CMD_DRAW_PRIMITIVES, &vmw_cmd_draw, | 1680 | VMW_CMD_DEF(SVGA_3D_CMD_DRAW_PRIMITIVES, &vmw_cmd_draw, |
1648 | true, false, false), | 1681 | true, false, false), |
1649 | VMW_CMD_DEF(SVGA_3D_CMD_SETSCISSORRECT, &vmw_cmd_cid_check, | 1682 | VMW_CMD_DEF(SVGA_3D_CMD_SETSCISSORRECT, &vmw_cmd_cid_check, |