Commit 8ac36ec1e370cb8ff9c082972ad0570bba37381a

Authored by Ville Syrjälä
Committed by Daniel Vetter
1 parent 02f6a1e750

drm/i915: Reduce the time we hold struct mutex in intel_pipe_set_base()

We don't need to hold struct_mutex all through intel_pipe_set_base(),
just need to hold it while pinning/unpinning the buffers.

So reduce the struct_mutext usage in intel_pipe_set_base() just like we
did for the sprite code in:
 commit 82284b6becdbef6d8cd3fb43e8698510833a5129
 Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
 Date:   Tue Oct 1 18:02:12 2013 +0300

    drm/i915: Reduce the time we hold struct mutex in sprite update_plane code

The FBC and PSR locking is still entirely fubar. That stuff was
previouly done while holding struct_mutex, so leave it there for now.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff

drivers/gpu/drm/i915/intel_display.c
... ... @@ -2477,8 +2477,8 @@
2477 2477 ret = intel_pin_and_fence_fb_obj(dev,
2478 2478 to_intel_framebuffer(fb)->obj,
2479 2479 NULL);
  2480 + mutex_unlock(&dev->struct_mutex);
2480 2481 if (ret != 0) {
2481   - mutex_unlock(&dev->struct_mutex);
2482 2482 DRM_ERROR("pin & fence failed\n");
2483 2483 return ret;
2484 2484 }
... ... @@ -2516,6 +2516,7 @@
2516 2516  
2517 2517 ret = dev_priv->display.update_plane(crtc, fb, x, y);
2518 2518 if (ret) {
  2519 + mutex_lock(&dev->struct_mutex);
2519 2520 intel_unpin_fb_obj(to_intel_framebuffer(fb)->obj);
2520 2521 mutex_unlock(&dev->struct_mutex);
2521 2522 DRM_ERROR("failed to update base address\n");
2522 2523  
2523 2524  
... ... @@ -2530,9 +2531,12 @@
2530 2531 if (old_fb) {
2531 2532 if (intel_crtc->active && old_fb != fb)
2532 2533 intel_wait_for_vblank(dev, intel_crtc->pipe);
  2534 + mutex_lock(&dev->struct_mutex);
2533 2535 intel_unpin_fb_obj(to_intel_framebuffer(old_fb)->obj);
  2536 + mutex_unlock(&dev->struct_mutex);
2534 2537 }
2535 2538  
  2539 + mutex_lock(&dev->struct_mutex);
2536 2540 intel_update_fbc(dev);
2537 2541 intel_edp_psr_update(dev);
2538 2542 mutex_unlock(&dev->struct_mutex);