diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-07 09:03:04 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-08-01 22:03:44 -0400 |
commit | 96b099fd6d64389e619dbf7ca9059bf16e441f6b (patch) | |
tree | c163193a7f2c60e9bca7b6d6f12babd43c70f32b /drivers | |
parent | 5f35308bab7efd8c03e4bb4feea07f9b94138c3c (diff) |
drm/i915: Propagate error from drm_vblank_get() during page-flipping.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f2f812e15e61..bf486b142839 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4897,19 +4897,8 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4897 | 4897 | ||
4898 | mutex_lock(&dev->struct_mutex); | 4898 | mutex_lock(&dev->struct_mutex); |
4899 | ret = intel_pin_and_fence_fb_obj(dev, obj); | 4899 | ret = intel_pin_and_fence_fb_obj(dev, obj); |
4900 | if (ret != 0) { | 4900 | if (ret) |
4901 | mutex_unlock(&dev->struct_mutex); | 4901 | goto cleanup_work; |
4902 | |||
4903 | spin_lock_irqsave(&dev->event_lock, flags); | ||
4904 | intel_crtc->unpin_work = NULL; | ||
4905 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
4906 | |||
4907 | kfree(work); | ||
4908 | |||
4909 | DRM_DEBUG_DRIVER("flip queue: %p pin & fence failed\n", | ||
4910 | to_intel_bo(obj)); | ||
4911 | return ret; | ||
4912 | } | ||
4913 | 4902 | ||
4914 | /* Reference the objects for the scheduled work. */ | 4903 | /* Reference the objects for the scheduled work. */ |
4915 | drm_gem_object_reference(work->old_fb_obj); | 4904 | drm_gem_object_reference(work->old_fb_obj); |
@@ -4917,7 +4906,11 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4917 | 4906 | ||
4918 | crtc->fb = fb; | 4907 | crtc->fb = fb; |
4919 | i915_gem_object_flush_write_domain(obj); | 4908 | i915_gem_object_flush_write_domain(obj); |
4920 | drm_vblank_get(dev, intel_crtc->pipe); | 4909 | |
4910 | ret = drm_vblank_get(dev, intel_crtc->pipe); | ||
4911 | if (ret) | ||
4912 | goto cleanup_objs; | ||
4913 | |||
4921 | obj_priv = to_intel_bo(obj); | 4914 | obj_priv = to_intel_bo(obj); |
4922 | atomic_inc(&obj_priv->pending_flip); | 4915 | atomic_inc(&obj_priv->pending_flip); |
4923 | work->pending_flip_obj = obj; | 4916 | work->pending_flip_obj = obj; |
@@ -4954,6 +4947,20 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4954 | trace_i915_flip_request(intel_crtc->plane, obj); | 4947 | trace_i915_flip_request(intel_crtc->plane, obj); |
4955 | 4948 | ||
4956 | return 0; | 4949 | return 0; |
4950 | |||
4951 | cleanup_objs: | ||
4952 | drm_gem_object_unreference(work->old_fb_obj); | ||
4953 | drm_gem_object_unreference(obj); | ||
4954 | cleanup_work: | ||
4955 | mutex_unlock(&dev->struct_mutex); | ||
4956 | |||
4957 | spin_lock_irqsave(&dev->event_lock, flags); | ||
4958 | intel_crtc->unpin_work = NULL; | ||
4959 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
4960 | |||
4961 | kfree(work); | ||
4962 | |||
4963 | return ret; | ||
4957 | } | 4964 | } |
4958 | 4965 | ||
4959 | static const struct drm_crtc_helper_funcs intel_helper_funcs = { | 4966 | static const struct drm_crtc_helper_funcs intel_helper_funcs = { |