summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-02-09 06:09:42 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-02-09 06:09:42 +0000
commit7729d2d20c432cc6874364635b2448dadadcbffd (patch)
treeb69a905d17d9fac38a7ef8be5b2fe87025522a02 /sys
parent9d3139f1dcb65019336f868e270bf5ba9fb97657 (diff)
Don't enable vblank if the pipe is disabled.
Based on a patch from the intel driver maintainers (Jesse Barnes, specifically) Tested by several people on various hardware.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/i915_irq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/i915_irq.c b/sys/dev/pci/drm/i915_irq.c
index 0fe89b323f4..62fa49c8fad 100644
--- a/sys/dev/pci/drm/i915_irq.c
+++ b/sys/dev/pci/drm/i915_irq.c
@@ -362,6 +362,10 @@ int i915_enable_vblank(struct drm_device *dev, int plane)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int pipe = i915_get_pipe(dev, plane);
+ int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF;
+
+ if ((I915_READ(pipeconf_reg) & PIPEACONF_ENABLE) == 0)
+ return (EINVAL);
mtx_enter(&dev_priv->user_irq_lock);
i915_enable_pipestat(dev_priv, pipe, (IS_I965G(dev_priv) ?