diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2014-07-09 16:22:11 -0700 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-07-10 08:51:15 +0200 |
commit | ebcdd39eafb1d87e1aa31edfb65cd53bfc604346 (patch) | |
tree | 57234ea0b321540cfba84f75bdf99eae57552669 /drivers/gpu/drm/i915 | |
parent | 4c34574fd9e6f3ed34ebe67fbabb0fef0b0754e3 (diff) | |
download | blackbird-op-linux-ebcdd39eafb1d87e1aa31edfb65cd53bfc604346.tar.gz blackbird-op-linux-ebcdd39eafb1d87e1aa31edfb65cd53bfc604346.zip |
drm/i915: Add a couple WARN()'s to catch missing locks
Add !mutex_is_locked() checks to intel_pin_and_fence_fb_obj() and
intel_unpin_fb_obj() to help catch failures to grab struct_mutex when
operating on fb objects.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 0029d4398866..f5986b2ad252 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2196,6 +2196,8 @@ intel_pin_and_fence_fb_obj(struct drm_device *dev, u32 alignment; int ret; + WARN_ON(!mutex_is_locked(&dev->struct_mutex)); + switch (obj->tiling_mode) { case I915_TILING_NONE: if (IS_BROADWATER(dev) || IS_CRESTLINE(dev)) @@ -2252,6 +2254,8 @@ err_interruptible: void intel_unpin_fb_obj(struct drm_i915_gem_object *obj) { + WARN_ON(!mutex_is_locked(&obj->base.dev->struct_mutex)); + i915_gem_object_unpin_fence(obj); i915_gem_object_unpin_from_display_plane(obj); } |