aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c3
-rw-r--r--drivers/gpu/drm/i915/intel_overlay.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 0239e9974bf2..2b79588541e7 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -2182,9 +2182,8 @@ int i915_driver_unload(struct drm_device *dev)
2182 /* Flush any outstanding unpin_work. */ 2182 /* Flush any outstanding unpin_work. */
2183 flush_workqueue(dev_priv->wq); 2183 flush_workqueue(dev_priv->wq);
2184 2184
2185 i915_gem_free_all_phys_object(dev);
2186
2187 mutex_lock(&dev->struct_mutex); 2185 mutex_lock(&dev->struct_mutex);
2186 i915_gem_free_all_phys_object(dev);
2188 i915_gem_cleanup_ringbuffer(dev); 2187 i915_gem_cleanup_ringbuffer(dev);
2189 mutex_unlock(&dev->struct_mutex); 2188 mutex_unlock(&dev->struct_mutex);
2190 if (I915_HAS_FBC(dev) && i915_powersave) 2189 if (I915_HAS_FBC(dev) && i915_powersave)
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index a670c006982e..56a8e2aea19c 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -1416,6 +1416,8 @@ void intel_setup_overlay(struct drm_device *dev)
1416 goto out_free; 1416 goto out_free;
1417 overlay->reg_bo = reg_bo; 1417 overlay->reg_bo = reg_bo;
1418 1418
1419 mutex_lock(&dev->struct_mutex);
1420
1419 if (OVERLAY_NEEDS_PHYSICAL(dev)) { 1421 if (OVERLAY_NEEDS_PHYSICAL(dev)) {
1420 ret = i915_gem_attach_phys_object(dev, reg_bo, 1422 ret = i915_gem_attach_phys_object(dev, reg_bo,
1421 I915_GEM_PHYS_OVERLAY_REGS, 1423 I915_GEM_PHYS_OVERLAY_REGS,
@@ -1440,6 +1442,8 @@ void intel_setup_overlay(struct drm_device *dev)
1440 } 1442 }
1441 } 1443 }
1442 1444
1445 mutex_unlock(&dev->struct_mutex);
1446
1443 /* init all values */ 1447 /* init all values */
1444 overlay->color_key = 0x0101fe; 1448 overlay->color_key = 0x0101fe;
1445 overlay->brightness = -19; 1449 overlay->brightness = -19;
@@ -1464,6 +1468,7 @@ out_unpin_bo:
1464 i915_gem_object_unpin(reg_bo); 1468 i915_gem_object_unpin(reg_bo);
1465out_free_bo: 1469out_free_bo:
1466 drm_gem_object_unreference(&reg_bo->base); 1470 drm_gem_object_unreference(&reg_bo->base);
1471 mutex_unlock(&dev->struct_mutex);
1467out_free: 1472out_free:
1468 kfree(overlay); 1473 kfree(overlay);
1469 return; 1474 return;