diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-03-11 13:37:33 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-12 11:13:31 -0400 |
commit | 8ac36ec1e370cb8ff9c082972ad0570bba37381a (patch) | |
tree | 0fbecce623e05e731b0edd2b2b0776d9b14055be | |
parent | 02f6a1e750df8201561171c47472435557a65864 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e71dda5feab2..8c3746f7b523 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2477,8 +2477,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
2477 | ret = intel_pin_and_fence_fb_obj(dev, | 2477 | ret = intel_pin_and_fence_fb_obj(dev, |
2478 | to_intel_framebuffer(fb)->obj, | 2478 | to_intel_framebuffer(fb)->obj, |
2479 | NULL); | 2479 | NULL); |
2480 | mutex_unlock(&dev->struct_mutex); | ||
2480 | if (ret != 0) { | 2481 | if (ret != 0) { |
2481 | mutex_unlock(&dev->struct_mutex); | ||
2482 | DRM_ERROR("pin & fence failed\n"); | 2482 | DRM_ERROR("pin & fence failed\n"); |
2483 | return ret; | 2483 | return ret; |
2484 | } | 2484 | } |
@@ -2516,6 +2516,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
2516 | 2516 | ||
2517 | ret = dev_priv->display.update_plane(crtc, fb, x, y); | 2517 | ret = dev_priv->display.update_plane(crtc, fb, x, y); |
2518 | if (ret) { | 2518 | if (ret) { |
2519 | mutex_lock(&dev->struct_mutex); | ||
2519 | intel_unpin_fb_obj(to_intel_framebuffer(fb)->obj); | 2520 | intel_unpin_fb_obj(to_intel_framebuffer(fb)->obj); |
2520 | mutex_unlock(&dev->struct_mutex); | 2521 | mutex_unlock(&dev->struct_mutex); |
2521 | DRM_ERROR("failed to update base address\n"); | 2522 | DRM_ERROR("failed to update base address\n"); |
@@ -2530,9 +2531,12 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
2530 | if (old_fb) { | 2531 | if (old_fb) { |
2531 | if (intel_crtc->active && old_fb != fb) | 2532 | if (intel_crtc->active && old_fb != fb) |
2532 | intel_wait_for_vblank(dev, intel_crtc->pipe); | 2533 | intel_wait_for_vblank(dev, intel_crtc->pipe); |
2534 | mutex_lock(&dev->struct_mutex); | ||
2533 | intel_unpin_fb_obj(to_intel_framebuffer(old_fb)->obj); | 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 | intel_update_fbc(dev); | 2540 | intel_update_fbc(dev); |
2537 | intel_edp_psr_update(dev); | 2541 | intel_edp_psr_update(dev); |
2538 | mutex_unlock(&dev->struct_mutex); | 2542 | mutex_unlock(&dev->struct_mutex); |