drm/i915: page flip support for Ironlake
authorJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 29 Jan 2010 19:18:31 +0000 (11:18 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 29 Jan 2010 23:29:47 +0000 (15:29 -0800)
This patch adds support for page flipping on Ironlake, which uses
different interrupt bits for triggering flip submit IRQs.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
[anholt: hand-resolved for rebasing off of render power saving patch]
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_irq.c

index fcd87ad75fecf7a466f2c9e31514f3b0a16140c5..50ddf4a95c5e0a587c62b9c1a74905ac61e850ec 100644 (file)
@@ -309,11 +309,21 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev)
        if (de_iir & DE_GSE)
                ironlake_opregion_gse_intr(dev);
 
-       if (de_iir & DE_PIPEA_VBLANK)
+       if (de_iir & DE_PLANEA_FLIP_DONE)
+               intel_prepare_page_flip(dev, 0);
+
+       if (de_iir & DE_PLANEB_FLIP_DONE)
+               intel_prepare_page_flip(dev, 1);
+
+       if (de_iir & DE_PIPEA_VBLANK) {
                drm_handle_vblank(dev, 0);
+               intel_finish_page_flip(dev, 0);
+       }
 
-       if (de_iir & DE_PIPEB_VBLANK)
+       if (de_iir & DE_PIPEB_VBLANK) {
                drm_handle_vblank(dev, 1);
+               intel_finish_page_flip(dev, 1);
+       }
 
        /* check event from PCH */
        if ((de_iir & DE_PCH_EVENT) &&
@@ -1022,7 +1032,8 @@ static int ironlake_irq_postinstall(struct drm_device *dev)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        /* enable kind of interrupts always enabled */
-       u32 display_mask = DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT;
+       u32 display_mask = DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT |
+                          DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE;
        u32 render_mask = GT_USER_INTERRUPT;
        u32 hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG |
                           SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG;