summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-09-18 21:03:22 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2007-09-18 21:06:55 +0100
commite349b58b4a6ebfe299720cb921039a600c145e65 (patch)
tree7a728f79c31b9ad18ced51a9385b94bfe38cf639 /shared-core
parent78d111fa967d18e7f9f9b2acd26aff20b884eb6c (diff)
i915: Reinstate check that drawable has valid information in i915_vblank_swap.
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/i915_irq.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c
index ea84c708..7baa23c0 100644
--- a/shared-core/i915_irq.c
+++ b/shared-core/i915_irq.c
@@ -612,6 +612,21 @@ int i915_vblank_swap(struct drm_device *dev, void *data,
return -EINVAL;
}
+ DRM_SPINLOCK_IRQSAVE(&dev->drw_lock, irqflags);
+
+ /* It makes no sense to schedule a swap for a drawable that doesn't have
+ * valid information at this point. E.g. this could mean that the X
+ * server is too old to push drawable information to the DRM, in which
+ * case all such swaps would become ineffective.
+ */
+ if (!drm_get_drawable_info(dev, swap->drawable)) {
+ DRM_SPINUNLOCK_IRQRESTORE(&dev->drw_lock, irqflags);
+ DRM_DEBUG("Invalid drawable ID %d\n", swap->drawable);
+ return -EINVAL;
+ }
+
+ DRM_SPINUNLOCK_IRQRESTORE(&dev->drw_lock, irqflags);
+
curseq = atomic_read(pipe ? &dev->vbl_received2 : &dev->vbl_received);
if (seqtype == _DRM_VBLANK_RELATIVE)