From 34be91fe4e9f0ad73b7c4354aea0c8ce10f45f68 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 26 Apr 2007 14:50:00 +1000 Subject: [PATCH] i915: fix vblank pipe setup --- linux-core/intel_display.c | 24 ++++++++++++++++++++---- shared-core/i915_drv.h | 1 + shared-core/i915_irq.c | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/linux-core/intel_display.c b/linux-core/intel_display.c index a6f94fb1..7d581175 100644 --- a/linux-core/intel_display.c +++ b/linux-core/intel_display.c @@ -333,6 +333,24 @@ static bool intel_find_best_PLL(struct drm_crtc *crtc, int target, return (err != target); } +void +intel_set_vblank(drm_device_t *dev) +{ + drm_i915_private_t *dev_priv = dev->dev_private; + struct drm_crtc *crtc; + struct intel_crtc *intel_crtc; + int vbl_pipe = 0; + + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { + intel_crtc = crtc->driver_private; + + if (crtc->enabled) + vbl_pipe |= (1<pipe); + } + + dev_priv->vblank_pipe = vbl_pipe; + i915_enable_interrupt(dev); +} void intel_wait_for_vblank(drm_device_t *dev) { @@ -910,10 +928,8 @@ static void intel_crtc_mode_set(struct drm_crtc *crtc, /* Flush the plane changes */ intel_pipe_set_base(crtc, x, y); -#ifdef XF86DRI // TODO -// I830DRISetVBlankInterrupt (pScrn, TRUE); -#endif - + intel_set_vblank(dev); + intel_wait_for_vblank(dev); } diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h index 2dd76d30..946e464f 100644 --- a/shared-core/i915_drv.h +++ b/shared-core/i915_drv.h @@ -237,6 +237,7 @@ extern int i915_vblank_pipe_get(DRM_IOCTL_ARGS); extern int i915_emit_irq(drm_device_t * dev); extern void i915_user_irq_on(drm_i915_private_t *dev_priv); extern void i915_user_irq_off(drm_i915_private_t *dev_priv); +extern void i915_enable_interrupt (drm_device_t *dev); extern int i915_vblank_swap(DRM_IOCTL_ARGS); /* i915_mem.c */ diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index 4047e77e..870fe402 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -489,7 +489,7 @@ int i915_irq_wait(DRM_IOCTL_ARGS) return i915_wait_irq(dev, irqwait.irq_seq); } -static void i915_enable_interrupt (drm_device_t *dev) +void i915_enable_interrupt (drm_device_t *dev) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;