diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-06-16 15:18:54 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-06-26 22:11:22 -0400 |
commit | 7c9017e5b77118439952fe8dc22809bae4fae4b6 (patch) | |
tree | efcb66be2ab7ccefcff8f9e7bea048cba352d379 | |
parent | 8c9f3aaf8e174ca914889ab7a916586f8fd1e641 (diff) |
drm/i915: add Ivy Bridge page flip support
Use the blit ring for submitting flips since the render ring doesn't
generate flip complete interrupts.
Fixes bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=38362
https://bugs.freedesktop.org/show_bug.cgi?id=38392
https://bugs.freedesktop.org/show_bug.cgi?id=38393
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Tested-by: Jian J Zhao <jian.j.zhao@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 0f4ed2a575a4..21b6f93fe919 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -6411,6 +6411,39 @@ out: | |||
6411 | return ret; | 6411 | return ret; |
6412 | } | 6412 | } |
6413 | 6413 | ||
6414 | /* | ||
6415 | * On gen7 we currently use the blit ring because (in early silicon at least) | ||
6416 | * the render ring doesn't give us interrpts for page flip completion, which | ||
6417 | * means clients will hang after the first flip is queued. Fortunately the | ||
6418 | * blit ring generates interrupts properly, so use it instead. | ||
6419 | */ | ||
6420 | static int intel_gen7_queue_flip(struct drm_device *dev, | ||
6421 | struct drm_crtc *crtc, | ||
6422 | struct drm_framebuffer *fb, | ||
6423 | struct drm_i915_gem_object *obj) | ||
6424 | { | ||
6425 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
6426 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
6427 | struct intel_ring_buffer *ring = &dev_priv->ring[BCS]; | ||
6428 | int ret; | ||
6429 | |||
6430 | ret = intel_pin_and_fence_fb_obj(dev, obj, ring); | ||
6431 | if (ret) | ||
6432 | goto out; | ||
6433 | |||
6434 | ret = intel_ring_begin(ring, 4); | ||
6435 | if (ret) | ||
6436 | goto out; | ||
6437 | |||
6438 | intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19)); | ||
6439 | intel_ring_emit(ring, (fb->pitch | obj->tiling_mode)); | ||
6440 | intel_ring_emit(ring, (obj->gtt_offset)); | ||
6441 | intel_ring_emit(ring, (MI_NOOP)); | ||
6442 | intel_ring_advance(ring); | ||
6443 | out: | ||
6444 | return ret; | ||
6445 | } | ||
6446 | |||
6414 | static int intel_default_queue_flip(struct drm_device *dev, | 6447 | static int intel_default_queue_flip(struct drm_device *dev, |
6415 | struct drm_crtc *crtc, | 6448 | struct drm_crtc *crtc, |
6416 | struct drm_framebuffer *fb, | 6449 | struct drm_framebuffer *fb, |
@@ -7758,6 +7791,9 @@ static void intel_init_display(struct drm_device *dev) | |||
7758 | case 6: | 7791 | case 6: |
7759 | dev_priv->display.queue_flip = intel_gen6_queue_flip; | 7792 | dev_priv->display.queue_flip = intel_gen6_queue_flip; |
7760 | break; | 7793 | break; |
7794 | case 7: | ||
7795 | dev_priv->display.queue_flip = intel_gen7_queue_flip; | ||
7796 | break; | ||
7761 | } | 7797 | } |
7762 | } | 7798 | } |
7763 | 7799 | ||