Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269716
b: refs/heads/master
c: 0cff60c
h: refs/heads/master
v: v3
  • Loading branch information
Jakob Bornecrantz authored and Dave Airlie committed Oct 5, 2011
1 parent e3e941d commit 75f4048
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2fcd5a73bfd5341876f9ea6b5adcc1dd814226d4
refs/heads/master: 0cff60c625131c64847debc2b4cee33ba33e8d8f
16 changes: 13 additions & 3 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ static int vmw_cmd_blt_surf_screen_check(struct vmw_private *dev_priv,
} *cmd;

cmd = container_of(header, struct vmw_sid_cmd, header);

if (unlikely(!sw_context->kernel)) {
DRM_ERROR("Kernel only SVGA3d command: %u.\n", cmd->header.id);
return -EPERM;
}

return vmw_cmd_sid_check(dev_priv, sw_context, &cmd->body.srcImage.sid);
}

Expand All @@ -210,6 +216,12 @@ static int vmw_cmd_present_check(struct vmw_private *dev_priv,
} *cmd;

cmd = container_of(header, struct vmw_sid_cmd, header);

if (unlikely(!sw_context->kernel)) {
DRM_ERROR("Kernel only SVGA3d command: %u.\n", cmd->header.id);
return -EPERM;
}

return vmw_cmd_sid_check(dev_priv, sw_context, &cmd->body.sid);
}

Expand Down Expand Up @@ -478,14 +490,12 @@ static int vmw_cmd_check_not_3d(struct vmw_private *dev_priv,
void *buf, uint32_t *size)
{
uint32_t size_remaining = *size;
bool need_kernel = true;
uint32_t cmd_id;

cmd_id = le32_to_cpu(((uint32_t *)buf)[0]);
switch (cmd_id) {
case SVGA_CMD_UPDATE:
*size = sizeof(uint32_t) + sizeof(SVGAFifoCmdUpdate);
need_kernel = false;
break;
case SVGA_CMD_DEFINE_GMRFB:
*size = sizeof(uint32_t) + sizeof(SVGAFifoCmdDefineGMRFB);
Expand All @@ -507,7 +517,7 @@ static int vmw_cmd_check_not_3d(struct vmw_private *dev_priv,
return -EINVAL;
}

if (unlikely(need_kernel && !sw_context->kernel)) {
if (unlikely(!sw_context->kernel)) {
DRM_ERROR("Kernel only SVGA command: %u.\n", cmd_id);
return -EPERM;
}
Expand Down

0 comments on commit 75f4048

Please sign in to comment.