Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329279
b: refs/heads/master
c: 22bcfc6
h: refs/heads/master
i:
  329277: f7a9af9
  329275: 703e05c
  329271: 3fb326f
  329263: a603c07
  329247: 048718b
  329215: 9dc43ba
v: v3
  • Loading branch information
Daniel Vetter committed Aug 9, 2012
1 parent 48308cb commit 5ca0ee2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 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: 004777cb22a29e0a95dd1bfce6816a5a06db1e1d
refs/heads/master: 22bcfc6a4b2288675a54b761ebcd85b9613ab9a6
32 changes: 25 additions & 7 deletions trunk/drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,14 @@ i915_error_state_write(struct file *filp,
struct seq_file *m = filp->private_data;
struct i915_error_state_file_priv *error_priv = m->private;
struct drm_device *dev = error_priv->dev;
int ret;

DRM_DEBUG_DRIVER("Resetting error state\n");

mutex_lock(&dev->struct_mutex);
ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
return ret;

i915_destroy_error_state(dev);
mutex_unlock(&dev->struct_mutex);

Expand Down Expand Up @@ -1450,8 +1454,12 @@ static int i915_swizzle_info(struct seq_file *m, void *data)
struct drm_info_node *node = (struct drm_info_node *) m->private;
struct drm_device *dev = node->minor->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
int ret;

ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
return ret;

mutex_lock(&dev->struct_mutex);
seq_printf(m, "bit6 swizzle for X-tiling = %s\n",
swizzle_string(dev_priv->mm.bit_6_swizzle_x));
seq_printf(m, "bit6 swizzle for Y-tiling = %s\n",
Expand Down Expand Up @@ -1652,7 +1660,7 @@ i915_ring_stop_write(struct file *filp,
struct drm_device *dev = filp->private_data;
struct drm_i915_private *dev_priv = dev->dev_private;
char buf[20];
int val = 0;
int val = 0, ret;

if (cnt > 0) {
if (cnt > sizeof(buf) - 1)
Expand All @@ -1667,7 +1675,10 @@ i915_ring_stop_write(struct file *filp,

DRM_DEBUG_DRIVER("Stopping rings 0x%08x\n", val);

mutex_lock(&dev->struct_mutex);
ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
return ret;

dev_priv->stop_rings = val;
mutex_unlock(&dev->struct_mutex);

Expand Down Expand Up @@ -1844,12 +1855,15 @@ i915_cache_sharing_read(struct file *filp,
drm_i915_private_t *dev_priv = dev->dev_private;
char buf[80];
u32 snpcr;
int len;
int len, ret;

if (!(IS_GEN6(dev) || IS_GEN7(dev)))
return -ENODEV;

mutex_lock(&dev_priv->dev->struct_mutex);
ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
return ret;

snpcr = I915_READ(GEN6_MBCUNIT_SNPCR);
mutex_unlock(&dev_priv->dev->struct_mutex);

Expand Down Expand Up @@ -1959,6 +1973,7 @@ static int i915_forcewake_release(struct inode *inode, struct file *file)
{
struct drm_device *dev = inode->i_private;
struct drm_i915_private *dev_priv = dev->dev_private;
int ret;

if (INTEL_INFO(dev)->gen < 6)
return 0;
Expand All @@ -1970,7 +1985,10 @@ static int i915_forcewake_release(struct inode *inode, struct file *file)
* hanging here is probably a minor inconvenience not to be seen my
* almost every user.
*/
mutex_lock(&dev->struct_mutex);
ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
return ret;

gen6_gt_force_wake_put(dev_priv);
mutex_unlock(&dev->struct_mutex);

Expand Down

0 comments on commit 5ca0ee2

Please sign in to comment.