Debugging power usage, I discovered that the i915 DRM driver forces pipe
A vblank interrupts in i915_driver_irq_postinstall whenever interrupts
are disabled. This happens on EnterVT, and hence on resume from suspend.

Here's a proposed fix that retains the existing semantic of having
vblank enabled on pipe A until the X server turns it off.

# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   shared-core/i915_drv.h
#       modified:   shared-core/i915_irq.c
#
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h
index e8a7be2..bb49ee3 100644
--- a/shared-core/i915_drv.h
+++ b/shared-core/i915_drv.h
@@ -111,6 +111,7 @@ typedef struct drm_i915_private {
        int allow_batchbuffer;
        struct mem_block *agp_heap;
        unsigned int sr01, adpa, ppcr, dvob, dvoc, lvds;
+       int vblank_set;
        int vblank_pipe;
        spinlock_t user_irq_lock;
        int user_irq_refcount;
diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c
index 8748b64..1f795f5 100644
--- a/shared-core/i915_irq.c
+++ b/shared-core/i915_irq.c
@@ -532,6 +532,7 @@ int i915_vblank_pipe_set(DRM_IOCTL_ARGS)
                return DRM_ERR(EINVAL);
        }
 
+       dev_priv->vblank_set = 1;
        dev_priv->vblank_pipe = pipe.pipe;
 
        i915_enable_interrupt (dev);
@@ -726,7 +727,7 @@ void i915_driver_irq_postinstall(drm_device_t * dev)
        INIT_LIST_HEAD(&dev_priv->vbl_swaps.head);
        dev_priv->swaps_pending = 0;
 
-       if (!dev_priv->vblank_pipe)
+       if (!dev_priv->vblank_pipe && !dev_priv->vblank_set)
                dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A;
 
        dev_priv->swaps_lock = SPIN_LOCK_UNLOCKED;
@@ -736,8 +737,6 @@ void i915_driver_irq_postinstall(drm_device_t * dev)
        dev_priv->user_irq_lock = SPIN_LOCK_UNLOCKED;
        dev_priv->user_irq_refcount = 0;
 
-       if (!dev_priv->vblank_pipe)
-               dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A;
        i915_enable_interrupt(dev);
        DRM_INIT_WAITQUEUE(&dev_priv->irq_queue);
 
        
-- 
[EMAIL PROTECTED]

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to