SOURCES (LINUX_2_6): linux-intelgraphics-2008q4.patch (NEW) http://intellin...

arekm arekm at pld-linux.org
Fri Mar 13 09:37:35 CET 2009


Author: arekm                        Date: Fri Mar 13 08:37:35 2009 GMT
Module: SOURCES                       Tag: LINUX_2_6
---- Log message:
http://intellinuxgraphics.org/download/2008Q4-rc4/2008q4-kernel-against-2.6.28.patch

---- Files affected:
SOURCES:
   linux-intelgraphics-2008q4.patch (NONE -> 1.1.2.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/linux-intelgraphics-2008q4.patch
diff -u /dev/null SOURCES/linux-intelgraphics-2008q4.patch:1.1.2.1
--- /dev/null	Fri Mar 13 09:37:35 2009
+++ SOURCES/linux-intelgraphics-2008q4.patch	Fri Mar 13 09:37:29 2009
@@ -0,0 +1,211 @@
+commit e1a6fcee467556a7e955fe1f7ccc134dd2f974e7
+Author: Jesse Barnes <jbarnes at virtuousgeek.org>
+Date:   Tue Jan 6 10:21:24 2009 -0800
+
+    drm/i915: set vblank enabled flag correctly across IRQ install/uninstall
+    
+    In the absence of kernel mode setting, many drivers disable IRQs across VT
+    switch.  The core DRM vblank code is missing a check for this case however;
+    even after IRQ disable, the vblank code will still have the vblank_enabled
+    flag set, so unless we track the fact that they're disabled at IRQ uninstall
+    time, when we VT switch back in we won't actually re-enable them, which means
+    any apps waiting on vblank before the switch will hang.
+    
+    This patch does that and also adds a sanity check to the wait condition to
+    look for the irq_enabled flag in general, as well as adding a wakeup to the
+    IRQ uninstall path.
+    
+    Fixes fdo bug #18879 with compiz hangs at VT switch.
+    
+    Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+    Signed-off-by: Eric Anholt <eric at anholt.net>
+
+diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
+index 1e787f8..e2f5d23 100644
+--- a/drivers/gpu/drm/drm_irq.c
++++ b/drivers/gpu/drm/drm_irq.c
+@@ -259,7 +259,8 @@ EXPORT_SYMBOL(drm_irq_install);
+  */
+ int drm_irq_uninstall(struct drm_device * dev)
+ {
+-	int irq_enabled;
++	unsigned long irqflags;
++	int irq_enabled, i;
+ 
+ 	if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
+ 		return -EINVAL;
+@@ -269,6 +270,16 @@ int drm_irq_uninstall(struct drm_device * dev)
+ 	dev->irq_enabled = 0;
+ 	mutex_unlock(&dev->struct_mutex);
+ 
++	/*
++	 * Wake up any waiters so they don't hang.
++	 */
++	spin_lock_irqsave(&dev->vbl_lock, irqflags);
++	for (i = 0; i < dev->num_crtcs; i++) {
++		DRM_WAKEUP(&dev->vbl_queue[i]);
++		dev->vblank_enabled[i] = 0;
++	}
++	spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
++
+ 	if (!irq_enabled)
+ 		return -EINVAL;
+ 
+@@ -617,8 +628,9 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
+ 		DRM_DEBUG("waiting on vblank count %d, crtc %d\n",
+ 			  vblwait->request.sequence, crtc);
+ 		DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ,
+-			    ((drm_vblank_count(dev, crtc)
+-			      - vblwait->request.sequence) <= (1 << 23)));
++			    (((drm_vblank_count(dev, crtc) -
++			       vblwait->request.sequence) <= (1 << 23)) ||
++			     !dev->irq_enabled));
+ 
+ 		if (ret != -EINTR) {
+ 			struct timeval now;
+
+commit 9f4f07ceb1716d8796089fcef91621c5f07c872a
+Author: Jesse Barnes <jbarnes at virtuousgeek.org>
+Date:   Thu Jan 8 10:42:15 2009 -0800
+
+    drm/i915: don't enable vblanks on disabled pipes
+    
+    In some cases userland may be confused and try to wait on vblank events from
+    pipes that aren't actually enabled.  We shouldn't allow this, so return
+    -EINVAL if the pipe isn't on.
+    
+    Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
+    Signed-off-by: Eric Anholt <eric at anholt.net>
+
+diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
+index 69b9a42..81ac2bd 100644
+--- a/drivers/gpu/drm/i915/i915_irq.c
++++ b/drivers/gpu/drm/i915/i915_irq.c
+@@ -400,6 +400,12 @@ int i915_enable_vblank(struct drm_device *dev, int pipe)
+ {
+ 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
+ 	unsigned long irqflags;
++	int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF;
++	u32 pipeconf;
++
++	pipeconf = I915_READ(pipeconf_reg);
++	if (!(pipeconf & PIPEACONF_ENABLE))
++		return -EINVAL;
+ 
+ 	spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
+ 	if (IS_I965G(dev))
+
+commit a0b55c920a72959846837cfa18e0975c3c9c0229
+Author: Eric Anholt <eric at anholt.net>
+Date:   Sun Jan 4 17:49:05 2009 -0800
+
+    drm/i915: Don't double-unpin buffers when interrupted in evict_everything.
+    
+    Haven't seen this in practice, but it would be possible for the X Server to
+    trigger it.
+    
+    Signed-off-by: Eric Anholt <eric at anholt.net>
+
+diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
+index 109cc85..7247824 100644
+--- a/drivers/gpu/drm/i915/i915_gem.c
++++ b/drivers/gpu/drm/i915/i915_gem.c
+@@ -2039,6 +2039,7 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
+ 		/* unpin all of our buffers */
+ 		for (i = 0; i < pinned; i++)
+ 			i915_gem_object_unpin(object_list[i]);
++		pinned = 0;
+ 
+ 		/* evict everyone we can from the aperture */
+ 		ret = i915_gem_evict_everything(dev);
+
+commit dd2e41c2c85b337cb8dffed425f6bfa82d8eceb4
+Author: Eric Anholt <eric at anholt.net>
+Date:   Sat Jan 3 01:47:37 2009 -0800
+
+    drm/i915: Don't complain when interrupted while pinning in execbuffers.
+    
+    Signed-off-by: Eric Anholt <eric at anholt.net>
+
+diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
+index 88e85ce..109cc85 100644
+--- a/drivers/gpu/drm/i915/i915_gem.c
++++ b/drivers/gpu/drm/i915/i915_gem.c
+@@ -2031,7 +2031,8 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
+ 
+ 		/* error other than GTT full, or we've already tried again */
+ 		if (ret != -ENOMEM || pin_tries >= 1) {
+-			DRM_ERROR("Failed to pin buffers %d\n", ret);
++			if (ret != -ERESTARTSYS)
++				DRM_ERROR("Failed to pin buffers %d\n", ret);
+ 			goto err;
+ 		}
+ 
+
+commit ed1509da84bdc58e5425c2d59860bd311e373064
+Author: Eric Anholt <eric at anholt.net>
+Date:   Tue Dec 23 18:42:32 2008 -0800
+
+    drm/i915: Don't allow objects to get bound while VT switched.
+    
+    This avoids a BUG_ON in the enter_vt path due to objects being in the GTT
+    when we shouldn't have ever let them be (as we're not supposed to touch the
+    device during that time).
+    
+    This was triggered by a change in the 2D driver to use the GTT mapping of
+    objects after pinning them to improve software fallback performance.
+    
+    Signed-off-by: Eric Anholt <eric at anholt.net>
+
+diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
+index 24fe8c1..88e85ce 100644
+--- a/drivers/gpu/drm/i915/i915_gem.c
++++ b/drivers/gpu/drm/i915/i915_gem.c
+@@ -1161,6 +1161,8 @@ i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment)
+ 	struct drm_mm_node *free_space;
+ 	int page_count, ret;
+ 
++	if (dev_priv->mm.suspended)
++		return -EBUSY;
+ 	if (alignment == 0)
+ 		alignment = PAGE_SIZE;
+ 	if (alignment & (PAGE_SIZE - 1)) {
+@@ -2178,7 +2180,8 @@ i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment)
+ 	if (obj_priv->gtt_space == NULL) {
+ 		ret = i915_gem_object_bind_to_gtt(obj, alignment);
+ 		if (ret != 0) {
+-			DRM_ERROR("Failure to bind: %d", ret);
++			if (ret != -EBUSY && ret != -ERESTARTSYS)
++				DRM_ERROR("Failure to bind: %d", ret);
+ 			return ret;
+ 		}
+ 	}
+@@ -2700,20 +2703,21 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data,
+ 		dev_priv->mm.wedged = 0;
+ 	}
+ 
+-	ret = i915_gem_init_ringbuffer(dev);
+-	if (ret != 0)
+-		return ret;
+-
+ 	dev_priv->mm.gtt_mapping = io_mapping_create_wc(dev->agp->base,
+ 							dev->agp->agp_info.aper_size
+ 							* 1024 * 1024);
+ 
+ 	mutex_lock(&dev->struct_mutex);
++	dev_priv->mm.suspended = 0;
++
++	ret = i915_gem_init_ringbuffer(dev);
++	if (ret != 0)
++		return ret;
++
+ 	BUG_ON(!list_empty(&dev_priv->mm.active_list));
+ 	BUG_ON(!list_empty(&dev_priv->mm.flushing_list));
+ 	BUG_ON(!list_empty(&dev_priv->mm.inactive_list));
+ 	BUG_ON(!list_empty(&dev_priv->mm.request_list));
+-	dev_priv->mm.suspended = 0;
+ 	mutex_unlock(&dev->struct_mutex);
+ 
+ 	drm_irq_install(dev);
+
+
================================================================


More information about the pld-cvs-commit mailing list