Skip to content

Commit

Permalink
Merge branch 'vmwgfx-fixes-3.17' of git://people.freedesktop.org/~tho…
Browse files Browse the repository at this point in the history
…mash/linux into drm-fixes

Two vmwgfx fixes, marked for stable as well

* 'vmwgfx-fixes-3.17' of git://people.freedesktop.org/~thomash/linux:
  drm/vmwgfx: Fix a potential infinite spin waiting for fifo idle
  drm/vmwgfx: Fix an incorrect OOM return value
  • Loading branch information
Dave Airlie committed Sep 3, 2014
2 parents 46712cc + f01ea0c commit 0977f90
Showing 2 changed files with 7 additions and 7 deletions.
11 changes: 5 additions & 6 deletions drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
Original file line number Diff line number Diff line change
@@ -450,11 +450,11 @@ static int vmw_cmd_res_reloc_add(struct vmw_private *dev_priv,
res,
id_loc - sw_context->buf_start);
if (unlikely(ret != 0))
goto out_err;
return ret;

ret = vmw_resource_val_add(sw_context, res, &node);
if (unlikely(ret != 0))
goto out_err;
return ret;

if (res_type == vmw_res_context && dev_priv->has_mob &&
node->first_usage) {
@@ -468,22 +468,21 @@ static int vmw_cmd_res_reloc_add(struct vmw_private *dev_priv,

ret = vmw_resource_context_res_add(dev_priv, sw_context, res);
if (unlikely(ret != 0))
goto out_err;
return ret;
node->staged_bindings =
kzalloc(sizeof(*node->staged_bindings), GFP_KERNEL);
if (node->staged_bindings == NULL) {
DRM_ERROR("Failed to allocate context binding "
"information.\n");
goto out_err;
return -ENOMEM;
}
INIT_LIST_HEAD(&node->staged_bindings->list);
}

if (p_val)
*p_val = node;

out_err:
return ret;
return 0;
}


3 changes: 2 additions & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
Original file line number Diff line number Diff line change
@@ -180,8 +180,9 @@ void vmw_fifo_release(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)

mutex_lock(&dev_priv->hw_mutex);

vmw_write(dev_priv, SVGA_REG_SYNC, SVGA_SYNC_GENERIC);
while (vmw_read(dev_priv, SVGA_REG_BUSY) != 0)
vmw_write(dev_priv, SVGA_REG_SYNC, SVGA_SYNC_GENERIC);
;

dev_priv->last_read_seqno = ioread32(fifo_mem + SVGA_FIFO_FENCE);

0 comments on commit 0977f90

Please sign in to comment.