aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-06-13 04:10:53 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-13 11:45:28 -0400
commit60a5ca015ffd2aacfe5674b5a401cd2a37159e07 (patch)
tree8dafae791a58ce6884e6b3c3d2c8f385c99beb1c /drivers/gpu/drm/i915/intel_display.c
parent642f9bb558decd546c73dfc7064f2138a3428f23 (diff)
drm/i915: Add locking around framebuffer_references--
obj->framebuffer_references isn't an atomic_t so the decrement needs to be protected by some lock. struct_mutex seems like the appropriate lock here, and we may already take it for the obj unref anyway. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1880c18a4e09..b9251c863cd2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11594,11 +11594,14 @@ static void intel_setup_outputs(struct drm_device *dev)
11594 11594
11595static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb) 11595static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb)
11596{ 11596{
11597 struct drm_device *dev = fb->dev;
11597 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); 11598 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
11598 11599
11599 drm_framebuffer_cleanup(fb); 11600 drm_framebuffer_cleanup(fb);
11601 mutex_lock(&dev->struct_mutex);
11600 WARN_ON(!intel_fb->obj->framebuffer_references--); 11602 WARN_ON(!intel_fb->obj->framebuffer_references--);
11601 drm_gem_object_unreference_unlocked(&intel_fb->obj->base); 11603 drm_gem_object_unreference(&intel_fb->obj->base);
11604 mutex_unlock(&dev->struct_mutex);
11602 kfree(intel_fb); 11605 kfree(intel_fb);
11603} 11606}
11604 11607