diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-03-26 13:35:20 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-06-18 20:59:53 -0400 |
commit | 1afe3e9d4335bf3bc5615e37243dc8fef65dac8f (patch) | |
tree | ddf1bc38a43a1f2cd6b289efe8837173a8bdca24 /drivers/gpu/drm/i915/intel_display.c | |
parent | 83f7fd055eb3f1e843803cd906179d309553967b (diff) |
drm/i915: gen3 page flipping fixes
Gen3 chips have slightly different flip commands, and also contain a bit
that indicates whether a "flip pending" interrupt means the flip has
been queued or has been completed.
So implement support for the gen3 flip command, and make sure we use the
flip pending interrupt correctly depending on the value of ECOSKPD bit
0.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index dc65a1de5f0..6db778a75e4 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4603,10 +4603,10 @@ static void intel_unpin_work_fn(struct work_struct *__work) | |||
4603 | kfree(work); | 4603 | kfree(work); |
4604 | } | 4604 | } |
4605 | 4605 | ||
4606 | void intel_finish_page_flip(struct drm_device *dev, int pipe) | 4606 | static void do_intel_finish_page_flip(struct drm_device *dev, |
4607 | struct drm_crtc *crtc) | ||
4607 | { | 4608 | { |
4608 | drm_i915_private_t *dev_priv = dev->dev_private; | 4609 | drm_i915_private_t *dev_priv = dev->dev_private; |
4609 | struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; | ||
4610 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 4610 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
4611 | struct intel_unpin_work *work; | 4611 | struct intel_unpin_work *work; |
4612 | struct drm_i915_gem_object *obj_priv; | 4612 | struct drm_i915_gem_object *obj_priv; |
@@ -4650,6 +4650,22 @@ void intel_finish_page_flip(struct drm_device *dev, int pipe) | |||
4650 | schedule_work(&work->work); | 4650 | schedule_work(&work->work); |
4651 | } | 4651 | } |
4652 | 4652 | ||
4653 | void intel_finish_page_flip(struct drm_device *dev, int pipe) | ||
4654 | { | ||
4655 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
4656 | struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; | ||
4657 | |||
4658 | do_intel_finish_page_flip(dev, crtc); | ||
4659 | } | ||
4660 | |||
4661 | void intel_finish_page_flip_plane(struct drm_device *dev, int plane) | ||
4662 | { | ||
4663 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
4664 | struct drm_crtc *crtc = dev_priv->plane_to_crtc_mapping[plane]; | ||
4665 | |||
4666 | do_intel_finish_page_flip(dev, crtc); | ||
4667 | } | ||
4668 | |||
4653 | void intel_prepare_page_flip(struct drm_device *dev, int plane) | 4669 | void intel_prepare_page_flip(struct drm_device *dev, int plane) |
4654 | { | 4670 | { |
4655 | drm_i915_private_t *dev_priv = dev->dev_private; | 4671 | drm_i915_private_t *dev_priv = dev->dev_private; |
@@ -4745,14 +4761,17 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4745 | ; | 4761 | ; |
4746 | 4762 | ||
4747 | BEGIN_LP_RING(4); | 4763 | BEGIN_LP_RING(4); |
4748 | OUT_RING(MI_DISPLAY_FLIP | | ||
4749 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | ||
4750 | OUT_RING(fb->pitch); | ||
4751 | if (IS_I965G(dev)) { | 4764 | if (IS_I965G(dev)) { |
4765 | OUT_RING(MI_DISPLAY_FLIP | | ||
4766 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | ||
4767 | OUT_RING(fb->pitch); | ||
4752 | OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode); | 4768 | OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode); |
4753 | pipesrc = I915_READ(pipesrc_reg); | 4769 | pipesrc = I915_READ(pipesrc_reg); |
4754 | OUT_RING(pipesrc & 0x0fff0fff); | 4770 | OUT_RING(pipesrc & 0x0fff0fff); |
4755 | } else { | 4771 | } else { |
4772 | OUT_RING(MI_DISPLAY_FLIP_I915 | | ||
4773 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | ||
4774 | OUT_RING(fb->pitch); | ||
4756 | OUT_RING(obj_priv->gtt_offset); | 4775 | OUT_RING(obj_priv->gtt_offset); |
4757 | OUT_RING(MI_NOOP); | 4776 | OUT_RING(MI_NOOP); |
4758 | } | 4777 | } |