diff options
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index c8eef5f12154..af4f6bdb7461 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | |||
| @@ -1461,6 +1461,38 @@ static int vmw_cmd_bind_gb_shader(struct vmw_private *dev_priv, | |||
| 1461 | cmd->body.offsetInBytes); | 1461 | cmd->body.offsetInBytes); |
| 1462 | } | 1462 | } |
| 1463 | 1463 | ||
| 1464 | /** | ||
| 1465 | * vmw_cmd_bind_gb_shader_consts - Validate an SVGA_3D_CMD_BIND_SHADER_CONSTS | ||
| 1466 | * command | ||
| 1467 | * | ||
| 1468 | * @dev_priv: Pointer to a device private struct. | ||
| 1469 | * @sw_context: The software context being used for this batch. | ||
| 1470 | * @header: Pointer to the command header in the command stream. | ||
| 1471 | */ | ||
| 1472 | static int vmw_cmd_bind_gb_shader_consts(struct vmw_private *dev_priv, | ||
| 1473 | struct vmw_sw_context *sw_context, | ||
| 1474 | SVGA3dCmdHeader *header) | ||
| 1475 | { | ||
| 1476 | struct vmw_bind_gb_sc_cmd { | ||
| 1477 | SVGA3dCmdHeader header; | ||
| 1478 | SVGA3dCmdBindGBShaderConsts body; | ||
| 1479 | } *cmd; | ||
| 1480 | int ret; | ||
| 1481 | |||
| 1482 | cmd = container_of(header, struct vmw_bind_gb_sc_cmd, | ||
| 1483 | header); | ||
| 1484 | |||
| 1485 | ret = vmw_cmd_res_check(dev_priv, sw_context, vmw_res_context, | ||
| 1486 | user_context_converter, | ||
| 1487 | &cmd->body.cid, NULL); | ||
| 1488 | if (unlikely(ret != 0)) | ||
| 1489 | return ret; | ||
| 1490 | |||
| 1491 | return vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface, | ||
| 1492 | user_surface_converter, | ||
| 1493 | &cmd->body.sid, NULL); | ||
| 1494 | } | ||
| 1495 | |||
| 1464 | static int vmw_cmd_check_not_3d(struct vmw_private *dev_priv, | 1496 | static int vmw_cmd_check_not_3d(struct vmw_private *dev_priv, |
| 1465 | struct vmw_sw_context *sw_context, | 1497 | struct vmw_sw_context *sw_context, |
| 1466 | void *buf, uint32_t *size) | 1498 | void *buf, uint32_t *size) |
| @@ -1571,9 +1603,12 @@ static vmw_cmd_func vmw_cmd_funcs[SVGA_3D_CMD_MAX] = { | |||
| 1571 | VMW_CMD_DEF(SVGA_3D_CMD_DEFINE_GB_SHADER, &vmw_cmd_invalid), | 1603 | VMW_CMD_DEF(SVGA_3D_CMD_DEFINE_GB_SHADER, &vmw_cmd_invalid), |
| 1572 | VMW_CMD_DEF(SVGA_3D_CMD_BIND_GB_SHADER, &vmw_cmd_bind_gb_shader), | 1604 | VMW_CMD_DEF(SVGA_3D_CMD_BIND_GB_SHADER, &vmw_cmd_bind_gb_shader), |
| 1573 | VMW_CMD_DEF(SVGA_3D_CMD_DESTROY_GB_SHADER, &vmw_cmd_invalid), | 1605 | VMW_CMD_DEF(SVGA_3D_CMD_DESTROY_GB_SHADER, &vmw_cmd_invalid), |
| 1606 | VMW_CMD_DEF(SVGA_3D_CMD_BIND_SHADERCONSTS, | ||
| 1607 | &vmw_cmd_bind_gb_shader_consts), | ||
| 1574 | VMW_CMD_DEF(SVGA_3D_CMD_BEGIN_GB_QUERY, &vmw_cmd_begin_gb_query), | 1608 | VMW_CMD_DEF(SVGA_3D_CMD_BEGIN_GB_QUERY, &vmw_cmd_begin_gb_query), |
| 1575 | VMW_CMD_DEF(SVGA_3D_CMD_END_GB_QUERY, &vmw_cmd_end_gb_query), | 1609 | VMW_CMD_DEF(SVGA_3D_CMD_END_GB_QUERY, &vmw_cmd_end_gb_query), |
| 1576 | VMW_CMD_DEF(SVGA_3D_CMD_WAIT_FOR_GB_QUERY, &vmw_cmd_wait_gb_query), | 1610 | VMW_CMD_DEF(SVGA_3D_CMD_WAIT_FOR_GB_QUERY, &vmw_cmd_wait_gb_query), |
| 1611 | VMW_CMD_DEF(SVGA_3D_CMD_SET_GB_SHADERCONSTS_INLINE, &vmw_cmd_cid_check) | ||
| 1577 | }; | 1612 | }; |
| 1578 | 1613 | ||
| 1579 | static int vmw_cmd_check(struct vmw_private *dev_priv, | 1614 | static int vmw_cmd_check(struct vmw_private *dev_priv, |
