diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2010-10-21 14:35:54 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-21 14:38:25 -0400 |
commit | dc3f82c2e5c3f06e43855f417e4fcfc244383916 (patch) | |
tree | 1e7b48d80495c0ce2911ad397cb35b55578c87cb /drivers/gpu/drm/i915/intel_display.c | |
parent | f00a3ddf91d596bece5fa31e8ce2e8a3b4c0623b (diff) |
drm/i915: Fix current fb blocking for page flip
Block execbuffer for the fb to be flipped away, not the one that is to
be flipped in.
[ickle: rewritten for -next]
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e031d82381e5..990f065374b2 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4991,9 +4991,7 @@ static void do_intel_finish_page_flip(struct drm_device *dev, | |||
4991 | 4991 | ||
4992 | spin_unlock_irqrestore(&dev->event_lock, flags); | 4992 | spin_unlock_irqrestore(&dev->event_lock, flags); |
4993 | 4993 | ||
4994 | obj_priv = to_intel_bo(work->pending_flip_obj); | 4994 | obj_priv = to_intel_bo(work->old_fb_obj); |
4995 | |||
4996 | /* Initial scanout buffer will have a 0 pending flip count */ | ||
4997 | atomic_clear_mask(1 << intel_crtc->plane, | 4995 | atomic_clear_mask(1 << intel_crtc->plane, |
4998 | &obj_priv->pending_flip.counter); | 4996 | &obj_priv->pending_flip.counter); |
4999 | if (atomic_read(&obj_priv->pending_flip) == 0) | 4997 | if (atomic_read(&obj_priv->pending_flip) == 0) |
@@ -5092,9 +5090,14 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
5092 | if (ret) | 5090 | if (ret) |
5093 | goto cleanup_objs; | 5091 | goto cleanup_objs; |
5094 | 5092 | ||
5095 | obj_priv = to_intel_bo(obj); | 5093 | /* Block clients from rendering to the new back buffer until |
5096 | atomic_add(1 << intel_crtc->plane, &obj_priv->pending_flip); | 5094 | * the flip occurs and the object is no longer visible. |
5095 | */ | ||
5096 | atomic_add(1 << intel_crtc->plane, | ||
5097 | &to_intel_bo(work->old_fb_obj)->pending_flip); | ||
5098 | |||
5097 | work->pending_flip_obj = obj; | 5099 | work->pending_flip_obj = obj; |
5100 | obj_priv = to_intel_bo(obj); | ||
5098 | 5101 | ||
5099 | if (IS_GEN3(dev) || IS_GEN2(dev)) { | 5102 | if (IS_GEN3(dev) || IS_GEN2(dev)) { |
5100 | u32 flip_mask; | 5103 | u32 flip_mask; |